@dinofront/design_system 1.2.1 → 1.2.2
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/Accordion/Accordion.types.d.ts +7 -7
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +8 -6
- package/dist/components/Radio/Radio.types.d.ts +13 -6
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/Select/Select.types.d.ts +5 -5
- package/dist/components/Tabs/Tabs.types.d.ts +7 -7
- package/dist/hooks/useOnOutsideClick.d.ts +1 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +989 -977
- package/dist/index.js.map +1 -1
- package/dist/lib/optionValue.d.ts +10 -0
- package/dist/types/base.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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, Construction as O, Copy as k, File as A, Info as j, Loader2 as M, Menu as N, Minus as P, Moon as F, MoreHorizontal as I, Paperclip as L, Pencil as R, Plus as z, Search as ee, SearchX as B, Sparkles as V, Sun as te, Trash2 as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { extendTailwindMerge as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { Controller as
|
|
8
|
-
import { yupResolver as
|
|
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, Construction as O, Copy as k, File as A, Info as j, Loader2 as M, Menu as N, Minus as P, Moon as F, MoreHorizontal as I, Paperclip as L, Pencil as R, Plus as z, Search as ee, SearchX as B, Sparkles as V, Sun as te, Trash2 as ne, UploadCloud as re, User as ie, Users as ae, X as H, XCircle as U } from "lucide-react";
|
|
3
|
+
import { clsx as oe } from "clsx";
|
|
4
|
+
import { extendTailwindMerge as W } from "tailwind-merge";
|
|
5
|
+
import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
|
|
6
|
+
import { createPortal as J } from "react-dom";
|
|
7
|
+
import { Controller as se, useFieldArray as ce, useForm as le } from "react-hook-form";
|
|
8
|
+
import { yupResolver as ue } from "@hookform/resolvers/yup";
|
|
9
9
|
//#region src/lib/cn.ts
|
|
10
|
-
var
|
|
10
|
+
var de = W({ extend: { theme: { text: [
|
|
11
11
|
"h-xl",
|
|
12
12
|
"h-lg",
|
|
13
13
|
"h-md",
|
|
@@ -26,91 +26,91 @@ var ce = K({ extend: { theme: { text: [
|
|
|
26
26
|
"label-xs",
|
|
27
27
|
"label-xxs"
|
|
28
28
|
] } } });
|
|
29
|
-
function
|
|
30
|
-
return
|
|
29
|
+
function Y(...e) {
|
|
30
|
+
return de(oe(e));
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/components/Divider/Divider.tsx
|
|
34
|
-
var
|
|
34
|
+
var fe = {
|
|
35
35
|
horizontal: "h-0 w-full border-t",
|
|
36
36
|
vertical: "w-0 h-full self-stretch border-l"
|
|
37
|
-
},
|
|
37
|
+
}, pe = {
|
|
38
38
|
solid: "border-solid",
|
|
39
39
|
dashed: "border-dashed"
|
|
40
|
-
},
|
|
40
|
+
}, me = {
|
|
41
41
|
default: "border-border-default",
|
|
42
42
|
subtle: "border-border-subtle",
|
|
43
43
|
strong: "border-border-strong",
|
|
44
44
|
brand: "border-border-brand"
|
|
45
|
-
},
|
|
46
|
-
return /* @__PURE__ */
|
|
45
|
+
}, he = a(function({ orientation: e = "horizontal", variant: t = "solid", color: n = "default", className: r, dataTestId: i, ...a }, o) {
|
|
46
|
+
return /* @__PURE__ */ K("div", {
|
|
47
47
|
ref: o,
|
|
48
48
|
role: "separator",
|
|
49
49
|
"aria-orientation": e,
|
|
50
50
|
"data-test-id": i,
|
|
51
|
-
className:
|
|
51
|
+
className: Y("shrink-0", fe[e], pe[t], me[n], r),
|
|
52
52
|
...a
|
|
53
53
|
});
|
|
54
|
-
}),
|
|
55
|
-
function
|
|
56
|
-
let e = c(
|
|
54
|
+
}), X = (e, t) => e !== void 0 && t !== void 0 && String(e) === String(t), ge = (e, t) => e.some((e) => X(e, t)), _e = r(null);
|
|
55
|
+
function ve() {
|
|
56
|
+
let e = c(_e);
|
|
57
57
|
if (!e) throw Error("AccordionItem must be used inside <Accordion>");
|
|
58
58
|
return e;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ye(e) {
|
|
61
61
|
return e === void 0 ? [] : Array.isArray(e) ? e : [e];
|
|
62
62
|
}
|
|
63
|
-
var
|
|
64
|
-
let [d, f] = m(() =>
|
|
65
|
-
return /* @__PURE__ */
|
|
63
|
+
var be = 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) {
|
|
64
|
+
let [d, f] = m(() => ye(t)), p = n !== void 0, h = p ? ye(n) : d;
|
|
65
|
+
return /* @__PURE__ */ K(_e.Provider, {
|
|
66
66
|
value: {
|
|
67
67
|
openValues: h,
|
|
68
68
|
toggle: (t) => {
|
|
69
|
-
let n;
|
|
70
|
-
|
|
69
|
+
let n = ge(h, t), i;
|
|
70
|
+
i = e === "single" ? n ? [] : [t] : n ? h.filter((e) => !X(e, t)) : [...h, t], p || f(i), r?.(e === "single" ? i[0] : i);
|
|
71
71
|
},
|
|
72
72
|
animated: i,
|
|
73
73
|
showDivider: a
|
|
74
74
|
},
|
|
75
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ K("div", {
|
|
76
76
|
ref: u,
|
|
77
77
|
"data-test-id": c,
|
|
78
|
-
className:
|
|
78
|
+
className: Y("flex flex-col divide-y divide-border-default border border-border-default rounded-lg overflow-hidden bg-bg-default", o),
|
|
79
79
|
...l,
|
|
80
80
|
children: s
|
|
81
81
|
})
|
|
82
82
|
});
|
|
83
|
-
}),
|
|
84
|
-
let { openValues: l, toggle: d, animated: f, showDivider: p } =
|
|
85
|
-
return /* @__PURE__ */
|
|
83
|
+
}), xe = a(function({ value: e, title: t, icon: n, disabled: r, className: i, children: a, dataTestId: o, ...s }, c) {
|
|
84
|
+
let { openValues: l, toggle: d, animated: f, showDivider: p } = ve(), m = ge(l, e), h = u(), g = u(), _ = /* @__PURE__ */ q(G, { children: [p && /* @__PURE__ */ K(he, { className: "mb-4" }), a] });
|
|
85
|
+
return /* @__PURE__ */ q("div", {
|
|
86
86
|
ref: c,
|
|
87
87
|
"data-test-id": o,
|
|
88
88
|
"data-state": m ? "open" : "closed",
|
|
89
|
-
className:
|
|
89
|
+
className: Y("group", i),
|
|
90
90
|
...s,
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ K("h3", { children: /* @__PURE__ */ q("button", {
|
|
92
92
|
id: g,
|
|
93
93
|
type: "button",
|
|
94
94
|
onClick: () => d(e),
|
|
95
95
|
disabled: r,
|
|
96
96
|
"aria-expanded": m,
|
|
97
97
|
"aria-controls": h,
|
|
98
|
-
className:
|
|
99
|
-
children: [/* @__PURE__ */
|
|
98
|
+
className: Y("flex w-full items-center justify-between gap-3 px-5 py-4 text-left", "text-p-md font-medium text-fg-default", "hover:bg-bg-container transition-colors", "focus-visible:outline-none focus-visible:bg-bg-container", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
99
|
+
children: [/* @__PURE__ */ q("span", {
|
|
100
100
|
className: "inline-flex items-center gap-3",
|
|
101
|
-
children: [n && /* @__PURE__ */
|
|
101
|
+
children: [n && /* @__PURE__ */ K("span", {
|
|
102
102
|
className: "inline-flex text-fg-secondary",
|
|
103
103
|
children: n
|
|
104
104
|
}), t]
|
|
105
|
-
}), /* @__PURE__ */
|
|
106
|
-
className:
|
|
105
|
+
}), /* @__PURE__ */ K(S, {
|
|
106
|
+
className: Y("h-5 w-5 shrink-0 text-fg-secondary transition-transform duration-200", m && "rotate-180"),
|
|
107
107
|
"aria-hidden": !0
|
|
108
108
|
})]
|
|
109
|
-
}) }), f ? /* @__PURE__ */
|
|
110
|
-
className:
|
|
111
|
-
children: /* @__PURE__ */
|
|
109
|
+
}) }), f ? /* @__PURE__ */ K("div", {
|
|
110
|
+
className: Y("grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none", m ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
111
|
+
children: /* @__PURE__ */ K("div", {
|
|
112
112
|
className: "overflow-hidden min-h-0",
|
|
113
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ K("div", {
|
|
114
114
|
id: h,
|
|
115
115
|
role: "region",
|
|
116
116
|
"aria-labelledby": g,
|
|
@@ -119,7 +119,7 @@ var ge = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
119
119
|
children: _
|
|
120
120
|
})
|
|
121
121
|
})
|
|
122
|
-
}) : /* @__PURE__ */
|
|
122
|
+
}) : /* @__PURE__ */ K("div", {
|
|
123
123
|
id: h,
|
|
124
124
|
role: "region",
|
|
125
125
|
"aria-labelledby": g,
|
|
@@ -128,26 +128,26 @@ var ge = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
128
128
|
children: _
|
|
129
129
|
})]
|
|
130
130
|
});
|
|
131
|
-
}),
|
|
131
|
+
}), Se = {
|
|
132
132
|
xs: "h-6 w-6 text-p-xs",
|
|
133
133
|
sm: "h-8 w-8 text-p-sm",
|
|
134
134
|
md: "h-10 w-10 text-p-std",
|
|
135
135
|
lg: "h-12 w-12 text-p-md",
|
|
136
136
|
xl: "h-16 w-16 text-h-xs",
|
|
137
137
|
"2xl": "h-20 w-20 text-h-xs"
|
|
138
|
-
},
|
|
138
|
+
}, Ce = {
|
|
139
139
|
xs: "h-1.5 w-1.5",
|
|
140
140
|
sm: "h-2 w-2",
|
|
141
141
|
md: "h-2.5 w-2.5",
|
|
142
142
|
lg: "h-3 w-3",
|
|
143
143
|
xl: "h-3.5 w-3.5",
|
|
144
144
|
"2xl": "h-4 w-4"
|
|
145
|
-
},
|
|
145
|
+
}, we = {
|
|
146
146
|
online: "bg-green-500",
|
|
147
147
|
offline: "bg-gray-400 dark:bg-gray-500",
|
|
148
148
|
away: "bg-yellow-600",
|
|
149
149
|
busy: "bg-red-600"
|
|
150
|
-
},
|
|
150
|
+
}, Te = {
|
|
151
151
|
xs: "-ml-1.5",
|
|
152
152
|
sm: "-ml-2",
|
|
153
153
|
md: "-ml-2.5",
|
|
@@ -155,11 +155,11 @@ var ge = a(function({ type: e = "single", defaultValue: t, value: n, onValueChan
|
|
|
155
155
|
xl: "-ml-4",
|
|
156
156
|
"2xl": "-ml-5"
|
|
157
157
|
};
|
|
158
|
-
function
|
|
158
|
+
function Ee(e) {
|
|
159
159
|
let t = e.trim().split(/\s+/);
|
|
160
160
|
return t.length === 0 ? "" : t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function De(e) {
|
|
163
163
|
let t = [
|
|
164
164
|
"bg-brand-500",
|
|
165
165
|
"bg-blue-600",
|
|
@@ -171,66 +171,66 @@ function Ce(e) {
|
|
|
171
171
|
for (let t = 0; t < e.length; t++) n = (n << 5) - n + e.charCodeAt(t), n |= 0;
|
|
172
172
|
return t[Math.abs(n) % t.length];
|
|
173
173
|
}
|
|
174
|
-
var
|
|
175
|
-
let [d, f] = m(!1), p = !!e && !d, h = n ?
|
|
176
|
-
return /* @__PURE__ */
|
|
174
|
+
var Oe = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape: a = "circle", fallback: o, className: s, dataTestId: c, ...l }, u) {
|
|
175
|
+
let [d, f] = m(!1), p = !!e && !d, h = n ? Ee(n) : "", g = n ? De(n) : "bg-gray-300 dark:bg-gray-600";
|
|
176
|
+
return /* @__PURE__ */ q("span", {
|
|
177
177
|
ref: u,
|
|
178
178
|
"data-test-id": c,
|
|
179
|
-
className:
|
|
179
|
+
className: Y("relative inline-flex shrink-0", s),
|
|
180
180
|
...l,
|
|
181
|
-
children: [/* @__PURE__ */
|
|
182
|
-
className:
|
|
183
|
-
children: p ? /* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ K("span", {
|
|
182
|
+
className: Y("inline-flex items-center justify-center overflow-hidden font-semibold text-white select-none", Se[r], a === "circle" ? "rounded-full" : "rounded-md", !p && g),
|
|
183
|
+
children: p ? /* @__PURE__ */ K("img", {
|
|
184
184
|
src: e,
|
|
185
185
|
alt: t ?? n ?? "",
|
|
186
186
|
onError: () => f(!0),
|
|
187
187
|
className: "h-full w-full object-cover"
|
|
188
|
-
}) : n ? h : o ?? /* @__PURE__ */
|
|
189
|
-
}), i && /* @__PURE__ */
|
|
188
|
+
}) : n ? h : o ?? /* @__PURE__ */ K(ie, { className: "h-1/2 w-1/2 text-white/90" })
|
|
189
|
+
}), i && /* @__PURE__ */ K("span", {
|
|
190
190
|
"aria-label": i,
|
|
191
|
-
className:
|
|
191
|
+
className: Y("absolute right-0 bottom-0 rounded-full ring-2 ring-white", Ce[r], we[i])
|
|
192
192
|
})]
|
|
193
193
|
});
|
|
194
|
-
}),
|
|
194
|
+
}), ke = a(function({ size: e = "md", max: t, children: n, className: r, dataTestId: i, ...a }, o) {
|
|
195
195
|
let s = Array.isArray(n) ? n : [n], c = t === void 0 ? s : s.slice(0, t), l = t === void 0 ? 0 : s.length - t;
|
|
196
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ q("div", {
|
|
197
197
|
ref: o,
|
|
198
198
|
"data-test-id": i,
|
|
199
|
-
className:
|
|
199
|
+
className: Y("inline-flex items-center", r),
|
|
200
200
|
...a,
|
|
201
|
-
children: [c.map((t, n) => /* @__PURE__ */
|
|
202
|
-
className:
|
|
201
|
+
children: [c.map((t, n) => /* @__PURE__ */ K("div", {
|
|
202
|
+
className: Y("rounded-full ring-2 ring-white", n > 0 && Te[e]),
|
|
203
203
|
style: { zIndex: c.length - n },
|
|
204
204
|
children: t
|
|
205
|
-
}, n)), l > 0 && /* @__PURE__ */
|
|
206
|
-
className:
|
|
207
|
-
children: /* @__PURE__ */
|
|
205
|
+
}, n)), l > 0 && /* @__PURE__ */ K("div", {
|
|
206
|
+
className: Y("rounded-full ring-2 ring-white", Te[e]),
|
|
207
|
+
children: /* @__PURE__ */ K(Oe, {
|
|
208
208
|
size: e,
|
|
209
209
|
name: `+${l}`
|
|
210
210
|
})
|
|
211
211
|
})]
|
|
212
212
|
});
|
|
213
|
-
}),
|
|
213
|
+
}), Ae = {
|
|
214
214
|
lg: "h-7 px-2.5 text-p-std gap-1.5",
|
|
215
215
|
md: "h-6 px-2 text-p-sm gap-1",
|
|
216
216
|
sm: "h-5 px-1.5 text-p-sm gap-1",
|
|
217
217
|
xs: "h-4 px-1 text-p-xs gap-0.5"
|
|
218
|
-
},
|
|
218
|
+
}, je = {
|
|
219
219
|
lg: "rounded-md",
|
|
220
220
|
md: "rounded-md",
|
|
221
221
|
sm: "rounded",
|
|
222
222
|
xs: "rounded"
|
|
223
|
-
},
|
|
223
|
+
}, Me = {
|
|
224
224
|
lg: "size-2.5",
|
|
225
225
|
md: "size-2",
|
|
226
226
|
sm: "size-1.5",
|
|
227
227
|
xs: "size-1"
|
|
228
|
-
},
|
|
228
|
+
}, Ne = {
|
|
229
229
|
lg: "min-w-7 px-0 justify-center",
|
|
230
230
|
md: "min-w-6 px-0 justify-center",
|
|
231
231
|
sm: "min-w-5 px-0 justify-center",
|
|
232
232
|
xs: "min-w-4 px-0 justify-center"
|
|
233
|
-
},
|
|
233
|
+
}, Pe = {
|
|
234
234
|
neutral: "bg-bg-subtle text-fg-default border border-border-default",
|
|
235
235
|
brand: "bg-brand-20 text-brand-800 border border-brand-100",
|
|
236
236
|
success: "bg-green-50 text-green-800 border border-green-100",
|
|
@@ -238,7 +238,7 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
238
238
|
danger: "bg-red-50 text-red-800 border border-red-100",
|
|
239
239
|
info: "bg-blue-50 text-blue-800 border border-blue-100",
|
|
240
240
|
privacy: "bg-purple-50 text-purple-800 border border-purple-100"
|
|
241
|
-
},
|
|
241
|
+
}, Fe = {
|
|
242
242
|
neutral: "bg-transparent text-fg-default border border-border-strong",
|
|
243
243
|
brand: "bg-transparent text-brand-700 border border-brand-500",
|
|
244
244
|
success: "bg-transparent text-green-700 border border-green-500",
|
|
@@ -246,7 +246,7 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
246
246
|
danger: "bg-transparent text-red-700 border border-red-500",
|
|
247
247
|
info: "bg-transparent text-blue-700 border border-blue-500",
|
|
248
248
|
privacy: "bg-transparent text-purple-700 border border-purple-500"
|
|
249
|
-
},
|
|
249
|
+
}, Ie = {
|
|
250
250
|
neutral: "bg-fg-default text-bg-default",
|
|
251
251
|
brand: "bg-brand-500 text-white",
|
|
252
252
|
success: "bg-green-600 text-white",
|
|
@@ -254,22 +254,22 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
254
254
|
danger: "bg-red-700 text-white",
|
|
255
255
|
info: "bg-blue-600 text-white",
|
|
256
256
|
privacy: "bg-purple-500 text-white"
|
|
257
|
-
},
|
|
257
|
+
}, Le = {
|
|
258
258
|
filled: "hover:brightness-95 active:brightness-90",
|
|
259
259
|
outline: "hover:bg-bg-subtle active:bg-bg-container",
|
|
260
260
|
accent: "hover:brightness-90 active:brightness-80"
|
|
261
|
-
},
|
|
262
|
-
let v = t === "filled" ?
|
|
263
|
-
if (s) return /* @__PURE__ */
|
|
261
|
+
}, Re = 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 }, _) {
|
|
262
|
+
let v = t === "filled" ? Pe[e] : t === "outline" ? Fe[e] : Ie[e];
|
|
263
|
+
if (s) return /* @__PURE__ */ K("span", {
|
|
264
264
|
ref: _,
|
|
265
265
|
"data-test-id": p,
|
|
266
266
|
"aria-hidden": !g["aria-label"] || void 0,
|
|
267
267
|
onClick: l ? void 0 : m,
|
|
268
|
-
className:
|
|
268
|
+
className: Y("inline-block shrink-0 rounded-full", Me[n], Ie[e], l && "opacity-50", d),
|
|
269
269
|
...g
|
|
270
270
|
});
|
|
271
|
-
let y = f == null && !c && !!(i || a), b = r === "pill" ? "rounded-full" :
|
|
272
|
-
return /* @__PURE__ */
|
|
271
|
+
let y = f == null && !c && !!(i || a), b = r === "pill" ? "rounded-full" : je[n];
|
|
272
|
+
return /* @__PURE__ */ q("span", {
|
|
273
273
|
ref: _,
|
|
274
274
|
"data-test-id": p,
|
|
275
275
|
role: u ? "button" : void 0,
|
|
@@ -279,83 +279,83 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
279
279
|
onKeyDown: u ? (e) => {
|
|
280
280
|
h?.(e), !(l || !m) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m(e));
|
|
281
281
|
} : h,
|
|
282
|
-
className:
|
|
282
|
+
className: Y("inline-flex items-center font-medium whitespace-nowrap select-none", Ae[n], b, v, y && Ne[n], u && !l && Y("cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", Le[t]), l && "opacity-50 cursor-not-allowed pointer-events-none", d),
|
|
283
283
|
...g,
|
|
284
284
|
children: [
|
|
285
|
-
c ? /* @__PURE__ */
|
|
286
|
-
className:
|
|
285
|
+
c ? /* @__PURE__ */ K("span", {
|
|
286
|
+
className: Y("inline-block shrink-0 rounded-full", Me[n], Ie[e]),
|
|
287
287
|
"aria-hidden": !0
|
|
288
|
-
}) : i && /* @__PURE__ */
|
|
288
|
+
}) : i && /* @__PURE__ */ K("span", {
|
|
289
289
|
className: "inline-flex shrink-0",
|
|
290
290
|
children: i
|
|
291
291
|
}),
|
|
292
292
|
f,
|
|
293
|
-
a && !o && /* @__PURE__ */
|
|
293
|
+
a && !o && /* @__PURE__ */ K("span", {
|
|
294
294
|
className: "inline-flex shrink-0",
|
|
295
295
|
children: a
|
|
296
296
|
}),
|
|
297
|
-
o && /* @__PURE__ */
|
|
297
|
+
o && /* @__PURE__ */ K("button", {
|
|
298
298
|
type: "button",
|
|
299
299
|
onClick: o,
|
|
300
300
|
disabled: l,
|
|
301
301
|
"aria-label": "Dismiss",
|
|
302
302
|
className: "inline-flex shrink-0 -mr-0.5 rounded-full p-0.5 hover:bg-black/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
303
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ K(H, { className: "h-3 w-3" })
|
|
304
304
|
})
|
|
305
305
|
]
|
|
306
306
|
});
|
|
307
|
-
}),
|
|
307
|
+
}), ze = {
|
|
308
308
|
md: "text-p-sm",
|
|
309
309
|
sm: "text-p-xs"
|
|
310
|
-
},
|
|
310
|
+
}, Be = "rounded-sm text-fg-tertiary transition-colors hover:text-fg-secondary outline-none focus-visible:ring-2 focus-visible:ring-brand-300", Ve = a(function({ items: e, currentValue: n, onSelect: r, separator: i = "/", size: a = "md", className: o, dataTestId: s, ...c }, l) {
|
|
311
311
|
let u = n ?? e[e.length - 1]?.value;
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ K("nav", {
|
|
313
313
|
ref: l,
|
|
314
314
|
"aria-label": "Breadcrumb",
|
|
315
315
|
"data-test-id": s,
|
|
316
|
-
className:
|
|
316
|
+
className: Y(ze[a], o),
|
|
317
317
|
...c,
|
|
318
|
-
children: /* @__PURE__ */
|
|
318
|
+
children: /* @__PURE__ */ K("ol", {
|
|
319
319
|
className: "flex items-center",
|
|
320
320
|
children: e.map((e, n) => {
|
|
321
321
|
let a = e.value === u;
|
|
322
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ q(t, { children: [n > 0 && /* @__PURE__ */ K("li", {
|
|
323
323
|
"aria-hidden": "true",
|
|
324
324
|
className: "px-1.5 text-fg-tertiary",
|
|
325
325
|
children: i
|
|
326
|
-
}), /* @__PURE__ */
|
|
326
|
+
}), /* @__PURE__ */ K("li", {
|
|
327
327
|
className: "flex items-center",
|
|
328
|
-
children: a ? /* @__PURE__ */
|
|
328
|
+
children: a ? /* @__PURE__ */ K("span", {
|
|
329
329
|
"aria-current": "page",
|
|
330
330
|
className: "font-medium text-fg-default",
|
|
331
331
|
children: e.label
|
|
332
|
-
}) : e.disabled ? /* @__PURE__ */
|
|
332
|
+
}) : e.disabled ? /* @__PURE__ */ K("span", {
|
|
333
333
|
className: "cursor-not-allowed text-fg-disabled",
|
|
334
334
|
children: e.label
|
|
335
|
-
}) : e.href ? /* @__PURE__ */
|
|
335
|
+
}) : e.href ? /* @__PURE__ */ K("a", {
|
|
336
336
|
href: e.href,
|
|
337
337
|
onClick: () => r?.(e.value),
|
|
338
|
-
className:
|
|
338
|
+
className: Be,
|
|
339
339
|
children: e.label
|
|
340
|
-
}) : /* @__PURE__ */
|
|
340
|
+
}) : /* @__PURE__ */ K("button", {
|
|
341
341
|
type: "button",
|
|
342
342
|
onClick: () => r?.(e.value),
|
|
343
|
-
className:
|
|
343
|
+
className: Be,
|
|
344
344
|
children: e.label
|
|
345
345
|
})
|
|
346
346
|
})] }, e.value);
|
|
347
347
|
})
|
|
348
348
|
})
|
|
349
349
|
});
|
|
350
|
-
}),
|
|
350
|
+
}), He = {
|
|
351
351
|
lg: "h-12 px-5 text-p-md gap-2 rounded-lg",
|
|
352
352
|
md: "h-10 px-4 text-p-std gap-2 rounded-lg",
|
|
353
353
|
sm: "h-8 px-3 text-p-sm gap-1.5 rounded-md"
|
|
354
|
-
},
|
|
354
|
+
}, Ue = {
|
|
355
355
|
lg: "h-12 w-12 rounded-lg",
|
|
356
356
|
md: "h-10 w-10 rounded-lg",
|
|
357
357
|
sm: "h-8 w-8 rounded-md"
|
|
358
|
-
},
|
|
358
|
+
}, We = {
|
|
359
359
|
primary: [
|
|
360
360
|
"bg-brand-500 text-white border border-transparent",
|
|
361
361
|
"hover:bg-brand-600 active:bg-brand-700",
|
|
@@ -380,13 +380,13 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
380
380
|
"disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed",
|
|
381
381
|
"focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:ring-offset-2"
|
|
382
382
|
].join(" ")
|
|
383
|
-
},
|
|
383
|
+
}, Ge = {
|
|
384
384
|
primary: "bg-brand-700",
|
|
385
385
|
secondary: "bg-bg-subtle",
|
|
386
386
|
tertiary: "bg-bg-subtle",
|
|
387
387
|
danger: "bg-red-900"
|
|
388
|
-
},
|
|
389
|
-
return /* @__PURE__ */
|
|
388
|
+
}, Ke = 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) {
|
|
389
|
+
return /* @__PURE__ */ K("button", {
|
|
390
390
|
ref: m,
|
|
391
391
|
disabled: c || i,
|
|
392
392
|
"aria-pressed": s,
|
|
@@ -398,108 +398,108 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
398
398
|
}
|
|
399
399
|
d?.(e);
|
|
400
400
|
},
|
|
401
|
-
className:
|
|
401
|
+
className: Y("inline-flex items-center justify-center font-medium transition-colors outline-none", a ? Ue[t] : He[t], We[e], s && Ge[e], o && "w-full", l),
|
|
402
402
|
...p,
|
|
403
|
-
children: i ? /* @__PURE__ */
|
|
403
|
+
children: i ? /* @__PURE__ */ K(M, {
|
|
404
404
|
className: "h-4 w-4 animate-spin",
|
|
405
405
|
"aria-hidden": !0
|
|
406
|
-
}) : /* @__PURE__ */
|
|
407
|
-
n && /* @__PURE__ */
|
|
406
|
+
}) : /* @__PURE__ */ q(G, { children: [
|
|
407
|
+
n && /* @__PURE__ */ K("span", {
|
|
408
408
|
className: "inline-flex shrink-0",
|
|
409
409
|
children: n
|
|
410
410
|
}),
|
|
411
411
|
u,
|
|
412
|
-
r && /* @__PURE__ */
|
|
412
|
+
r && /* @__PURE__ */ K("span", {
|
|
413
413
|
className: "inline-flex shrink-0",
|
|
414
414
|
children: r
|
|
415
415
|
})
|
|
416
416
|
] })
|
|
417
417
|
});
|
|
418
|
-
}),
|
|
418
|
+
}), qe = {
|
|
419
419
|
horizontal: "flex-row [&>*]:rounded-none [&>*:first-child]:rounded-l-lg [&>*:last-child]:rounded-r-lg [&>*:not(:first-child)]:-ml-px",
|
|
420
420
|
vertical: "flex-col [&>*]:rounded-none [&>*:first-child]:rounded-t-lg [&>*:last-child]:rounded-b-lg [&>*:not(:first-child)]:-mt-px"
|
|
421
|
-
},
|
|
422
|
-
return /* @__PURE__ */
|
|
421
|
+
}, Je = a(function({ orientation: e = "horizontal", className: t, children: n, dataTestId: r, ...i }, a) {
|
|
422
|
+
return /* @__PURE__ */ K("div", {
|
|
423
423
|
ref: a,
|
|
424
424
|
role: "group",
|
|
425
425
|
"data-test-id": r,
|
|
426
|
-
className:
|
|
426
|
+
className: Y("inline-flex isolate", qe[e], "[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10", t),
|
|
427
427
|
...i,
|
|
428
428
|
children: n
|
|
429
429
|
});
|
|
430
|
-
}),
|
|
430
|
+
}), Ye = {
|
|
431
431
|
elevated: "bg-bg-default border border-border-default shadow-z1",
|
|
432
432
|
outlined: "bg-bg-default border border-border-default",
|
|
433
433
|
filled: "bg-bg-container border border-transparent"
|
|
434
|
-
},
|
|
434
|
+
}, Xe = {
|
|
435
435
|
none: "p-0",
|
|
436
436
|
sm: "p-4",
|
|
437
437
|
md: "p-5",
|
|
438
438
|
lg: "p-6"
|
|
439
|
-
},
|
|
439
|
+
}, Ze = a(function({ variant: e = "outlined", padding: t = "md", header: n, footer: r, interactive: i = !1, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
440
440
|
let u = n || r;
|
|
441
|
-
return /* @__PURE__ */
|
|
441
|
+
return /* @__PURE__ */ q("div", {
|
|
442
442
|
ref: l,
|
|
443
443
|
"data-test-id": s,
|
|
444
|
-
className:
|
|
444
|
+
className: Y("rounded-xl overflow-hidden", Ye[e], i && "transition-all hover:border-brand-500 hover:shadow-z2", !u && Xe[t], a),
|
|
445
445
|
...c,
|
|
446
446
|
children: [
|
|
447
|
-
n && /* @__PURE__ */
|
|
448
|
-
className:
|
|
447
|
+
n && /* @__PURE__ */ K("div", {
|
|
448
|
+
className: Y("border-b border-border-subtle", Xe[t]),
|
|
449
449
|
children: n
|
|
450
450
|
}),
|
|
451
|
-
u ? /* @__PURE__ */
|
|
452
|
-
className:
|
|
451
|
+
u ? /* @__PURE__ */ K("div", {
|
|
452
|
+
className: Xe[t],
|
|
453
453
|
children: o
|
|
454
454
|
}) : o,
|
|
455
|
-
r && /* @__PURE__ */
|
|
456
|
-
className:
|
|
455
|
+
r && /* @__PURE__ */ K("div", {
|
|
456
|
+
className: Y("border-t border-border-subtle", Xe[t]),
|
|
457
457
|
children: r
|
|
458
458
|
})
|
|
459
459
|
]
|
|
460
460
|
});
|
|
461
|
-
}),
|
|
461
|
+
}), Qe = {
|
|
462
462
|
brand: "bg-bg-brand-lighter text-brand-800",
|
|
463
463
|
blue: "bg-bg-info-lighter text-blue-800",
|
|
464
464
|
purple: "bg-purple-50 text-purple-800 dark:bg-purple-900/30 dark:text-purple-200",
|
|
465
465
|
pink: "bg-pink-50 text-pink-800 dark:bg-pink-900/30 dark:text-pink-200",
|
|
466
466
|
yellow: "bg-bg-warning-lighter text-yellow-900",
|
|
467
467
|
gray: "bg-bg-subtle text-fg-secondary"
|
|
468
|
-
},
|
|
469
|
-
let c = e?.placement ?? "left", l = !!e && c !== "top", u = e && /* @__PURE__ */
|
|
470
|
-
className:
|
|
468
|
+
}, $e = a(function({ title: e, header: t, children: n, noDivider: r = !1, className: i, dataTestId: a, ...o }, s) {
|
|
469
|
+
let c = e?.placement ?? "left", l = !!e && c !== "top", u = e && /* @__PURE__ */ K("div", {
|
|
470
|
+
className: Y("flex shrink-0 items-center justify-center text-center text-label-md font-bold", l ? Y("px-2 [writing-mode:vertical-rl]", c === "left" && "rotate-180") : "px-4 py-2", Qe[e.color ?? "gray"]),
|
|
471
471
|
children: e.text
|
|
472
472
|
});
|
|
473
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ K(Ze, {
|
|
474
474
|
ref: s,
|
|
475
475
|
dataTestId: a,
|
|
476
476
|
variant: "outlined",
|
|
477
477
|
padding: "none",
|
|
478
478
|
className: i,
|
|
479
479
|
...o,
|
|
480
|
-
children: /* @__PURE__ */
|
|
481
|
-
className:
|
|
482
|
-
children: [u, /* @__PURE__ */
|
|
483
|
-
className:
|
|
480
|
+
children: /* @__PURE__ */ q("div", {
|
|
481
|
+
className: Y("flex", l ? c === "right" ? "flex-row-reverse" : "flex-row" : "flex-col"),
|
|
482
|
+
children: [u, /* @__PURE__ */ q("div", {
|
|
483
|
+
className: Y("min-w-0 flex-1", !r && "[&>*:not(:last-child)]:border-b [&>*:not(:last-child)]:border-border-default"),
|
|
484
484
|
children: [t, n]
|
|
485
485
|
})]
|
|
486
486
|
})
|
|
487
487
|
});
|
|
488
|
-
}),
|
|
488
|
+
}), et = {
|
|
489
489
|
md: "h-5 w-5 rounded-sm",
|
|
490
490
|
sm: "h-4 w-4 rounded-sm"
|
|
491
|
-
},
|
|
491
|
+
}, tt = {
|
|
492
492
|
md: "h-3.5 w-3.5",
|
|
493
493
|
sm: "h-3 w-3"
|
|
494
|
-
},
|
|
494
|
+
}, nt = a(function({ size: e = "md", label: t, description: n, indeterminate: r = !1, error: i = !1, id: a, disabled: o, checked: s, defaultChecked: c, className: l, dataTestId: d, ...f }, p) {
|
|
495
495
|
let m = u(), h = a ?? m;
|
|
496
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ q("label", {
|
|
497
497
|
htmlFor: h,
|
|
498
498
|
"data-test-id": d,
|
|
499
|
-
className:
|
|
500
|
-
children: [/* @__PURE__ */
|
|
499
|
+
className: Y("inline-flex items-start gap-2.5 group/checkbox", o ? "cursor-not-allowed opacity-60" : "cursor-pointer", l),
|
|
500
|
+
children: [/* @__PURE__ */ q("span", {
|
|
501
501
|
className: "relative inline-flex shrink-0 items-center justify-center mt-0.5",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
502
|
+
children: [/* @__PURE__ */ K("input", {
|
|
503
503
|
ref: p,
|
|
504
504
|
id: h,
|
|
505
505
|
type: "checkbox",
|
|
@@ -510,20 +510,20 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
510
510
|
"aria-invalid": i || void 0,
|
|
511
511
|
"aria-checked": r ? "mixed" : void 0,
|
|
512
512
|
...f
|
|
513
|
-
}), /* @__PURE__ */
|
|
514
|
-
className:
|
|
515
|
-
children:
|
|
516
|
-
className:
|
|
513
|
+
}), /* @__PURE__ */ K("span", {
|
|
514
|
+
className: Y("flex items-center justify-center border transition-colors", et[e], !r && "bg-bg-default", i ? "border-red-600" : r ? "border-brand-500" : "border-border-strong", !o && !r && (i ? "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", !r && "peer-checked:bg-brand-500 peer-checked:border-brand-500", r && "bg-brand-500", o && !r && "peer-checked:bg-bg-subtle peer-checked:border-border-strong", !r && "[&_svg]:opacity-0 peer-checked:[&_svg]:opacity-100 [&_svg]:transition-opacity"),
|
|
515
|
+
children: K(r ? P : b, {
|
|
516
|
+
className: Y(tt[e], "text-white"),
|
|
517
517
|
strokeWidth: 3,
|
|
518
518
|
"aria-hidden": !0
|
|
519
519
|
})
|
|
520
520
|
})]
|
|
521
|
-
}), (t || n) && /* @__PURE__ */
|
|
521
|
+
}), (t || n) && /* @__PURE__ */ q("span", {
|
|
522
522
|
className: "flex flex-col gap-0.5",
|
|
523
|
-
children: [t && /* @__PURE__ */
|
|
523
|
+
children: [t && /* @__PURE__ */ K("span", {
|
|
524
524
|
className: "text-p-std font-medium text-fg-default leading-tight",
|
|
525
525
|
children: t
|
|
526
|
-
}), n && /* @__PURE__ */
|
|
526
|
+
}), n && /* @__PURE__ */ K("span", {
|
|
527
527
|
className: "text-p-sm text-fg-secondary leading-snug",
|
|
528
528
|
children: n
|
|
529
529
|
})]
|
|
@@ -532,15 +532,15 @@ var we = a(function({ src: e, alt: t, name: n, size: r = "md", status: i, shape:
|
|
|
532
532
|
});
|
|
533
533
|
//#endregion
|
|
534
534
|
//#region src/lib/mergeRefs.ts
|
|
535
|
-
function
|
|
535
|
+
function rt(...e) {
|
|
536
536
|
return (t) => {
|
|
537
537
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
538
538
|
};
|
|
539
539
|
}
|
|
540
540
|
//#endregion
|
|
541
541
|
//#region src/lib/useFloatingPosition.ts
|
|
542
|
-
var
|
|
543
|
-
function
|
|
542
|
+
var it = 8, at = 10;
|
|
543
|
+
function ot({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center", offset: a = 8, flip: o = !0, shift: s = !0 }) {
|
|
544
544
|
let [c, l] = m({
|
|
545
545
|
style: {
|
|
546
546
|
position: "fixed",
|
|
@@ -565,18 +565,18 @@ function nt({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center"
|
|
|
565
565
|
r === "left" && e < u.width + a && t > e ? m = "right" : r === "right" && t < u.width + a && e > t && (m = "left");
|
|
566
566
|
}
|
|
567
567
|
let h = m === "top" || m === "bottom", g, _;
|
|
568
|
-
h ? (g = m === "bottom" ? c.bottom + a : c.top - u.height - a, _ = i === "start" ? c.left : i === "end" ? c.right - u.width : c.left + c.width / 2 - u.width / 2) : (_ = m === "right" ? c.right + a : c.left - u.width - a, g = i === "start" ? c.top : i === "end" ? c.bottom - u.height : c.top + c.height / 2 - u.height / 2), s && (h ? _ = Math.min(Math.max(_,
|
|
568
|
+
h ? (g = m === "bottom" ? c.bottom + a : c.top - u.height - a, _ = i === "start" ? c.left : i === "end" ? c.right - u.width : c.left + c.width / 2 - u.width / 2) : (_ = m === "right" ? c.right + a : c.left - u.width - a, g = i === "start" ? c.top : i === "end" ? c.bottom - u.height : c.top + c.height / 2 - u.height / 2), s && (h ? _ = Math.min(Math.max(_, it), d - u.width - it) : g = Math.min(Math.max(g, it), f - u.height - it));
|
|
569
569
|
let v;
|
|
570
570
|
if (h) {
|
|
571
571
|
let e = c.left + c.width / 2;
|
|
572
572
|
v = {
|
|
573
|
-
left: Math.min(Math.max(e - _,
|
|
573
|
+
left: Math.min(Math.max(e - _, at), u.width - at),
|
|
574
574
|
[m === "bottom" ? "top" : "bottom"]: -8 / 2
|
|
575
575
|
};
|
|
576
576
|
} else {
|
|
577
577
|
let e = c.top + c.height / 2;
|
|
578
578
|
v = {
|
|
579
|
-
top: Math.min(Math.max(e - g,
|
|
579
|
+
top: Math.min(Math.max(e - g, at), u.height - at),
|
|
580
580
|
[m === "right" ? "left" : "right"]: -8 / 2
|
|
581
581
|
};
|
|
582
582
|
}
|
|
@@ -609,16 +609,16 @@ function nt({ anchor: e, panel: t, open: n, side: r = "top", align: i = "center"
|
|
|
609
609
|
}
|
|
610
610
|
//#endregion
|
|
611
611
|
//#region src/components/Popover/Popover.tsx
|
|
612
|
-
var
|
|
612
|
+
var st = {
|
|
613
613
|
bottom: "border-l border-t",
|
|
614
614
|
top: "border-b border-r",
|
|
615
615
|
left: "border-t border-r",
|
|
616
616
|
right: "border-b border-l"
|
|
617
617
|
};
|
|
618
|
-
function
|
|
618
|
+
function ct({ 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 }) {
|
|
619
619
|
let [x, S] = m(c), C = s !== void 0, w = C ? s : x, T = p(null), [E, D] = m(null), O = u(), k = (e) => {
|
|
620
620
|
C || S(e), d?.(e);
|
|
621
|
-
}, { style: A, arrowStyle: j, resolvedSide: M } =
|
|
621
|
+
}, { style: A, arrowStyle: j, resolvedSide: M } = ot({
|
|
622
622
|
anchor: T,
|
|
623
623
|
panel: E,
|
|
624
624
|
open: w,
|
|
@@ -655,15 +655,15 @@ function it({ content: e, children: t, side: r = "top", align: i = "center", off
|
|
|
655
655
|
E
|
|
656
656
|
]), !o(t)) return t;
|
|
657
657
|
let N = t.props ?? {}, P = t.ref, F = n(t, {
|
|
658
|
-
ref:
|
|
658
|
+
ref: rt(T, P),
|
|
659
659
|
onClick: (e) => {
|
|
660
660
|
N.onClick?.(e), e.defaultPrevented || k(!w);
|
|
661
661
|
},
|
|
662
662
|
"aria-haspopup": "dialog",
|
|
663
663
|
"aria-expanded": w
|
|
664
664
|
}), I = v ?? (typeof document < "u" ? document.body : null);
|
|
665
|
-
return /* @__PURE__ */
|
|
666
|
-
ref:
|
|
665
|
+
return /* @__PURE__ */ q(G, { children: [F, w && I && J(/* @__PURE__ */ q("div", {
|
|
666
|
+
ref: rt(D),
|
|
667
667
|
id: O,
|
|
668
668
|
role: "dialog",
|
|
669
669
|
"aria-label": typeof e == "string" ? e : void 0,
|
|
@@ -671,26 +671,26 @@ function it({ content: e, children: t, side: r = "top", align: i = "center", off
|
|
|
671
671
|
"data-side": M,
|
|
672
672
|
"data-test-id": b,
|
|
673
673
|
style: A,
|
|
674
|
-
className:
|
|
675
|
-
children: [e, h && /* @__PURE__ */
|
|
674
|
+
className: Y("fixed z-50 max-w-60 max-h-54 overflow-auto rounded-lg border border-border-default bg-bg-default p-3 text-fg-default shadow-z4", y),
|
|
675
|
+
children: [e, h && /* @__PURE__ */ K("span", {
|
|
676
676
|
"aria-hidden": !0,
|
|
677
677
|
style: j,
|
|
678
|
-
className:
|
|
678
|
+
className: Y("absolute size-2 rotate-45 bg-bg-default", st[M])
|
|
679
679
|
})]
|
|
680
680
|
}), I)] });
|
|
681
681
|
}
|
|
682
682
|
//#endregion
|
|
683
683
|
//#region src/components/Copy/Copy.tsx
|
|
684
|
-
var
|
|
684
|
+
var lt = 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) {
|
|
685
685
|
let [f, h] = m(!1), g = p(null), _ = typeof navigator < "u" && typeof navigator.clipboard?.writeText == "function";
|
|
686
686
|
return l(() => () => {
|
|
687
687
|
g.current && clearTimeout(g.current);
|
|
688
|
-
}, []), /* @__PURE__ */
|
|
688
|
+
}, []), /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(ct, {
|
|
689
689
|
open: f,
|
|
690
690
|
content: t,
|
|
691
691
|
side: "top",
|
|
692
692
|
align: "center",
|
|
693
|
-
children: /* @__PURE__ */
|
|
693
|
+
children: /* @__PURE__ */ K(Ke, {
|
|
694
694
|
ref: d,
|
|
695
695
|
type: "button",
|
|
696
696
|
variant: "tertiary",
|
|
@@ -705,101 +705,101 @@ var at = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
705
705
|
"aria-label": n,
|
|
706
706
|
dataTestId: c,
|
|
707
707
|
...u,
|
|
708
|
-
children: f ? /* @__PURE__ */
|
|
708
|
+
children: f ? /* @__PURE__ */ K(b, { className: "size-4" }) : i ?? /* @__PURE__ */ K(k, { className: "size-4" })
|
|
709
709
|
})
|
|
710
|
-
}), /* @__PURE__ */
|
|
710
|
+
}), /* @__PURE__ */ K("span", {
|
|
711
711
|
role: "status",
|
|
712
712
|
"aria-live": "polite",
|
|
713
713
|
className: "sr-only",
|
|
714
714
|
children: f ? t : ""
|
|
715
715
|
})] });
|
|
716
|
-
}),
|
|
716
|
+
}), ut = {
|
|
717
717
|
lg: "h-12 text-p-md",
|
|
718
718
|
md: "h-10 text-p-std",
|
|
719
719
|
sm: "h-8 text-p-sm"
|
|
720
|
-
},
|
|
720
|
+
}, dt = {
|
|
721
721
|
lg: "pl-10",
|
|
722
722
|
md: "pl-9",
|
|
723
723
|
sm: "pl-8"
|
|
724
|
-
},
|
|
724
|
+
}, ft = {
|
|
725
725
|
lg: "pr-10",
|
|
726
726
|
md: "pr-9",
|
|
727
727
|
sm: "pr-8"
|
|
728
|
-
},
|
|
728
|
+
}, pt = {
|
|
729
729
|
lg: "w-10",
|
|
730
730
|
md: "w-9",
|
|
731
731
|
sm: "w-8"
|
|
732
|
-
},
|
|
732
|
+
}, mt = 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) {
|
|
733
733
|
let b = u(), x = d ?? b, S = r ? `${x}-error` : n ? `${x}-help` : void 0, C = l || !!r;
|
|
734
|
-
return /* @__PURE__ */
|
|
735
|
-
className:
|
|
734
|
+
return /* @__PURE__ */ q("div", {
|
|
735
|
+
className: Y("flex flex-col gap-1.5 w-full", m),
|
|
736
736
|
"data-test-id": _,
|
|
737
737
|
children: [
|
|
738
|
-
(e || t) && /* @__PURE__ */
|
|
738
|
+
(e || t) && /* @__PURE__ */ q("div", {
|
|
739
739
|
className: "flex items-center gap-1.5",
|
|
740
|
-
children: [e && /* @__PURE__ */
|
|
740
|
+
children: [e && /* @__PURE__ */ q("label", {
|
|
741
741
|
htmlFor: x,
|
|
742
742
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
743
|
-
children: [e, g && /* @__PURE__ */
|
|
743
|
+
children: [e, g && /* @__PURE__ */ K("span", {
|
|
744
744
|
className: "text-red-600",
|
|
745
745
|
"aria-hidden": !0,
|
|
746
746
|
children: "*"
|
|
747
747
|
})]
|
|
748
|
-
}), t && /* @__PURE__ */
|
|
748
|
+
}), t && /* @__PURE__ */ K("span", {
|
|
749
749
|
className: "inline-flex items-center gap-1",
|
|
750
750
|
children: t
|
|
751
751
|
})]
|
|
752
752
|
}),
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
className:
|
|
753
|
+
/* @__PURE__ */ q("div", {
|
|
754
|
+
className: Y("flex items-stretch w-full rounded-lg bg-bg-default transition-colors", "border", C ? "border-red-600" : "border-border-default", !f && !C && "hover:border-border-strong", "focus-within:ring-2 focus-within:ring-offset-0", C ? "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", ut[i]),
|
|
755
755
|
children: [
|
|
756
|
-
s && /* @__PURE__ */
|
|
756
|
+
s && /* @__PURE__ */ K("span", {
|
|
757
757
|
className: "inline-flex items-center px-3 text-fg-secondary bg-bg-container border-r border-border-default rounded-l-lg whitespace-nowrap",
|
|
758
758
|
children: s
|
|
759
759
|
}),
|
|
760
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ q("div", {
|
|
761
761
|
className: "relative flex-1 min-w-0",
|
|
762
762
|
children: [
|
|
763
|
-
a && /* @__PURE__ */
|
|
763
|
+
a && /* @__PURE__ */ K("span", {
|
|
764
764
|
"aria-hidden": !0,
|
|
765
|
-
className:
|
|
765
|
+
className: Y("absolute inset-y-0 left-0 flex items-center justify-center text-fg-secondary pointer-events-none", pt[i]),
|
|
766
766
|
children: a
|
|
767
767
|
}),
|
|
768
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ K("input", {
|
|
769
769
|
ref: y,
|
|
770
770
|
id: x,
|
|
771
771
|
disabled: f,
|
|
772
772
|
required: g,
|
|
773
773
|
"aria-invalid": C || void 0,
|
|
774
774
|
"aria-describedby": S,
|
|
775
|
-
className:
|
|
775
|
+
className: Y("w-full h-full bg-transparent outline-none", "placeholder:text-fg-tertiary text-fg-default", "disabled:cursor-not-allowed disabled:text-fg-disabled", a ? dt[i] : "pl-3", o || C ? ft[i] : "pr-3", p),
|
|
776
776
|
...v
|
|
777
777
|
}),
|
|
778
|
-
(o || C) && /* @__PURE__ */
|
|
778
|
+
(o || C) && /* @__PURE__ */ K("span", {
|
|
779
779
|
"aria-hidden": !0,
|
|
780
|
-
className:
|
|
781
|
-
children: C ? /* @__PURE__ */
|
|
780
|
+
className: Y("absolute inset-y-0 right-0 flex items-center justify-center pointer-events-none", pt[i], C ? "text-red-600" : "text-fg-secondary"),
|
|
781
|
+
children: C ? /* @__PURE__ */ K(h, { className: "h-4 w-4" }) : o
|
|
782
782
|
})
|
|
783
783
|
]
|
|
784
784
|
}),
|
|
785
|
-
c && /* @__PURE__ */
|
|
785
|
+
c && /* @__PURE__ */ K("span", {
|
|
786
786
|
className: "inline-flex items-center px-3 text-fg-secondary bg-bg-container border-l border-border-default rounded-r-lg whitespace-nowrap",
|
|
787
787
|
children: c
|
|
788
788
|
})
|
|
789
789
|
]
|
|
790
790
|
}),
|
|
791
|
-
r ? /* @__PURE__ */
|
|
791
|
+
r ? /* @__PURE__ */ K("p", {
|
|
792
792
|
id: `${x}-error`,
|
|
793
793
|
className: "text-p-sm text-red-700",
|
|
794
794
|
children: r
|
|
795
|
-
}) : n ? /* @__PURE__ */
|
|
795
|
+
}) : n ? /* @__PURE__ */ K("p", {
|
|
796
796
|
id: `${x}-help`,
|
|
797
797
|
className: "text-p-sm text-fg-secondary",
|
|
798
798
|
children: n
|
|
799
799
|
}) : null
|
|
800
800
|
]
|
|
801
801
|
});
|
|
802
|
-
}),
|
|
802
|
+
}), ht = "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", gt = 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) {
|
|
803
803
|
let y = e !== void 0, [b, x] = m(t), S = y ? e : b, [C, w] = m(String(S));
|
|
804
804
|
l(() => {
|
|
805
805
|
w(String(S));
|
|
@@ -808,7 +808,7 @@ var at = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
808
808
|
let t = Math.min(i, Math.max(r, e));
|
|
809
809
|
return y || x(t), n?.(t), t;
|
|
810
810
|
};
|
|
811
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ K(mt, {
|
|
812
812
|
ref: v,
|
|
813
813
|
type: "number",
|
|
814
814
|
min: r,
|
|
@@ -821,7 +821,7 @@ var at = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
821
821
|
error: d,
|
|
822
822
|
disabled: f,
|
|
823
823
|
dataTestId: g,
|
|
824
|
-
wrapperClassName:
|
|
824
|
+
wrapperClassName: Y("max-w-[140px]", h),
|
|
825
825
|
value: C,
|
|
826
826
|
onChange: (e) => {
|
|
827
827
|
w(e.target.value);
|
|
@@ -834,30 +834,30 @@ var at = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
834
834
|
}
|
|
835
835
|
w(String(T(e)));
|
|
836
836
|
},
|
|
837
|
-
leftAddon: /* @__PURE__ */
|
|
837
|
+
leftAddon: /* @__PURE__ */ K("button", {
|
|
838
838
|
type: "button",
|
|
839
839
|
disabled: f || S <= r,
|
|
840
840
|
onClick: () => T(S - a),
|
|
841
841
|
"aria-label": "Decrease",
|
|
842
|
-
className:
|
|
843
|
-
children: /* @__PURE__ */
|
|
842
|
+
className: ht,
|
|
843
|
+
children: /* @__PURE__ */ K(P, { className: "size-4" })
|
|
844
844
|
}),
|
|
845
|
-
rightAddon: /* @__PURE__ */
|
|
845
|
+
rightAddon: /* @__PURE__ */ K("button", {
|
|
846
846
|
type: "button",
|
|
847
847
|
disabled: f || S >= i,
|
|
848
848
|
onClick: () => T(S + a),
|
|
849
849
|
"aria-label": "Increase",
|
|
850
|
-
className:
|
|
851
|
-
children: /* @__PURE__ */
|
|
850
|
+
className: ht,
|
|
851
|
+
children: /* @__PURE__ */ K(z, { className: "size-4" })
|
|
852
852
|
}),
|
|
853
|
-
className:
|
|
853
|
+
className: Y("text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", p),
|
|
854
854
|
..._
|
|
855
855
|
});
|
|
856
|
-
}),
|
|
856
|
+
}), _t = {
|
|
857
857
|
lg: "h-12 text-p-md px-3.5",
|
|
858
858
|
md: "h-10 text-p-std px-3",
|
|
859
859
|
sm: "h-8 text-p-sm px-2.5"
|
|
860
|
-
},
|
|
860
|
+
}, vt = [
|
|
861
861
|
"Jan",
|
|
862
862
|
"Feb",
|
|
863
863
|
"Mar",
|
|
@@ -870,7 +870,7 @@ var at = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
870
870
|
"Oct",
|
|
871
871
|
"Nov",
|
|
872
872
|
"Dec"
|
|
873
|
-
],
|
|
873
|
+
], yt = [
|
|
874
874
|
"Mo",
|
|
875
875
|
"Tu",
|
|
876
876
|
"We",
|
|
@@ -879,30 +879,30 @@ var at = a(function({ text: e, copiedLabel: t = "Copied", label: n = "Copy to cl
|
|
|
879
879
|
"Sa",
|
|
880
880
|
"Su"
|
|
881
881
|
];
|
|
882
|
-
function
|
|
882
|
+
function bt(e) {
|
|
883
883
|
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
884
884
|
}
|
|
885
|
-
function
|
|
885
|
+
function xt(e, t) {
|
|
886
886
|
return !!e && !!t && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function St(e) {
|
|
889
889
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
let i =
|
|
893
|
-
return t && i <
|
|
891
|
+
function Ct(e, t, n, r) {
|
|
892
|
+
let i = St(e).getTime();
|
|
893
|
+
return t && i < St(t).getTime() || n && i > St(n).getTime() ? !0 : !!r?.some((t) => xt(t, e));
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function wt(e) {
|
|
896
896
|
return `${String(e.getDate()).padStart(2, "0")}.${String(e.getMonth() + 1).padStart(2, "0")}.${e.getFullYear()}`;
|
|
897
897
|
}
|
|
898
|
-
function
|
|
899
|
-
let t = (
|
|
898
|
+
function Tt(e) {
|
|
899
|
+
let t = (bt(e).getDay() + 6) % 7, n = new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate(), r = [];
|
|
900
900
|
for (let e = 0; e < t; e++) r.push(null);
|
|
901
901
|
for (let t = 1; t <= n; t++) r.push(new Date(e.getFullYear(), e.getMonth(), t));
|
|
902
902
|
for (; r.length % 7 != 0;) r.push(null);
|
|
903
903
|
return r;
|
|
904
904
|
}
|
|
905
|
-
var
|
|
905
|
+
var Et = a(function({ value: e, onChange: t, range: n = !1, rangeValue: r, onChangeRange: i, size: a = "md", label: o, placeholder: s = "Select date", fullWidth: c = !1, disabled: d = !1, minDate: f, maxDate: h, excludeDates: g, error: _ = !1, errorText: v, id: b, className: x, wrapperClassName: S, dataTestId: T }, E) {
|
|
906
906
|
let D = u(), O = b ?? D, [k, A] = m(!1), [j, M] = m(e ?? r?.start ?? /* @__PURE__ */ new Date()), [N, P] = m(null), F = p(null), I = _ || !!v, L = v ? `${O}-error` : void 0;
|
|
907
907
|
l(() => {
|
|
908
908
|
d && A(!1);
|
|
@@ -913,7 +913,7 @@ var St = a(function({ value: e, onChange: t, range: n = !1, rangeValue: r, onCha
|
|
|
913
913
|
};
|
|
914
914
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
915
915
|
}, [k]);
|
|
916
|
-
let R = n ? r?.start ? `${
|
|
916
|
+
let R = n ? r?.start ? `${wt(r.start)}${r.end ? ` – ${wt(r.end)}` : ""}` : "" : e ? wt(e) : "";
|
|
917
917
|
function z(e) {
|
|
918
918
|
if (!n) {
|
|
919
919
|
t?.(e), A(!1);
|
|
@@ -942,23 +942,23 @@ var St = a(function({ value: e, onChange: t, range: n = !1, rangeValue: r, onCha
|
|
|
942
942
|
end: e
|
|
943
943
|
}), A(!1);
|
|
944
944
|
}
|
|
945
|
-
let ee =
|
|
945
|
+
let ee = Tt(j), B = r ?? {
|
|
946
946
|
start: null,
|
|
947
947
|
end: null
|
|
948
948
|
}, V = B.end ?? N;
|
|
949
|
-
return /* @__PURE__ */
|
|
949
|
+
return /* @__PURE__ */ q("div", {
|
|
950
950
|
ref: F,
|
|
951
951
|
"data-test-id": T,
|
|
952
|
-
className:
|
|
952
|
+
className: Y("flex flex-col gap-1.5", c && "w-full", S),
|
|
953
953
|
children: [
|
|
954
|
-
o && /* @__PURE__ */
|
|
954
|
+
o && /* @__PURE__ */ K("label", {
|
|
955
955
|
htmlFor: O,
|
|
956
956
|
className: "text-p-std font-medium text-fg-default inline-flex",
|
|
957
957
|
children: o
|
|
958
958
|
}),
|
|
959
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ q("div", {
|
|
960
960
|
className: "relative",
|
|
961
|
-
children: [/* @__PURE__ */
|
|
961
|
+
children: [/* @__PURE__ */ q("button", {
|
|
962
962
|
ref: E,
|
|
963
963
|
id: O,
|
|
964
964
|
type: "button",
|
|
@@ -966,68 +966,68 @@ var St = a(function({ value: e, onChange: t, range: n = !1, rangeValue: r, onCha
|
|
|
966
966
|
"aria-invalid": I || void 0,
|
|
967
967
|
"aria-describedby": L,
|
|
968
968
|
onClick: () => A((e) => !e),
|
|
969
|
-
className:
|
|
970
|
-
children: [/* @__PURE__ */
|
|
971
|
-
className:
|
|
969
|
+
className: Y("inline-flex items-center gap-2 rounded-lg border bg-bg-default text-left transition-colors focus-visible:outline-none focus-visible:ring-2", I ? "border-red-600" : "border-border-default", !d && !I && "hover:border-border-strong", I ? "focus-visible:ring-red-300 focus-visible:border-red-600" : "focus-visible:ring-brand-300 focus-visible:border-brand-500", d && "bg-bg-container border-border-default cursor-not-allowed text-fg-disabled", c ? "w-full min-w-0" : "min-w-[260px]", _t[a], x),
|
|
970
|
+
children: [/* @__PURE__ */ K("span", {
|
|
971
|
+
className: Y("flex-1 text-left truncate", d ? "text-fg-disabled" : R ? "text-fg-default" : "text-fg-tertiary"),
|
|
972
972
|
children: R || s
|
|
973
|
-
}), /* @__PURE__ */
|
|
974
|
-
}), k && /* @__PURE__ */
|
|
973
|
+
}), /* @__PURE__ */ K(y, { className: Y("w-4 h-4", d ? "text-fg-disabled" : "text-fg-secondary") })]
|
|
974
|
+
}), k && /* @__PURE__ */ q("div", {
|
|
975
975
|
className: "absolute z-50 mt-1 left-0 rounded-xl border border-border-default bg-bg-default shadow-z3 p-3 w-[300px]",
|
|
976
|
-
children: [/* @__PURE__ */
|
|
976
|
+
children: [/* @__PURE__ */ q("div", {
|
|
977
977
|
className: "flex items-center justify-between mb-2",
|
|
978
978
|
children: [
|
|
979
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ K("button", {
|
|
980
980
|
type: "button",
|
|
981
981
|
className: "w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary",
|
|
982
982
|
onClick: () => M(new Date(j.getFullYear(), j.getMonth() - 1, 1)),
|
|
983
983
|
"aria-label": "Previous month",
|
|
984
|
-
children: /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ K(C, { className: "w-4 h-4" })
|
|
985
985
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ q("div", {
|
|
987
987
|
className: "text-p-md font-semibold text-fg-default",
|
|
988
988
|
children: [
|
|
989
|
-
|
|
989
|
+
vt[j.getMonth()],
|
|
990
990
|
" ",
|
|
991
991
|
j.getFullYear()
|
|
992
992
|
]
|
|
993
993
|
}),
|
|
994
|
-
/* @__PURE__ */
|
|
994
|
+
/* @__PURE__ */ K("button", {
|
|
995
995
|
type: "button",
|
|
996
996
|
className: "w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary",
|
|
997
997
|
onClick: () => M(new Date(j.getFullYear(), j.getMonth() + 1, 1)),
|
|
998
998
|
"aria-label": "Next month",
|
|
999
|
-
children: /* @__PURE__ */
|
|
999
|
+
children: /* @__PURE__ */ K(w, { className: "w-4 h-4" })
|
|
1000
1000
|
})
|
|
1001
1001
|
]
|
|
1002
|
-
}), /* @__PURE__ */
|
|
1002
|
+
}), /* @__PURE__ */ q("div", {
|
|
1003
1003
|
className: "grid grid-cols-7 gap-1 text-center",
|
|
1004
|
-
children: [
|
|
1004
|
+
children: [yt.map((e) => /* @__PURE__ */ K("div", {
|
|
1005
1005
|
className: "text-p-xs text-fg-tertiary py-1",
|
|
1006
1006
|
children: e
|
|
1007
1007
|
}, e)), ee.map((t, r) => {
|
|
1008
|
-
if (!t) return /* @__PURE__ */
|
|
1009
|
-
let i =
|
|
1010
|
-
return /* @__PURE__ */
|
|
1008
|
+
if (!t) return /* @__PURE__ */ K("div", {}, r);
|
|
1009
|
+
let i = Ct(t, f, h, g), a = !n && xt(t, e ?? null), o = n && xt(t, B.start), s = n && xt(t, V), c = n && !!B.start && !!V && t > B.start && t < V;
|
|
1010
|
+
return /* @__PURE__ */ K("button", {
|
|
1011
1011
|
type: "button",
|
|
1012
1012
|
disabled: i,
|
|
1013
1013
|
"aria-disabled": i || void 0,
|
|
1014
1014
|
onMouseEnter: () => !i && n && B.start && !B.end && P(t),
|
|
1015
1015
|
onClick: () => !i && z(t),
|
|
1016
|
-
className:
|
|
1016
|
+
className: Y("h-8 rounded-md text-p-sm font-medium", 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"),
|
|
1017
1017
|
children: t.getDate()
|
|
1018
1018
|
}, r);
|
|
1019
1019
|
})]
|
|
1020
1020
|
})]
|
|
1021
1021
|
})]
|
|
1022
1022
|
}),
|
|
1023
|
-
v ? /* @__PURE__ */
|
|
1023
|
+
v ? /* @__PURE__ */ K("p", {
|
|
1024
1024
|
id: `${O}-error`,
|
|
1025
1025
|
className: "text-p-sm text-red-700",
|
|
1026
1026
|
children: v
|
|
1027
1027
|
}) : null
|
|
1028
1028
|
]
|
|
1029
1029
|
});
|
|
1030
|
-
}),
|
|
1030
|
+
}), Dt = {
|
|
1031
1031
|
brand: "bg-brand-500",
|
|
1032
1032
|
blue: "bg-blue-500",
|
|
1033
1033
|
purple: "bg-purple-500",
|
|
@@ -1035,57 +1035,57 @@ var St = a(function({ value: e, onChange: t, range: n = !1, rangeValue: r, onCha
|
|
|
1035
1035
|
yellow: "bg-yellow-500",
|
|
1036
1036
|
red: "bg-red-500",
|
|
1037
1037
|
gray: "bg-gray-400"
|
|
1038
|
-
},
|
|
1038
|
+
}, Ot = {
|
|
1039
1039
|
sm: "h-1",
|
|
1040
1040
|
lg: "h-2"
|
|
1041
|
-
},
|
|
1041
|
+
}, kt = (e) => new Intl.NumberFormat().format(e), At = a(function({ segments: e, hideLegend: t = !1, formatValue: n = kt, size: r = "lg", className: i, dataTestId: a, ...o }, s) {
|
|
1042
1042
|
let c = e.reduce((e, t) => e + t.value, 0);
|
|
1043
|
-
return /* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ q("div", {
|
|
1044
1044
|
ref: s,
|
|
1045
1045
|
"data-test-id": a,
|
|
1046
|
-
className:
|
|
1046
|
+
className: Y("flex flex-col gap-3", i),
|
|
1047
1047
|
...o,
|
|
1048
|
-
children: [/* @__PURE__ */
|
|
1049
|
-
className:
|
|
1050
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1048
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1049
|
+
className: Y("flex w-full overflow-hidden rounded-full bg-bg-subtle", Ot[r]),
|
|
1050
|
+
children: e.map((e, t) => /* @__PURE__ */ K("div", {
|
|
1051
1051
|
style: { flexBasis: `${c > 0 ? e.value / c * 100 : 0}%` },
|
|
1052
|
-
className:
|
|
1052
|
+
className: Y("transition-[flex-basis] duration-700 ease-out", Dt[e.color])
|
|
1053
1053
|
}, t))
|
|
1054
|
-
}), !t && /* @__PURE__ */
|
|
1054
|
+
}), !t && /* @__PURE__ */ K("ul", {
|
|
1055
1055
|
className: "flex flex-col [&>li:not(:last-child)]:border-b [&>li:not(:last-child)]:border-border-default",
|
|
1056
|
-
children: e.filter((e) => !e.hideFromLegend).map((e, t) => /* @__PURE__ */
|
|
1056
|
+
children: e.filter((e) => !e.hideFromLegend).map((e, t) => /* @__PURE__ */ q("li", {
|
|
1057
1057
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
1058
|
-
children: [/* @__PURE__ */
|
|
1058
|
+
children: [/* @__PURE__ */ q("span", {
|
|
1059
1059
|
className: "flex min-w-0 items-center gap-2",
|
|
1060
|
-
children: [/* @__PURE__ */
|
|
1060
|
+
children: [/* @__PURE__ */ K("span", { className: Y("size-2 shrink-0 rounded-full", Dt[e.color]) }), /* @__PURE__ */ K("span", {
|
|
1061
1061
|
className: "truncate text-p-sm text-fg-tertiary",
|
|
1062
1062
|
children: e.label
|
|
1063
1063
|
})]
|
|
1064
|
-
}), /* @__PURE__ */
|
|
1064
|
+
}), /* @__PURE__ */ q("span", {
|
|
1065
1065
|
className: "shrink-0 text-p-sm text-fg-default tabular-nums",
|
|
1066
1066
|
children: [n(e.value), e.unit ? ` ${e.unit}` : ""]
|
|
1067
1067
|
})]
|
|
1068
1068
|
}, t))
|
|
1069
1069
|
})]
|
|
1070
1070
|
});
|
|
1071
|
-
}),
|
|
1071
|
+
}), jt = {
|
|
1072
1072
|
fast: 150,
|
|
1073
1073
|
base: 200,
|
|
1074
1074
|
slow: 300
|
|
1075
1075
|
};
|
|
1076
|
-
function
|
|
1076
|
+
function Mt() {
|
|
1077
1077
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1078
1078
|
}
|
|
1079
1079
|
//#endregion
|
|
1080
1080
|
//#region src/lib/useMountTransition.ts
|
|
1081
|
-
function
|
|
1081
|
+
function Nt(e, t) {
|
|
1082
1082
|
let [n, r] = m(e), [i, a] = m(e ? "entered" : "closed"), o = p(null), s = p(null);
|
|
1083
1083
|
return l(() => {
|
|
1084
1084
|
o.current && clearTimeout(o.current), s.current && cancelAnimationFrame(s.current), e ? (r(!0), a("entering"), s.current = requestAnimationFrame(() => {
|
|
1085
1085
|
s.current = requestAnimationFrame(() => a("entered"));
|
|
1086
1086
|
})) : (() => {
|
|
1087
1087
|
a((e) => e === "closed" ? "closed" : "exiting");
|
|
1088
|
-
let e =
|
|
1088
|
+
let e = Mt() ? 0 : t;
|
|
1089
1089
|
e === 0 ? (r(!1), a("closed")) : o.current = setTimeout(() => {
|
|
1090
1090
|
r(!1), a("closed");
|
|
1091
1091
|
}, e);
|
|
@@ -1099,28 +1099,28 @@ function kt(e, t) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
//#endregion
|
|
1101
1101
|
//#region src/components/Drawer/Drawer.tsx
|
|
1102
|
-
var
|
|
1102
|
+
var Pt = {
|
|
1103
1103
|
sm: "w-[320px]",
|
|
1104
1104
|
md: "w-[420px]",
|
|
1105
1105
|
lg: "w-[560px]",
|
|
1106
1106
|
xl: "w-[720px]"
|
|
1107
|
-
},
|
|
1107
|
+
}, Ft = {
|
|
1108
1108
|
sm: "h-[240px]",
|
|
1109
1109
|
md: "h-[360px]",
|
|
1110
1110
|
lg: "h-[480px]",
|
|
1111
1111
|
xl: "h-[600px]"
|
|
1112
|
-
},
|
|
1112
|
+
}, It = {
|
|
1113
1113
|
right: "inset-y-0 right-0 border-l",
|
|
1114
1114
|
left: "inset-y-0 left-0 border-r",
|
|
1115
1115
|
top: "inset-x-0 top-0 border-b",
|
|
1116
1116
|
bottom: "inset-x-0 bottom-0 border-t"
|
|
1117
|
-
},
|
|
1117
|
+
}, Lt = {
|
|
1118
1118
|
right: "translate-x-full",
|
|
1119
1119
|
left: "-translate-x-full",
|
|
1120
1120
|
top: "-translate-y-full",
|
|
1121
1121
|
bottom: "translate-y-full"
|
|
1122
|
-
},
|
|
1123
|
-
let _ = p(null), { mounted: v, state: y } =
|
|
1122
|
+
}, Rt = 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: m, dataTestId: h }, g) {
|
|
1123
|
+
let _ = p(null), { mounted: v, state: y } = Nt(e, d ? jt.slow : 0), b = y === "entered";
|
|
1124
1124
|
if (l(() => {
|
|
1125
1125
|
if (!v) return;
|
|
1126
1126
|
let e = (e) => {
|
|
@@ -1136,8 +1136,8 @@ var At = {
|
|
|
1136
1136
|
let t = document.activeElement;
|
|
1137
1137
|
return _.current?.focus(), () => t?.focus?.();
|
|
1138
1138
|
}, [e]), !v) return null;
|
|
1139
|
-
let x = n === "left" || n === "right", S = x ?
|
|
1140
|
-
return
|
|
1139
|
+
let x = n === "left" || n === "right", S = x ? Pt[r] : Ft[r];
|
|
1140
|
+
return J(/* @__PURE__ */ q("div", {
|
|
1141
1141
|
role: "dialog",
|
|
1142
1142
|
"aria-modal": "true",
|
|
1143
1143
|
"aria-hidden": y === "exiting" || void 0,
|
|
@@ -1145,52 +1145,52 @@ var At = {
|
|
|
1145
1145
|
"aria-describedby": a ? "drawer-desc" : void 0,
|
|
1146
1146
|
className: "fixed inset-0 z-50",
|
|
1147
1147
|
"data-test-id": h,
|
|
1148
|
-
children: [/* @__PURE__ */
|
|
1149
|
-
className:
|
|
1148
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1149
|
+
className: Y("absolute inset-0 bg-black/50", d && "transition-opacity duration-200 motion-reduce:transition-none", b ? "opacity-100" : "opacity-0"),
|
|
1150
1150
|
onClick: () => c && t(),
|
|
1151
1151
|
"aria-hidden": !0
|
|
1152
|
-
}), /* @__PURE__ */
|
|
1153
|
-
ref:
|
|
1152
|
+
}), /* @__PURE__ */ q("div", {
|
|
1153
|
+
ref: rt(g, _),
|
|
1154
1154
|
tabIndex: -1,
|
|
1155
|
-
className:
|
|
1155
|
+
className: Y("absolute bg-bg-default shadow-z5 outline-none flex flex-col", It[n], x ? `${S} h-full max-w-full` : `${S} w-full max-h-full`, "border-border-default", d && "transition-transform duration-300 ease-out motion-reduce:transition-none will-change-transform", b ? "translate-x-0 translate-y-0" : Lt[n], m),
|
|
1156
1156
|
children: [
|
|
1157
|
-
(i || u || f) && /* @__PURE__ */
|
|
1157
|
+
(i || u || f) && /* @__PURE__ */ q("div", {
|
|
1158
1158
|
className: "flex items-start justify-between gap-4 px-6 pt-6 pb-4 border-b border-border-default",
|
|
1159
|
-
children: [/* @__PURE__ */
|
|
1159
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1160
1160
|
className: "flex-1 min-w-0",
|
|
1161
|
-
children: [i && /* @__PURE__ */
|
|
1161
|
+
children: [i && /* @__PURE__ */ K("h2", {
|
|
1162
1162
|
id: "drawer-title",
|
|
1163
1163
|
className: "text-h-xs font-semibold text-fg-default",
|
|
1164
1164
|
children: i
|
|
1165
|
-
}), a && /* @__PURE__ */
|
|
1165
|
+
}), a && /* @__PURE__ */ K("p", {
|
|
1166
1166
|
id: "drawer-desc",
|
|
1167
1167
|
className: "mt-1 text-p-std text-fg-secondary",
|
|
1168
1168
|
children: a
|
|
1169
1169
|
})]
|
|
1170
|
-
}), /* @__PURE__ */
|
|
1170
|
+
}), /* @__PURE__ */ q("div", {
|
|
1171
1171
|
className: "flex items-center gap-1 shrink-0 -mr-2 -mt-2",
|
|
1172
|
-
children: [f, u && /* @__PURE__ */
|
|
1172
|
+
children: [f, u && /* @__PURE__ */ K("button", {
|
|
1173
1173
|
type: "button",
|
|
1174
1174
|
onClick: t,
|
|
1175
1175
|
"aria-label": "Close",
|
|
1176
1176
|
className: "p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
1177
|
-
children: /* @__PURE__ */
|
|
1177
|
+
children: /* @__PURE__ */ K(H, { className: "h-5 w-5" })
|
|
1178
1178
|
})]
|
|
1179
1179
|
})]
|
|
1180
1180
|
}),
|
|
1181
|
-
o && /* @__PURE__ */
|
|
1181
|
+
o && /* @__PURE__ */ K("div", {
|
|
1182
1182
|
className: "flex-1 overflow-y-auto px-6 py-4",
|
|
1183
1183
|
children: o
|
|
1184
1184
|
}),
|
|
1185
|
-
s && /* @__PURE__ */
|
|
1185
|
+
s && /* @__PURE__ */ K("div", {
|
|
1186
1186
|
className: "flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container",
|
|
1187
1187
|
children: s
|
|
1188
1188
|
})
|
|
1189
1189
|
]
|
|
1190
1190
|
})]
|
|
1191
1191
|
}), document.body);
|
|
1192
|
-
}),
|
|
1193
|
-
function
|
|
1192
|
+
}), zt = 8;
|
|
1193
|
+
function Bt({ anchor: e, panel: t, open: n, side: r = "bottom", align: i = "start", offset: a = 4, flip: o = !0, shift: s = !0, matchAnchorWidth: c = !1 }) {
|
|
1194
1194
|
let [l, u] = m({
|
|
1195
1195
|
style: {
|
|
1196
1196
|
position: "fixed",
|
|
@@ -1211,7 +1211,7 @@ function It({ anchor: e, panel: t, open: n, side: r = "bottom", align: i = "star
|
|
|
1211
1211
|
r === "bottom" && e < d.height + a && t > e ? m = "top" : r === "top" && t < d.height + a && e > t && (m = "bottom");
|
|
1212
1212
|
}
|
|
1213
1213
|
let h = m === "bottom" ? l.bottom + a : l.top - d.height - a, g = i === "end" ? l.right - d.width : l.left;
|
|
1214
|
-
s && (g = Math.min(Math.max(g,
|
|
1214
|
+
s && (g = Math.min(Math.max(g, zt), p - d.width - zt)), u({
|
|
1215
1215
|
style: {
|
|
1216
1216
|
position: "fixed",
|
|
1217
1217
|
top: h,
|
|
@@ -1241,13 +1241,13 @@ function It({ anchor: e, panel: t, open: n, side: r = "bottom", align: i = "star
|
|
|
1241
1241
|
}
|
|
1242
1242
|
//#endregion
|
|
1243
1243
|
//#region src/components/DropdownMenu/DropdownMenu.tsx
|
|
1244
|
-
var
|
|
1245
|
-
function
|
|
1246
|
-
let e = c(
|
|
1244
|
+
var Vt = r(null);
|
|
1245
|
+
function Ht() {
|
|
1246
|
+
let e = c(Vt);
|
|
1247
1247
|
if (!e) throw Error("Dropdown parts must be used inside <DropdownMenu>");
|
|
1248
1248
|
return e;
|
|
1249
1249
|
}
|
|
1250
|
-
var
|
|
1250
|
+
var Ut = a(function({ children: e, defaultOpen: t = !1, open: n, onOpenChange: r, anchorRef: i, className: a, dataTestId: o, ...s }, c) {
|
|
1251
1251
|
let [u, d] = m(t), f = n !== void 0, h = f ? n : u, g = p(null), _ = (e) => {
|
|
1252
1252
|
f || d(e), r?.(e);
|
|
1253
1253
|
};
|
|
@@ -1257,24 +1257,24 @@ var zt = a(function({ children: e, defaultOpen: t = !1, open: n, onOpenChange: r
|
|
|
1257
1257
|
e.key === "Escape" && _(!1);
|
|
1258
1258
|
};
|
|
1259
1259
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1260
|
-
}, [h]), /* @__PURE__ */
|
|
1260
|
+
}, [h]), /* @__PURE__ */ K(Vt.Provider, {
|
|
1261
1261
|
value: {
|
|
1262
1262
|
open: h,
|
|
1263
1263
|
setOpen: _,
|
|
1264
1264
|
triggerRef: g,
|
|
1265
1265
|
anchorRef: i
|
|
1266
1266
|
},
|
|
1267
|
-
children: /* @__PURE__ */
|
|
1267
|
+
children: /* @__PURE__ */ K("div", {
|
|
1268
1268
|
ref: c,
|
|
1269
1269
|
"data-test-id": o,
|
|
1270
|
-
className:
|
|
1270
|
+
className: Y("relative inline-block", a),
|
|
1271
1271
|
...s,
|
|
1272
1272
|
children: e
|
|
1273
1273
|
})
|
|
1274
1274
|
});
|
|
1275
1275
|
});
|
|
1276
|
-
function
|
|
1277
|
-
let { open: t, setOpen: r, triggerRef: i } =
|
|
1276
|
+
function Wt({ children: e }) {
|
|
1277
|
+
let { open: t, setOpen: r, triggerRef: i } = Ht();
|
|
1278
1278
|
if (!o(e)) return e;
|
|
1279
1279
|
let a = e.props ?? {};
|
|
1280
1280
|
return n(e, {
|
|
@@ -1287,8 +1287,8 @@ function Bt({ children: e }) {
|
|
|
1287
1287
|
"aria-expanded": t
|
|
1288
1288
|
});
|
|
1289
1289
|
}
|
|
1290
|
-
var
|
|
1291
|
-
let { open: g, setOpen: _, triggerRef: v, anchorRef: y } =
|
|
1290
|
+
var Gt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1", Kt = 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, className: u, dataTestId: d, ...f }, h) {
|
|
1291
|
+
let { open: g, setOpen: _, triggerRef: v, anchorRef: y } = Ht(), b = p(null), [x, S] = m(null), { style: C, resolvedSide: w } = Bt({
|
|
1292
1292
|
anchor: y ?? v,
|
|
1293
1293
|
panel: x,
|
|
1294
1294
|
open: g && n === "fixed",
|
|
@@ -1329,8 +1329,8 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1329
1329
|
});
|
|
1330
1330
|
return () => cancelAnimationFrame(e);
|
|
1331
1331
|
}, [g]), !g) return null;
|
|
1332
|
-
let T = /* @__PURE__ */
|
|
1333
|
-
ref:
|
|
1332
|
+
let T = /* @__PURE__ */ K("div", {
|
|
1333
|
+
ref: rt(h, b, n === "fixed" ? S : void 0),
|
|
1334
1334
|
role: "menu",
|
|
1335
1335
|
"data-test-id": d,
|
|
1336
1336
|
"data-side": n === "fixed" ? w : void 0,
|
|
@@ -1342,14 +1342,14 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1342
1342
|
e.key === "ArrowDown" ? (e.preventDefault(), t[(n + 1 + t.length) % t.length]?.focus()) : e.key === "ArrowUp" ? (e.preventDefault(), t[(n - 1 + t.length) % t.length]?.focus()) : e.key === "Home" ? (e.preventDefault(), t[0]?.focus()) : e.key === "End" && (e.preventDefault(), t[t.length - 1]?.focus());
|
|
1343
1343
|
},
|
|
1344
1344
|
style: n === "fixed" ? C : void 0,
|
|
1345
|
-
className:
|
|
1345
|
+
className: Y(Gt, n === "absolute" && Y("absolute top-full mt-1", t === "end" ? "right-0" : "left-0"), u),
|
|
1346
1346
|
...f,
|
|
1347
1347
|
children: e
|
|
1348
1348
|
});
|
|
1349
|
-
return n === "fixed" ?
|
|
1350
|
-
}),
|
|
1351
|
-
let { setOpen: p } =
|
|
1352
|
-
return /* @__PURE__ */
|
|
1349
|
+
return n === "fixed" ? J(T, document.body) : T;
|
|
1350
|
+
}), qt = 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) {
|
|
1351
|
+
let { setOpen: p } = Ht();
|
|
1352
|
+
return /* @__PURE__ */ q("button", {
|
|
1353
1353
|
ref: f,
|
|
1354
1354
|
type: "button",
|
|
1355
1355
|
role: "menuitem",
|
|
@@ -1358,50 +1358,50 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1358
1358
|
onClick: (e) => {
|
|
1359
1359
|
u?.(e), t?.(), p(!1);
|
|
1360
1360
|
},
|
|
1361
|
-
className:
|
|
1361
|
+
className: Y("flex w-full gap-2 px-3 py-2 text-left text-p-std text-fg-default", s ? "items-start" : "items-center", "hover:bg-bg-subtle focus-visible:outline-none focus-visible:bg-bg-subtle", n && "opacity-50 cursor-not-allowed hover:bg-transparent", a && "text-red-700 hover:bg-red-50", c),
|
|
1362
1362
|
...d,
|
|
1363
1363
|
children: [
|
|
1364
|
-
o !== void 0 && /* @__PURE__ */
|
|
1364
|
+
o !== void 0 && /* @__PURE__ */ K("span", {
|
|
1365
1365
|
className: "w-4 shrink-0",
|
|
1366
|
-
children: o && /* @__PURE__ */
|
|
1366
|
+
children: o && /* @__PURE__ */ K(b, { className: "h-4 w-4 text-brand-500" })
|
|
1367
1367
|
}),
|
|
1368
|
-
r && /* @__PURE__ */
|
|
1368
|
+
r && /* @__PURE__ */ K("span", {
|
|
1369
1369
|
className: "inline-flex shrink-0 text-fg-secondary",
|
|
1370
1370
|
children: r
|
|
1371
1371
|
}),
|
|
1372
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ q("span", {
|
|
1373
1373
|
className: "flex-1 min-w-0 text-left",
|
|
1374
|
-
children: [/* @__PURE__ */
|
|
1374
|
+
children: [/* @__PURE__ */ K("span", {
|
|
1375
1375
|
className: "block truncate",
|
|
1376
1376
|
children: e
|
|
1377
|
-
}), s && /* @__PURE__ */
|
|
1377
|
+
}), s && /* @__PURE__ */ K("span", {
|
|
1378
1378
|
className: "block truncate text-p-sm text-fg-tertiary",
|
|
1379
1379
|
children: s
|
|
1380
1380
|
})]
|
|
1381
1381
|
}),
|
|
1382
|
-
i && /* @__PURE__ */
|
|
1382
|
+
i && /* @__PURE__ */ K("span", {
|
|
1383
1383
|
className: "text-p-sm text-fg-tertiary shrink-0 tabular-nums",
|
|
1384
1384
|
children: i
|
|
1385
1385
|
})
|
|
1386
1386
|
]
|
|
1387
1387
|
});
|
|
1388
|
-
}),
|
|
1389
|
-
return /* @__PURE__ */
|
|
1388
|
+
}), Jt = a(function({ className: e, dataTestId: t, ...n }, r) {
|
|
1389
|
+
return /* @__PURE__ */ K("div", {
|
|
1390
1390
|
ref: r,
|
|
1391
1391
|
role: "separator",
|
|
1392
1392
|
"data-test-id": t,
|
|
1393
|
-
className:
|
|
1393
|
+
className: Y("my-1 h-px bg-border-default", e),
|
|
1394
1394
|
...n
|
|
1395
1395
|
});
|
|
1396
|
-
}),
|
|
1397
|
-
return /* @__PURE__ */
|
|
1396
|
+
}), Yt = a(function({ children: e, className: t, dataTestId: n, ...r }, i) {
|
|
1397
|
+
return /* @__PURE__ */ K("div", {
|
|
1398
1398
|
ref: i,
|
|
1399
1399
|
"data-test-id": n,
|
|
1400
|
-
className:
|
|
1400
|
+
className: Y("px-3 py-1.5 text-p-xs font-semibold uppercase tracking-wider text-fg-tertiary", t),
|
|
1401
1401
|
...r,
|
|
1402
1402
|
children: e
|
|
1403
1403
|
});
|
|
1404
|
-
}),
|
|
1404
|
+
}), Xt = {
|
|
1405
1405
|
brand: {
|
|
1406
1406
|
bg: "bg-bg-brand-lighter",
|
|
1407
1407
|
icon: "text-brand-700"
|
|
@@ -1438,7 +1438,7 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1438
1438
|
bg: "bg-bg-danger-lighter",
|
|
1439
1439
|
icon: "text-red-700"
|
|
1440
1440
|
}
|
|
1441
|
-
},
|
|
1441
|
+
}, Zt = {
|
|
1442
1442
|
sm: {
|
|
1443
1443
|
box: "h-8 w-8",
|
|
1444
1444
|
icon: "h-4 w-4",
|
|
@@ -1459,17 +1459,17 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1459
1459
|
icon: "h-7 w-7",
|
|
1460
1460
|
radius: "rounded-xl"
|
|
1461
1461
|
}
|
|
1462
|
-
},
|
|
1463
|
-
let c =
|
|
1464
|
-
return /* @__PURE__ */
|
|
1462
|
+
}, Qt = a(function({ icon: e, tone: t = "gray", size: n = "md", shape: r = "rounded", className: i, dataTestId: a, ...o }, s) {
|
|
1463
|
+
let c = Xt[t], l = Zt[n];
|
|
1464
|
+
return /* @__PURE__ */ K("div", {
|
|
1465
1465
|
ref: s,
|
|
1466
1466
|
"data-test-id": a,
|
|
1467
1467
|
"aria-hidden": !o["aria-label"] || void 0,
|
|
1468
|
-
className:
|
|
1468
|
+
className: Y("inline-flex items-center justify-center shrink-0", l.box, r === "circle" ? "rounded-full" : l.radius, c.bg, i),
|
|
1469
1469
|
...o,
|
|
1470
|
-
children: /* @__PURE__ */
|
|
1470
|
+
children: /* @__PURE__ */ K(e, { className: Y(l.icon, c.icon) })
|
|
1471
1471
|
});
|
|
1472
|
-
}),
|
|
1472
|
+
}), $t = {
|
|
1473
1473
|
"h-xl": "text-h-xl",
|
|
1474
1474
|
"h-lg": "text-h-lg",
|
|
1475
1475
|
"h-md": "text-h-md",
|
|
@@ -1487,12 +1487,12 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1487
1487
|
"label-sm": "text-label-sm",
|
|
1488
1488
|
"label-xs": "text-label-xs",
|
|
1489
1489
|
"label-xxs": "text-label-xxs"
|
|
1490
|
-
},
|
|
1490
|
+
}, en = {
|
|
1491
1491
|
normal: "font-normal",
|
|
1492
1492
|
medium: "font-medium",
|
|
1493
1493
|
semibold: "font-semibold",
|
|
1494
1494
|
bold: "font-bold"
|
|
1495
|
-
},
|
|
1495
|
+
}, tn = {
|
|
1496
1496
|
default: "text-fg-default",
|
|
1497
1497
|
secondary: "text-fg-secondary",
|
|
1498
1498
|
tertiary: "text-fg-tertiary",
|
|
@@ -1503,7 +1503,7 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1503
1503
|
success: "text-fg-success",
|
|
1504
1504
|
warning: "text-fg-warning",
|
|
1505
1505
|
danger: "text-fg-danger"
|
|
1506
|
-
},
|
|
1506
|
+
}, nn = {
|
|
1507
1507
|
"h-xl": "h1",
|
|
1508
1508
|
"h-lg": "h1",
|
|
1509
1509
|
"h-md": "h2",
|
|
@@ -1521,66 +1521,66 @@ var Vt = "min-w-[200px] rounded-lg border border-border-default bg-bg-default sh
|
|
|
1521
1521
|
"label-sm": "span",
|
|
1522
1522
|
"label-xs": "span",
|
|
1523
1523
|
"label-xxs": "span"
|
|
1524
|
-
},
|
|
1525
|
-
return i(r ??
|
|
1524
|
+
}, rn = 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) {
|
|
1525
|
+
return i(r ?? nn[e], {
|
|
1526
1526
|
ref: f,
|
|
1527
1527
|
"data-test-id": u,
|
|
1528
|
-
className:
|
|
1528
|
+
className: Y($t[e], t && en[t], tn[n], a && "truncate", o && !a && "overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]", c),
|
|
1529
1529
|
style: o && !a ? {
|
|
1530
1530
|
...s,
|
|
1531
1531
|
WebkitLineClamp: o
|
|
1532
1532
|
} : s,
|
|
1533
1533
|
...d
|
|
1534
1534
|
}, l);
|
|
1535
|
-
}),
|
|
1535
|
+
}), an = {
|
|
1536
1536
|
lg: "py-20 px-6 gap-2",
|
|
1537
1537
|
sm: "py-10 px-4 gap-1"
|
|
1538
|
-
},
|
|
1538
|
+
}, on = {
|
|
1539
1539
|
lg: "xl",
|
|
1540
1540
|
sm: "lg"
|
|
1541
|
-
},
|
|
1542
|
-
return /* @__PURE__ */
|
|
1541
|
+
}, sn = a(function({ size: e = "lg", title: t, description: n, illustration: r, action: i, className: a, dataTestId: o, ...s }, c) {
|
|
1542
|
+
return /* @__PURE__ */ q("div", {
|
|
1543
1543
|
ref: c,
|
|
1544
1544
|
"data-test-id": o,
|
|
1545
|
-
className:
|
|
1545
|
+
className: Y("flex flex-col items-center justify-center text-center", an[e], a),
|
|
1546
1546
|
...s,
|
|
1547
1547
|
children: [
|
|
1548
|
-
r ?? /* @__PURE__ */
|
|
1548
|
+
r ?? /* @__PURE__ */ K(Qt, {
|
|
1549
1549
|
icon: B,
|
|
1550
1550
|
tone: "gray",
|
|
1551
1551
|
shape: "circle",
|
|
1552
|
-
size:
|
|
1552
|
+
size: on[e]
|
|
1553
1553
|
}),
|
|
1554
|
-
t && /* @__PURE__ */
|
|
1554
|
+
t && /* @__PURE__ */ K(rn, {
|
|
1555
1555
|
as: "h3",
|
|
1556
1556
|
variant: e === "lg" ? "h-sm" : "h-xs",
|
|
1557
1557
|
weight: "semibold",
|
|
1558
1558
|
className: "mt-2",
|
|
1559
1559
|
children: t
|
|
1560
1560
|
}),
|
|
1561
|
-
n && /* @__PURE__ */
|
|
1561
|
+
n && /* @__PURE__ */ K(rn, {
|
|
1562
1562
|
variant: e === "lg" ? "p-sm" : "p-xs",
|
|
1563
1563
|
color: "secondary",
|
|
1564
1564
|
className: "max-w-sm",
|
|
1565
1565
|
children: n
|
|
1566
1566
|
}),
|
|
1567
|
-
i && /* @__PURE__ */
|
|
1567
|
+
i && /* @__PURE__ */ K("div", {
|
|
1568
1568
|
className: "mt-4",
|
|
1569
1569
|
children: i
|
|
1570
1570
|
})
|
|
1571
1571
|
]
|
|
1572
1572
|
});
|
|
1573
|
-
}),
|
|
1573
|
+
}), cn = {
|
|
1574
1574
|
lg: "h-10 px-3 text-p-std gap-2",
|
|
1575
1575
|
md: "h-9 px-2.5 text-p-std gap-1.5",
|
|
1576
1576
|
sm: "h-8 px-2 text-p-sm gap-1.5"
|
|
1577
1577
|
};
|
|
1578
|
-
function
|
|
1578
|
+
function ln(...e) {
|
|
1579
1579
|
return (t) => {
|
|
1580
1580
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
1581
1581
|
};
|
|
1582
1582
|
}
|
|
1583
|
-
var
|
|
1583
|
+
var un = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabled: i, onClear: a, children: o, className: s, dataTestId: c, ...u }, d) {
|
|
1584
1584
|
let [f, h] = m(!1), g = p(null);
|
|
1585
1585
|
l(() => {
|
|
1586
1586
|
if (!f) return;
|
|
@@ -1590,32 +1590,32 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1590
1590
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1591
1591
|
}, [f]);
|
|
1592
1592
|
let _ = n || t !== void 0;
|
|
1593
|
-
return /* @__PURE__ */
|
|
1594
|
-
ref:
|
|
1593
|
+
return /* @__PURE__ */ q("div", {
|
|
1594
|
+
ref: ln(d, g),
|
|
1595
1595
|
"data-test-id": c,
|
|
1596
|
-
className:
|
|
1596
|
+
className: Y("relative inline-flex", s),
|
|
1597
1597
|
...u,
|
|
1598
|
-
children: [/* @__PURE__ */
|
|
1598
|
+
children: [/* @__PURE__ */ q("button", {
|
|
1599
1599
|
type: "button",
|
|
1600
1600
|
disabled: i,
|
|
1601
1601
|
onClick: () => h((e) => !e),
|
|
1602
1602
|
"aria-haspopup": "dialog",
|
|
1603
1603
|
"aria-expanded": f,
|
|
1604
|
-
className:
|
|
1604
|
+
className: Y("inline-flex items-center rounded-full border transition-colors outline-none", cn[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"),
|
|
1605
1605
|
children: [
|
|
1606
|
-
/* @__PURE__ */
|
|
1606
|
+
/* @__PURE__ */ K("span", {
|
|
1607
1607
|
className: "font-medium",
|
|
1608
1608
|
children: e
|
|
1609
1609
|
}),
|
|
1610
|
-
t !== void 0 && /* @__PURE__ */
|
|
1610
|
+
t !== void 0 && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
|
|
1611
1611
|
className: "mx-0.5 text-fg-tertiary",
|
|
1612
1612
|
"aria-hidden": !0,
|
|
1613
1613
|
children: "•"
|
|
1614
|
-
}), /* @__PURE__ */
|
|
1614
|
+
}), /* @__PURE__ */ K("span", {
|
|
1615
1615
|
className: "font-semibold truncate max-w-[140px]",
|
|
1616
1616
|
children: t
|
|
1617
1617
|
})] }),
|
|
1618
|
-
_ && a ? /* @__PURE__ */
|
|
1618
|
+
_ && a ? /* @__PURE__ */ K("span", {
|
|
1619
1619
|
role: "button",
|
|
1620
1620
|
tabIndex: 0,
|
|
1621
1621
|
"aria-label": "Clear filter",
|
|
@@ -1626,21 +1626,21 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1626
1626
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), a());
|
|
1627
1627
|
},
|
|
1628
1628
|
className: "inline-flex items-center justify-center rounded-full p-0.5 hover:bg-black/10",
|
|
1629
|
-
children: /* @__PURE__ */
|
|
1630
|
-
}) : /* @__PURE__ */
|
|
1631
|
-
className:
|
|
1629
|
+
children: /* @__PURE__ */ K(H, { className: "h-3 w-3" })
|
|
1630
|
+
}) : /* @__PURE__ */ K(S, {
|
|
1631
|
+
className: Y("h-4 w-4 text-fg-secondary transition-transform", f && "rotate-180"),
|
|
1632
1632
|
"aria-hidden": !0
|
|
1633
1633
|
})
|
|
1634
1634
|
]
|
|
1635
|
-
}), f && o && /* @__PURE__ */
|
|
1635
|
+
}), f && o && /* @__PURE__ */ K("div", {
|
|
1636
1636
|
className: "absolute left-0 top-full mt-1 min-w-[220px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 p-3",
|
|
1637
1637
|
children: o
|
|
1638
1638
|
})]
|
|
1639
1639
|
});
|
|
1640
|
-
}),
|
|
1641
|
-
let { handleSubmit: p, register: m, setValue: h, control: g, formState: _, getValues: v, watch: y, reset: b, clearErrors: x, setError: S, trigger: C, getFieldState: w, unregister: T } =
|
|
1640
|
+
}), dn = r(null), fn = a(function({ children: e, className: t, validationSchema: n, defaultValues: r, buttons: i, mode: a = "onBlur", shouldUnregister: o, shouldFocusError: s = !0, formId: c, onSubmit: l, dataTestId: u, ...d }, f) {
|
|
1641
|
+
let { handleSubmit: p, register: m, setValue: h, control: g, formState: _, getValues: v, watch: y, reset: b, clearErrors: x, setError: S, trigger: C, getFieldState: w, unregister: T } = le({
|
|
1642
1642
|
mode: a,
|
|
1643
|
-
resolver:
|
|
1643
|
+
resolver: ue(n),
|
|
1644
1644
|
defaultValues: r,
|
|
1645
1645
|
shouldFocusError: s,
|
|
1646
1646
|
shouldUnregister: o
|
|
@@ -1666,31 +1666,31 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1666
1666
|
dirtyFields: A,
|
|
1667
1667
|
submit: M
|
|
1668
1668
|
};
|
|
1669
|
-
return /* @__PURE__ */
|
|
1669
|
+
return /* @__PURE__ */ K("form", {
|
|
1670
1670
|
ref: f,
|
|
1671
1671
|
id: c,
|
|
1672
1672
|
onSubmit: M,
|
|
1673
1673
|
"data-test-id": u,
|
|
1674
|
-
className:
|
|
1674
|
+
className: Y("flex flex-col gap-4", t),
|
|
1675
1675
|
...d,
|
|
1676
|
-
children: /* @__PURE__ */
|
|
1676
|
+
children: /* @__PURE__ */ q(dn.Provider, {
|
|
1677
1677
|
value: N,
|
|
1678
|
-
children: [e, i && i.length > 0 && /* @__PURE__ */
|
|
1678
|
+
children: [e, i && i.length > 0 && /* @__PURE__ */ K("div", {
|
|
1679
1679
|
className: "flex items-center gap-3",
|
|
1680
1680
|
"data-test-id": u ? `${u}-buttons` : void 0,
|
|
1681
|
-
children: i.map((e, t) => /* @__PURE__ */
|
|
1681
|
+
children: i.map((e, t) => /* @__PURE__ */ K(Ke, { ...e }, t))
|
|
1682
1682
|
})]
|
|
1683
1683
|
})
|
|
1684
1684
|
});
|
|
1685
|
-
}),
|
|
1686
|
-
let s = c(
|
|
1685
|
+
}), pn = a(function({ name: e, defaultValue: t, render: n, className: r, dataTestId: i, ...a }, o) {
|
|
1686
|
+
let s = c(dn);
|
|
1687
1687
|
if (!s) throw Error("FormField must be rendered inside a FormContainer.");
|
|
1688
|
-
return /* @__PURE__ */
|
|
1688
|
+
return /* @__PURE__ */ K("div", {
|
|
1689
1689
|
ref: o,
|
|
1690
|
-
className:
|
|
1690
|
+
className: Y(r),
|
|
1691
1691
|
"data-test-id": i,
|
|
1692
1692
|
...a,
|
|
1693
|
-
children: /* @__PURE__ */
|
|
1693
|
+
children: /* @__PURE__ */ K(se, {
|
|
1694
1694
|
control: s.control,
|
|
1695
1695
|
name: e,
|
|
1696
1696
|
defaultValue: t,
|
|
@@ -1709,35 +1709,35 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1709
1709
|
})
|
|
1710
1710
|
})
|
|
1711
1711
|
});
|
|
1712
|
-
}),
|
|
1713
|
-
return /* @__PURE__ */
|
|
1712
|
+
}), mn = a(function({ icon: e, iconTone: t = "brand", label: n, value: r, action: i, className: a, dataTestId: o, ...s }, c) {
|
|
1713
|
+
return /* @__PURE__ */ q("div", {
|
|
1714
1714
|
ref: c,
|
|
1715
1715
|
"data-test-id": o,
|
|
1716
|
-
className:
|
|
1716
|
+
className: Y("flex items-start gap-3", a),
|
|
1717
1717
|
...s,
|
|
1718
1718
|
children: [
|
|
1719
|
-
/* @__PURE__ */
|
|
1719
|
+
/* @__PURE__ */ K(Qt, {
|
|
1720
1720
|
icon: e,
|
|
1721
1721
|
tone: t,
|
|
1722
1722
|
size: "md"
|
|
1723
1723
|
}),
|
|
1724
|
-
/* @__PURE__ */
|
|
1724
|
+
/* @__PURE__ */ q("div", {
|
|
1725
1725
|
className: "min-w-0 flex-1",
|
|
1726
|
-
children: [/* @__PURE__ */
|
|
1726
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1727
1727
|
className: "text-p-xs font-medium uppercase tracking-widest text-fg-tertiary",
|
|
1728
1728
|
children: n
|
|
1729
|
-
}), /* @__PURE__ */
|
|
1729
|
+
}), /* @__PURE__ */ K("div", {
|
|
1730
1730
|
className: "text-p-std font-semibold text-fg-default mt-1 break-words",
|
|
1731
1731
|
children: r
|
|
1732
1732
|
})]
|
|
1733
1733
|
}),
|
|
1734
|
-
i && /* @__PURE__ */
|
|
1734
|
+
i && /* @__PURE__ */ K("div", {
|
|
1735
1735
|
className: "shrink-0 flex items-center",
|
|
1736
1736
|
children: i
|
|
1737
1737
|
})
|
|
1738
1738
|
]
|
|
1739
1739
|
});
|
|
1740
|
-
}),
|
|
1740
|
+
}), hn = {
|
|
1741
1741
|
success: {
|
|
1742
1742
|
container: "bg-green-50 border-green-200",
|
|
1743
1743
|
iconColor: "text-green-600",
|
|
@@ -1751,7 +1751,7 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1751
1751
|
danger: {
|
|
1752
1752
|
container: "bg-red-50 border-red-200",
|
|
1753
1753
|
iconColor: "text-red-700",
|
|
1754
|
-
DefaultIcon:
|
|
1754
|
+
DefaultIcon: U
|
|
1755
1755
|
},
|
|
1756
1756
|
info: {
|
|
1757
1757
|
container: "bg-blue-50 border-blue-200",
|
|
@@ -1763,55 +1763,55 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1763
1763
|
iconColor: "text-purple-700",
|
|
1764
1764
|
DefaultIcon: V
|
|
1765
1765
|
}
|
|
1766
|
-
},
|
|
1767
|
-
let { container: u, iconColor: d, DefaultIcon: f } =
|
|
1768
|
-
return /* @__PURE__ */
|
|
1766
|
+
}, gn = a(function({ variant: e = "info", title: t, description: n, onDismiss: r, actions: i, icon: a, className: o, dataTestId: s, ...c }, l) {
|
|
1767
|
+
let { container: u, iconColor: d, DefaultIcon: f } = hn[e];
|
|
1768
|
+
return /* @__PURE__ */ q("div", {
|
|
1769
1769
|
ref: l,
|
|
1770
1770
|
role: "alert",
|
|
1771
1771
|
"data-test-id": s,
|
|
1772
|
-
className:
|
|
1772
|
+
className: Y("flex gap-3 p-4 border rounded-lg", u, o),
|
|
1773
1773
|
...c,
|
|
1774
1774
|
children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
className:
|
|
1777
|
-
children: a ?? /* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ K("div", {
|
|
1776
|
+
className: Y("flex-shrink-0 mt-0.5", d),
|
|
1777
|
+
children: a ?? /* @__PURE__ */ K(f, {
|
|
1778
1778
|
className: "h-5 w-5",
|
|
1779
1779
|
"aria-hidden": !0
|
|
1780
1780
|
})
|
|
1781
1781
|
}),
|
|
1782
|
-
/* @__PURE__ */
|
|
1782
|
+
/* @__PURE__ */ q("div", {
|
|
1783
1783
|
className: "flex-1 min-w-0",
|
|
1784
1784
|
children: [
|
|
1785
|
-
t && /* @__PURE__ */
|
|
1785
|
+
t && /* @__PURE__ */ K("div", {
|
|
1786
1786
|
className: "text-p-std font-semibold text-fg-default mb-0.5",
|
|
1787
1787
|
children: t
|
|
1788
1788
|
}),
|
|
1789
|
-
n && /* @__PURE__ */
|
|
1789
|
+
n && /* @__PURE__ */ K("div", {
|
|
1790
1790
|
className: "text-p-std text-fg-secondary",
|
|
1791
1791
|
children: n
|
|
1792
1792
|
}),
|
|
1793
|
-
i && /* @__PURE__ */
|
|
1793
|
+
i && /* @__PURE__ */ K("div", {
|
|
1794
1794
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
1795
1795
|
children: i
|
|
1796
1796
|
})
|
|
1797
1797
|
]
|
|
1798
1798
|
}),
|
|
1799
|
-
r && /* @__PURE__ */
|
|
1799
|
+
r && /* @__PURE__ */ K("button", {
|
|
1800
1800
|
type: "button",
|
|
1801
1801
|
onClick: r,
|
|
1802
1802
|
"aria-label": "Dismiss",
|
|
1803
1803
|
className: "flex-shrink-0 -mr-1 -mt-1 p-1 rounded-md text-fg-secondary hover:text-fg-default hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
1804
|
-
children: /* @__PURE__ */
|
|
1804
|
+
children: /* @__PURE__ */ K(H, { className: "h-4 w-4" })
|
|
1805
1805
|
})
|
|
1806
1806
|
]
|
|
1807
1807
|
});
|
|
1808
|
-
}),
|
|
1808
|
+
}), _n = 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) {
|
|
1809
1809
|
let m = {
|
|
1810
1810
|
...f,
|
|
1811
1811
|
target: u,
|
|
1812
1812
|
rel: d ?? (u === "_blank" ? "noopener noreferrer" : void 0)
|
|
1813
1813
|
};
|
|
1814
|
-
return /* @__PURE__ */
|
|
1814
|
+
return /* @__PURE__ */ q(rn, {
|
|
1815
1815
|
as: "a",
|
|
1816
1816
|
ref: p,
|
|
1817
1817
|
variant: e,
|
|
@@ -1819,27 +1819,27 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1819
1819
|
color: n,
|
|
1820
1820
|
truncate: o,
|
|
1821
1821
|
dataTestId: l,
|
|
1822
|
-
className:
|
|
1822
|
+
className: Y("inline-flex items-center gap-1 rounded-sm outline-none transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1", r === "always" && "underline", r === "hover" && "hover:underline", s),
|
|
1823
1823
|
...m,
|
|
1824
1824
|
children: [
|
|
1825
|
-
i && /* @__PURE__ */
|
|
1825
|
+
i && /* @__PURE__ */ K("span", {
|
|
1826
1826
|
className: "inline-flex shrink-0",
|
|
1827
1827
|
children: i
|
|
1828
1828
|
}),
|
|
1829
1829
|
c,
|
|
1830
|
-
a && /* @__PURE__ */
|
|
1830
|
+
a && /* @__PURE__ */ K("span", {
|
|
1831
1831
|
className: "inline-flex shrink-0",
|
|
1832
1832
|
children: a
|
|
1833
1833
|
})
|
|
1834
1834
|
]
|
|
1835
1835
|
});
|
|
1836
|
-
}),
|
|
1836
|
+
}), vn = {
|
|
1837
1837
|
sm: "max-w-sm",
|
|
1838
1838
|
md: "max-w-md",
|
|
1839
1839
|
lg: "max-w-lg",
|
|
1840
1840
|
xl: "max-w-2xl",
|
|
1841
1841
|
"2xl": "max-w-4xl"
|
|
1842
|
-
},
|
|
1842
|
+
}, yn = 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) {
|
|
1843
1843
|
let m = p(null);
|
|
1844
1844
|
return l(() => {
|
|
1845
1845
|
if (!e) return;
|
|
@@ -1855,55 +1855,55 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1855
1855
|
if (!e) return;
|
|
1856
1856
|
let t = document.activeElement;
|
|
1857
1857
|
return m.current?.focus(), () => t?.focus?.();
|
|
1858
|
-
}, [e]), e ?
|
|
1858
|
+
}, [e]), e ? J(/* @__PURE__ */ q("div", {
|
|
1859
1859
|
role: "dialog",
|
|
1860
1860
|
"aria-modal": "true",
|
|
1861
1861
|
"aria-labelledby": n ? "modal-title" : void 0,
|
|
1862
1862
|
"aria-describedby": r ? "modal-desc" : void 0,
|
|
1863
1863
|
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
1864
|
-
children: [/* @__PURE__ */
|
|
1864
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1865
1865
|
className: "absolute inset-0 bg-black/50",
|
|
1866
1866
|
onClick: () => s && t(),
|
|
1867
1867
|
"aria-hidden": !0
|
|
1868
|
-
}), /* @__PURE__ */
|
|
1869
|
-
ref:
|
|
1868
|
+
}), /* @__PURE__ */ q("div", {
|
|
1869
|
+
ref: rt(m, f),
|
|
1870
1870
|
tabIndex: -1,
|
|
1871
1871
|
"data-test-id": d,
|
|
1872
|
-
className:
|
|
1872
|
+
className: Y("relative w-full bg-bg-default rounded-xl shadow-z5 outline-none flex flex-col max-h-[90vh]", vn[o], u),
|
|
1873
1873
|
children: [
|
|
1874
|
-
(n || c) && /* @__PURE__ */
|
|
1874
|
+
(n || c) && /* @__PURE__ */ q("div", {
|
|
1875
1875
|
className: "flex items-start justify-between gap-4 px-6 pt-6 pb-4",
|
|
1876
|
-
children: [/* @__PURE__ */
|
|
1876
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1877
1877
|
className: "flex-1 min-w-0",
|
|
1878
|
-
children: [n && /* @__PURE__ */
|
|
1878
|
+
children: [n && /* @__PURE__ */ K("h2", {
|
|
1879
1879
|
id: "modal-title",
|
|
1880
1880
|
className: "text-h-xs font-semibold text-fg-default",
|
|
1881
1881
|
children: n
|
|
1882
|
-
}), r && /* @__PURE__ */
|
|
1882
|
+
}), r && /* @__PURE__ */ K("p", {
|
|
1883
1883
|
id: "modal-desc",
|
|
1884
1884
|
className: "mt-1 text-p-std text-fg-secondary",
|
|
1885
1885
|
children: r
|
|
1886
1886
|
})]
|
|
1887
|
-
}), c && /* @__PURE__ */
|
|
1887
|
+
}), c && /* @__PURE__ */ K("button", {
|
|
1888
1888
|
type: "button",
|
|
1889
1889
|
onClick: t,
|
|
1890
1890
|
"aria-label": "Close",
|
|
1891
1891
|
className: "-mr-2 -mt-2 p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
1892
|
-
children: /* @__PURE__ */
|
|
1892
|
+
children: /* @__PURE__ */ K(H, { className: "h-5 w-5" })
|
|
1893
1893
|
})]
|
|
1894
1894
|
}),
|
|
1895
|
-
i && /* @__PURE__ */
|
|
1895
|
+
i && /* @__PURE__ */ K("div", {
|
|
1896
1896
|
className: "px-6 pb-6 overflow-y-auto",
|
|
1897
1897
|
children: i
|
|
1898
1898
|
}),
|
|
1899
|
-
a && /* @__PURE__ */
|
|
1899
|
+
a && /* @__PURE__ */ K("div", {
|
|
1900
1900
|
className: "flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container rounded-b-xl",
|
|
1901
1901
|
children: a
|
|
1902
1902
|
})
|
|
1903
1903
|
]
|
|
1904
1904
|
})]
|
|
1905
1905
|
}), document.body) : null;
|
|
1906
|
-
}),
|
|
1906
|
+
}), bn = {
|
|
1907
1907
|
sm: {
|
|
1908
1908
|
box: "px-1.5 py-1.5 gap-1",
|
|
1909
1909
|
chip: "h-6 pl-0.5 pr-1.5",
|
|
@@ -1925,17 +1925,17 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1925
1925
|
input: "h-8 text-p-md min-w-[140px]",
|
|
1926
1926
|
avatar: "sm"
|
|
1927
1927
|
}
|
|
1928
|
-
},
|
|
1929
|
-
let j = u(), M = E ?? j, N = `${M}-listbox`, P = d || !!v, [F, I] = m(""), [L, R] = m(!1), [z, B] = m(0), V = p(null), te = p(null),
|
|
1928
|
+
}, xn = a(function({ options: e, value: t, onChange: n, onAdd: r, onRemove: i, size: a = "md", placeholder: o = "Select…", addMorePlaceholder: s = "Add another…", disabled: c = !1, error: d = !1, label: h, labelAddons: g, helperText: _, errorText: v, required: y = !1, lockedValues: b = [], max: x, searchable: S = !0, suggestionsLabel: C = "Suggestions", emptyText: w = "No matches. Try a different search.", showAvatars: T = !1, id: E, className: D, wrapperClassName: O, dataTestId: k }, A) {
|
|
1929
|
+
let j = u(), M = E ?? j, N = `${M}-listbox`, P = d || !!v, [F, I] = m(""), [L, R] = m(!1), [z, B] = m(0), V = p(null), te = p(null), ne = (e) => {
|
|
1930
1930
|
te.current = e, typeof A == "function" ? A(e) : A && (A.current = e);
|
|
1931
|
-
},
|
|
1931
|
+
}, re = f(() => new Map(e.map((e) => [String(e.value), e])), [e]), ie = f(() => t.map((e) => re.get(String(e))).filter((e) => !!e), [t, re]), U = f(() => {
|
|
1932
1932
|
let n = F.trim().toLowerCase();
|
|
1933
|
-
return e.filter((e) => !t
|
|
1933
|
+
return e.filter((e) => !ge(t, e.value) && (n === "" || e.label.toLowerCase().includes(n) || (e.description ?? "").toLowerCase().includes(n)));
|
|
1934
1934
|
}, [
|
|
1935
1935
|
e,
|
|
1936
1936
|
t,
|
|
1937
1937
|
F
|
|
1938
|
-
]),
|
|
1938
|
+
]), oe = x !== void 0 && t.length >= x;
|
|
1939
1939
|
l(() => {
|
|
1940
1940
|
if (!L) return;
|
|
1941
1941
|
let e = (e) => {
|
|
@@ -1943,198 +1943,198 @@ var on = a(function({ label: e, value: t, active: n = !1, size: r = "md", disabl
|
|
|
1943
1943
|
};
|
|
1944
1944
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
1945
1945
|
}, [L]), l(() => {
|
|
1946
|
-
B((e) => Math.min(e, Math.max(0,
|
|
1947
|
-
}, [
|
|
1948
|
-
let
|
|
1949
|
-
let i =
|
|
1950
|
-
c ||
|
|
1951
|
-
},
|
|
1952
|
-
c || b
|
|
1953
|
-
},
|
|
1954
|
-
if (!
|
|
1946
|
+
B((e) => Math.min(e, Math.max(0, U.length - 1)));
|
|
1947
|
+
}, [U.length]);
|
|
1948
|
+
let W = (e) => {
|
|
1949
|
+
let i = re.get(String(e));
|
|
1950
|
+
c || oe || !i || i.disabled || (n([...t, e]), r?.(i), I(""), B(0), te.current?.focus());
|
|
1951
|
+
}, G = (e) => {
|
|
1952
|
+
c || ge(b, e) || (n(t.filter((t) => !X(t, e))), i?.(e));
|
|
1953
|
+
}, J = (e) => {
|
|
1954
|
+
if (!U.length) return;
|
|
1955
1955
|
let t = z;
|
|
1956
|
-
for (let n = 0; n <
|
|
1956
|
+
for (let n = 0; n < U.length && (t = (t + e + U.length) % U.length, U[t]?.disabled); n++);
|
|
1957
1957
|
B(t);
|
|
1958
|
-
},
|
|
1959
|
-
if (e.key === "ArrowDown") e.preventDefault(), L ?
|
|
1960
|
-
else if (e.key === "ArrowUp") e.preventDefault(),
|
|
1961
|
-
else if (e.key === "Enter") L &&
|
|
1958
|
+
}, se = (e) => {
|
|
1959
|
+
if (e.key === "ArrowDown") e.preventDefault(), L ? J(1) : R(!0);
|
|
1960
|
+
else if (e.key === "ArrowUp") e.preventDefault(), J(-1);
|
|
1961
|
+
else if (e.key === "Enter") L && U[z] && !U[z].disabled && (e.preventDefault(), W(U[z].value));
|
|
1962
1962
|
else if (e.key === "Escape") R(!1);
|
|
1963
|
-
else if (e.key === "Backspace" && F === "" &&
|
|
1964
|
-
let e = [...
|
|
1965
|
-
e &&
|
|
1963
|
+
else if (e.key === "Backspace" && F === "" && ie.length > 0) {
|
|
1964
|
+
let e = [...ie].reverse().find((e) => !ge(b, e.value));
|
|
1965
|
+
e && G(e.value);
|
|
1966
1966
|
}
|
|
1967
|
-
},
|
|
1968
|
-
return /* @__PURE__ */
|
|
1967
|
+
}, ce = v ? `${M}-error` : _ ? `${M}-help` : void 0;
|
|
1968
|
+
return /* @__PURE__ */ q("div", {
|
|
1969
1969
|
"data-test-id": k,
|
|
1970
|
-
className:
|
|
1970
|
+
className: Y("flex flex-col gap-1.5 w-full", O),
|
|
1971
1971
|
children: [
|
|
1972
|
-
(h || g) && /* @__PURE__ */
|
|
1972
|
+
(h || g) && /* @__PURE__ */ q("div", {
|
|
1973
1973
|
className: "flex items-center gap-1.5",
|
|
1974
|
-
children: [h && /* @__PURE__ */
|
|
1974
|
+
children: [h && /* @__PURE__ */ q("label", {
|
|
1975
1975
|
htmlFor: M,
|
|
1976
1976
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
1977
|
-
children: [h, y && /* @__PURE__ */
|
|
1977
|
+
children: [h, y && /* @__PURE__ */ K("span", {
|
|
1978
1978
|
className: "text-red-600",
|
|
1979
1979
|
"aria-hidden": !0,
|
|
1980
1980
|
children: "*"
|
|
1981
1981
|
})]
|
|
1982
|
-
}), g && /* @__PURE__ */
|
|
1982
|
+
}), g && /* @__PURE__ */ K("span", {
|
|
1983
1983
|
className: "inline-flex items-center gap-1",
|
|
1984
1984
|
children: g
|
|
1985
1985
|
})]
|
|
1986
1986
|
}),
|
|
1987
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ q("div", {
|
|
1988
1988
|
ref: V,
|
|
1989
1989
|
className: "relative",
|
|
1990
|
-
children: [/* @__PURE__ */
|
|
1991
|
-
className:
|
|
1990
|
+
children: [/* @__PURE__ */ q("div", {
|
|
1991
|
+
className: Y("flex flex-wrap items-center rounded-lg border bg-bg-default transition-colors", bn[a].box, c ? "opacity-60 cursor-not-allowed border-border-default" : P ? "border-red-500 focus-within:ring-2 focus-within:ring-red-300 focus-within:ring-offset-1 cursor-text" : "border-border-default hover:border-border-strong focus-within:border-fg-tertiary focus-within:ring-2 focus-within:ring-brand-300 focus-within:ring-offset-1 cursor-text", D),
|
|
1992
1992
|
onClick: () => !c && te.current?.focus(),
|
|
1993
|
-
children: [
|
|
1994
|
-
let t = b
|
|
1995
|
-
return /* @__PURE__ */
|
|
1996
|
-
className:
|
|
1993
|
+
children: [ie.map((e) => {
|
|
1994
|
+
let t = ge(b, e.value);
|
|
1995
|
+
return /* @__PURE__ */ q("span", {
|
|
1996
|
+
className: Y("inline-flex items-center gap-1.5 rounded-full text-fg-default bg-bg-subtle", bn[a].chip, bn[a].chipText),
|
|
1997
1997
|
title: e.description,
|
|
1998
1998
|
children: [
|
|
1999
|
-
(T || e.avatarSrc) && /* @__PURE__ */
|
|
1999
|
+
(T || e.avatarSrc) && /* @__PURE__ */ K(Oe, {
|
|
2000
2000
|
src: e.avatarSrc,
|
|
2001
2001
|
name: e.label,
|
|
2002
|
-
size:
|
|
2002
|
+
size: bn[a].avatar
|
|
2003
2003
|
}),
|
|
2004
|
-
/* @__PURE__ */
|
|
2004
|
+
/* @__PURE__ */ K("span", {
|
|
2005
2005
|
className: "font-medium",
|
|
2006
2006
|
children: e.label
|
|
2007
2007
|
}),
|
|
2008
|
-
e.badge && /* @__PURE__ */
|
|
2008
|
+
e.badge && /* @__PURE__ */ K("span", {
|
|
2009
2009
|
className: "text-label-xxs uppercase tracking-wider opacity-70",
|
|
2010
2010
|
children: e.badge
|
|
2011
2011
|
}),
|
|
2012
|
-
!t && !c && /* @__PURE__ */
|
|
2012
|
+
!t && !c && /* @__PURE__ */ K("button", {
|
|
2013
2013
|
type: "button",
|
|
2014
2014
|
onClick: (t) => {
|
|
2015
|
-
t.stopPropagation(),
|
|
2015
|
+
t.stopPropagation(), G(e.value);
|
|
2016
2016
|
},
|
|
2017
2017
|
"aria-label": `Remove ${e.label}`,
|
|
2018
2018
|
className: "-mr-0.5 ml-0.5 text-fg-tertiary hover:text-fg-default p-0.5 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300",
|
|
2019
|
-
children: /* @__PURE__ */
|
|
2019
|
+
children: /* @__PURE__ */ K(H, { className: "w-3 h-3" })
|
|
2020
2020
|
})
|
|
2021
2021
|
]
|
|
2022
|
-
}, e.value);
|
|
2023
|
-
}), /* @__PURE__ */
|
|
2024
|
-
ref:
|
|
2022
|
+
}, String(e.value));
|
|
2023
|
+
}), /* @__PURE__ */ K("input", {
|
|
2024
|
+
ref: ne,
|
|
2025
2025
|
id: M,
|
|
2026
2026
|
type: "text",
|
|
2027
2027
|
role: "combobox",
|
|
2028
2028
|
"aria-expanded": L,
|
|
2029
2029
|
"aria-controls": N,
|
|
2030
2030
|
"aria-autocomplete": "list",
|
|
2031
|
-
"aria-activedescendant": L &&
|
|
2031
|
+
"aria-activedescendant": L && U[z] ? `${N}-opt-${z}` : void 0,
|
|
2032
2032
|
"aria-invalid": P || void 0,
|
|
2033
|
-
"aria-describedby":
|
|
2033
|
+
"aria-describedby": ce,
|
|
2034
2034
|
value: F,
|
|
2035
2035
|
readOnly: !S,
|
|
2036
|
-
disabled: c ||
|
|
2036
|
+
disabled: c || oe,
|
|
2037
2037
|
onChange: (e) => {
|
|
2038
2038
|
I(e.target.value), R(!0);
|
|
2039
2039
|
},
|
|
2040
2040
|
onFocus: () => R(!0),
|
|
2041
|
-
onKeyDown:
|
|
2042
|
-
placeholder:
|
|
2043
|
-
className:
|
|
2041
|
+
onKeyDown: se,
|
|
2042
|
+
placeholder: ie.length === 0 ? o : oe ? `Limit ${x} reached` : s,
|
|
2043
|
+
className: Y("flex-1 bg-transparent outline-none text-fg-default placeholder:text-fg-tertiary disabled:cursor-not-allowed", !S && "cursor-pointer", bn[a].input)
|
|
2044
2044
|
})]
|
|
2045
|
-
}), L && !c && !
|
|
2045
|
+
}), L && !c && !oe && /* @__PURE__ */ q("div", {
|
|
2046
2046
|
className: "absolute top-full left-0 right-0 mt-1 z-20 max-h-80 overflow-y-auto rounded-lg border border-border-default bg-bg-default shadow-z4",
|
|
2047
|
-
children: [/* @__PURE__ */
|
|
2047
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2048
2048
|
className: "px-3 py-2 border-b border-border-subtle flex items-center gap-2 text-p-sm text-fg-tertiary",
|
|
2049
|
-
children: [/* @__PURE__ */
|
|
2049
|
+
children: [/* @__PURE__ */ K(ee, { className: "w-3.5 h-3.5 shrink-0" }), /* @__PURE__ */ K("span", {
|
|
2050
2050
|
className: "truncate",
|
|
2051
2051
|
children: F ? `Matches for "${F}"` : C
|
|
2052
2052
|
})]
|
|
2053
|
-
}),
|
|
2053
|
+
}), U.length === 0 ? /* @__PURE__ */ q("div", {
|
|
2054
2054
|
className: "px-3 py-6 text-center",
|
|
2055
|
-
children: [/* @__PURE__ */
|
|
2055
|
+
children: [/* @__PURE__ */ K(ae, { className: "w-5 h-5 mx-auto text-fg-tertiary mb-2" }), /* @__PURE__ */ K("span", {
|
|
2056
2056
|
className: "text-p-sm text-fg-secondary",
|
|
2057
2057
|
children: w
|
|
2058
2058
|
})]
|
|
2059
|
-
}) : /* @__PURE__ */
|
|
2059
|
+
}) : /* @__PURE__ */ K("ul", {
|
|
2060
2060
|
role: "listbox",
|
|
2061
2061
|
id: N,
|
|
2062
2062
|
className: "py-1",
|
|
2063
|
-
children:
|
|
2063
|
+
children: U.map((e, t) => /* @__PURE__ */ K("li", {
|
|
2064
2064
|
role: "option",
|
|
2065
2065
|
id: `${N}-opt-${t}`,
|
|
2066
2066
|
"aria-selected": t === z,
|
|
2067
2067
|
"aria-disabled": e.disabled || void 0,
|
|
2068
|
-
children: /* @__PURE__ */
|
|
2068
|
+
children: /* @__PURE__ */ q("button", {
|
|
2069
2069
|
type: "button",
|
|
2070
2070
|
disabled: e.disabled,
|
|
2071
2071
|
onMouseEnter: () => B(t),
|
|
2072
2072
|
onMouseDown: (t) => {
|
|
2073
|
-
t.preventDefault(),
|
|
2073
|
+
t.preventDefault(), W(e.value);
|
|
2074
2074
|
},
|
|
2075
|
-
className:
|
|
2076
|
-
children: [(T || e.avatarSrc) && /* @__PURE__ */
|
|
2075
|
+
className: Y("w-full px-3 py-2 flex items-center gap-3 text-left transition", e.disabled ? "opacity-50 cursor-not-allowed" : t === z ? "bg-bg-subtle" : "hover:bg-bg-subtle"),
|
|
2076
|
+
children: [(T || e.avatarSrc) && /* @__PURE__ */ K(Oe, {
|
|
2077
2077
|
src: e.avatarSrc,
|
|
2078
2078
|
name: e.label,
|
|
2079
2079
|
size: "sm"
|
|
2080
|
-
}), /* @__PURE__ */
|
|
2080
|
+
}), /* @__PURE__ */ q("span", {
|
|
2081
2081
|
className: "flex-1 min-w-0",
|
|
2082
|
-
children: [/* @__PURE__ */
|
|
2082
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2083
2083
|
className: "block text-p-std font-medium text-fg-default truncate",
|
|
2084
2084
|
children: e.label
|
|
2085
|
-
}), e.description && /* @__PURE__ */
|
|
2085
|
+
}), e.description && /* @__PURE__ */ K("span", {
|
|
2086
2086
|
className: "block text-p-sm text-fg-secondary truncate",
|
|
2087
2087
|
children: e.description
|
|
2088
2088
|
})]
|
|
2089
2089
|
})]
|
|
2090
2090
|
})
|
|
2091
|
-
}, e.value))
|
|
2091
|
+
}, String(e.value)))
|
|
2092
2092
|
})]
|
|
2093
2093
|
})]
|
|
2094
2094
|
}),
|
|
2095
|
-
v ? /* @__PURE__ */
|
|
2095
|
+
v ? /* @__PURE__ */ K("p", {
|
|
2096
2096
|
id: `${M}-error`,
|
|
2097
2097
|
className: "text-p-sm text-red-700",
|
|
2098
2098
|
children: v
|
|
2099
|
-
}) : _ ? /* @__PURE__ */
|
|
2099
|
+
}) : _ ? /* @__PURE__ */ K("p", {
|
|
2100
2100
|
id: `${M}-help`,
|
|
2101
2101
|
className: "text-p-sm text-fg-secondary",
|
|
2102
2102
|
children: _
|
|
2103
2103
|
}) : null
|
|
2104
2104
|
]
|
|
2105
2105
|
});
|
|
2106
|
-
}),
|
|
2106
|
+
}), Sn = {
|
|
2107
2107
|
brand: "bg-brand-500 text-white",
|
|
2108
2108
|
danger: "bg-red-600 text-white",
|
|
2109
2109
|
success: "bg-green-600 text-white",
|
|
2110
2110
|
warning: "bg-yellow-600 text-gray-900 dark:text-gray-900",
|
|
2111
2111
|
info: "bg-blue-600 text-white"
|
|
2112
|
-
},
|
|
2112
|
+
}, Cn = {
|
|
2113
2113
|
lg: "min-w-[18px] h-[18px] px-1 text-[11px]",
|
|
2114
2114
|
sm: "min-w-[14px] h-[14px] px-0.5 text-[10px]"
|
|
2115
|
-
},
|
|
2115
|
+
}, wn = {
|
|
2116
2116
|
lg: "h-2.5 w-2.5",
|
|
2117
2117
|
sm: "h-1.5 w-1.5"
|
|
2118
2118
|
};
|
|
2119
|
-
function
|
|
2119
|
+
function Tn(e, t) {
|
|
2120
2120
|
return e > t ? `${t}+` : e >= 1e3 ? `${(e / 1e3).toFixed(0)}K` : String(e);
|
|
2121
2121
|
}
|
|
2122
|
-
var
|
|
2123
|
-
let d = n === "dot" || e > 0 || o, f = a != null && a !== !1, p = d ? /* @__PURE__ */
|
|
2122
|
+
var En = 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) {
|
|
2123
|
+
let d = n === "dot" || e > 0 || o, f = a != null && a !== !1, p = d ? /* @__PURE__ */ K("span", {
|
|
2124
2124
|
ref: u,
|
|
2125
2125
|
"data-test-id": c,
|
|
2126
|
-
className:
|
|
2126
|
+
className: Y("inline-flex items-center justify-center rounded-full font-semibold ring-2 ring-white", Sn[i], n === "count" ? Cn[r] : wn[r], f ? "absolute -top-1 -right-1" : "static", s),
|
|
2127
2127
|
...l,
|
|
2128
|
-
children: n === "count" &&
|
|
2128
|
+
children: n === "count" && Tn(e, t)
|
|
2129
2129
|
}) : null;
|
|
2130
|
-
return f ? /* @__PURE__ */
|
|
2130
|
+
return f ? /* @__PURE__ */ q("span", {
|
|
2131
2131
|
className: "relative inline-flex",
|
|
2132
2132
|
children: [a, p]
|
|
2133
2133
|
}) : p;
|
|
2134
2134
|
});
|
|
2135
2135
|
//#endregion
|
|
2136
2136
|
//#region src/components/Pagination/Pagination.tsx
|
|
2137
|
-
function
|
|
2137
|
+
function Dn(e, t, n, r) {
|
|
2138
2138
|
if (t <= n * 2 + 3 + r * 2) return Array.from({ length: t }, (e, t) => t + 1);
|
|
2139
2139
|
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 = [];
|
|
2140
2140
|
if (o) {
|
|
@@ -2149,49 +2149,49 @@ function Cn(e, t, n, r) {
|
|
|
2149
2149
|
...l
|
|
2150
2150
|
];
|
|
2151
2151
|
}
|
|
2152
|
-
var
|
|
2153
|
-
let u =
|
|
2154
|
-
return /* @__PURE__ */
|
|
2152
|
+
var On = "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", kn = "text-fg-default hover:bg-bg-subtle disabled:text-fg-disabled disabled:hover:bg-transparent disabled:cursor-not-allowed", An = a(function({ page: e, pageCount: t, onPageChange: n, siblingCount: r = 1, boundaryCount: i = 1, className: a, dataTestId: o, "aria-label": s, ...c }, l) {
|
|
2153
|
+
let u = Dn(e, t, r, i), d = e <= 1, f = e >= t;
|
|
2154
|
+
return /* @__PURE__ */ q("nav", {
|
|
2155
2155
|
ref: l,
|
|
2156
2156
|
"aria-label": s ?? "Pagination",
|
|
2157
2157
|
"data-test-id": o,
|
|
2158
|
-
className:
|
|
2158
|
+
className: Y("inline-flex items-center gap-1", a),
|
|
2159
2159
|
...c,
|
|
2160
2160
|
children: [
|
|
2161
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ K("button", {
|
|
2162
2162
|
type: "button",
|
|
2163
2163
|
onClick: () => !d && n(e - 1),
|
|
2164
2164
|
disabled: d,
|
|
2165
2165
|
"aria-label": "Previous page",
|
|
2166
|
-
className:
|
|
2167
|
-
children: /* @__PURE__ */
|
|
2166
|
+
className: Y(On, kn),
|
|
2167
|
+
children: /* @__PURE__ */ K(C, { className: "h-4 w-4" })
|
|
2168
2168
|
}),
|
|
2169
2169
|
u.map((t, r) => {
|
|
2170
|
-
if (t === "ellipsis-left" || t === "ellipsis-right") return /* @__PURE__ */
|
|
2170
|
+
if (t === "ellipsis-left" || t === "ellipsis-right") return /* @__PURE__ */ K("span", {
|
|
2171
2171
|
"aria-hidden": !0,
|
|
2172
2172
|
className: "inline-flex items-center justify-center w-9 h-9 text-fg-tertiary",
|
|
2173
|
-
children: /* @__PURE__ */
|
|
2173
|
+
children: /* @__PURE__ */ K(I, { className: "h-4 w-4" })
|
|
2174
2174
|
}, `${t}-${r}`);
|
|
2175
2175
|
let i = t === e;
|
|
2176
|
-
return /* @__PURE__ */
|
|
2176
|
+
return /* @__PURE__ */ K("button", {
|
|
2177
2177
|
type: "button",
|
|
2178
2178
|
onClick: () => n(t),
|
|
2179
2179
|
"aria-current": i ? "page" : void 0,
|
|
2180
|
-
className:
|
|
2180
|
+
className: Y(On, i ? "bg-brand-500 text-white font-semibold hover:bg-brand-600" : "text-fg-default hover:bg-bg-subtle"),
|
|
2181
2181
|
children: t
|
|
2182
2182
|
}, t);
|
|
2183
2183
|
}),
|
|
2184
|
-
/* @__PURE__ */
|
|
2184
|
+
/* @__PURE__ */ K("button", {
|
|
2185
2185
|
type: "button",
|
|
2186
2186
|
onClick: () => !f && n(e + 1),
|
|
2187
2187
|
disabled: f,
|
|
2188
2188
|
"aria-label": "Next page",
|
|
2189
|
-
className:
|
|
2190
|
-
children: /* @__PURE__ */
|
|
2189
|
+
className: Y(On, kn),
|
|
2190
|
+
children: /* @__PURE__ */ K(w, { className: "h-4 w-4" })
|
|
2191
2191
|
})
|
|
2192
2192
|
]
|
|
2193
2193
|
});
|
|
2194
|
-
}),
|
|
2194
|
+
}), jn = {
|
|
2195
2195
|
sm: {
|
|
2196
2196
|
padding: "px-3 py-2",
|
|
2197
2197
|
avatar: "sm",
|
|
@@ -2202,64 +2202,64 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2202
2202
|
avatar: "md",
|
|
2203
2203
|
gap: "gap-3"
|
|
2204
2204
|
}
|
|
2205
|
-
},
|
|
2205
|
+
}, Mn = {
|
|
2206
2206
|
default: "border-border-default bg-bg-default hover:border-fg-tertiary/40",
|
|
2207
2207
|
highlight: "border-brand-500 bg-brand-200/15 dark:bg-brand-500/10 ring-1 ring-brand-500/40",
|
|
2208
2208
|
warning: "border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20"
|
|
2209
|
-
},
|
|
2210
|
-
let d =
|
|
2211
|
-
/* @__PURE__ */
|
|
2209
|
+
}, Nn = a(function({ name: e, role: t, avatar: n, variant: r = "default", size: i = "md", badge: a, onClick: o, className: s, dataTestId: c, ...l }, u) {
|
|
2210
|
+
let d = jn[i], f = Mn[r], p = /* @__PURE__ */ q(G, { children: [
|
|
2211
|
+
/* @__PURE__ */ K(Oe, {
|
|
2212
2212
|
src: n,
|
|
2213
2213
|
name: e,
|
|
2214
2214
|
size: d.avatar
|
|
2215
2215
|
}),
|
|
2216
|
-
/* @__PURE__ */
|
|
2216
|
+
/* @__PURE__ */ q("div", {
|
|
2217
2217
|
className: "min-w-0 flex-1",
|
|
2218
|
-
children: [/* @__PURE__ */
|
|
2218
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2219
2219
|
className: "text-p-std font-semibold text-fg-default truncate leading-tight",
|
|
2220
2220
|
children: e
|
|
2221
|
-
}), t && /* @__PURE__ */
|
|
2221
|
+
}), t && /* @__PURE__ */ K("div", {
|
|
2222
2222
|
className: "text-p-sm text-fg-secondary truncate mt-0.5 leading-tight",
|
|
2223
2223
|
children: t
|
|
2224
2224
|
})]
|
|
2225
2225
|
}),
|
|
2226
|
-
a && /* @__PURE__ */
|
|
2226
|
+
a && /* @__PURE__ */ K("span", {
|
|
2227
2227
|
className: "shrink-0 self-center",
|
|
2228
2228
|
children: a
|
|
2229
2229
|
})
|
|
2230
|
-
] }), m =
|
|
2231
|
-
return o ? /* @__PURE__ */
|
|
2230
|
+
] }), m = Y("relative inline-flex items-center rounded-xl border transition", d.padding, d.gap, f, o && "cursor-pointer hover:shadow-z1", s);
|
|
2231
|
+
return o ? /* @__PURE__ */ K("button", {
|
|
2232
2232
|
ref: u,
|
|
2233
2233
|
type: "button",
|
|
2234
2234
|
onClick: o,
|
|
2235
2235
|
"data-test-id": c,
|
|
2236
|
-
className:
|
|
2236
|
+
className: Y(m, "text-left"),
|
|
2237
2237
|
...l,
|
|
2238
2238
|
children: p
|
|
2239
|
-
}) : /* @__PURE__ */
|
|
2239
|
+
}) : /* @__PURE__ */ K("div", {
|
|
2240
2240
|
ref: u,
|
|
2241
2241
|
"data-test-id": c,
|
|
2242
2242
|
className: m,
|
|
2243
2243
|
...l,
|
|
2244
2244
|
children: p
|
|
2245
2245
|
});
|
|
2246
|
-
}),
|
|
2246
|
+
}), Pn = {
|
|
2247
2247
|
sm: 29,
|
|
2248
2248
|
lg: 45
|
|
2249
|
-
},
|
|
2249
|
+
}, Fn = {
|
|
2250
2250
|
sm: 2,
|
|
2251
2251
|
lg: 4
|
|
2252
|
-
},
|
|
2252
|
+
}, In = {
|
|
2253
2253
|
sm: "h-1",
|
|
2254
2254
|
lg: "h-2"
|
|
2255
|
-
},
|
|
2255
|
+
}, Ln = {
|
|
2256
2256
|
sm: "text-p-xs",
|
|
2257
2257
|
lg: "text-p-sm"
|
|
2258
|
-
},
|
|
2258
|
+
}, Rn = 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) {
|
|
2259
2259
|
let f = r && i ? i / r * 100 : n, p = Math.min(100, Math.max(0, f)), m = r ? `${i}/${r}` : `${Math.round(p)}%`;
|
|
2260
2260
|
if (e === "circular") {
|
|
2261
|
-
let e = o ??
|
|
2262
|
-
return /* @__PURE__ */
|
|
2261
|
+
let e = o ?? Pn[t], n = e - 5, r = 2 * n * Math.PI, i = Fn[t];
|
|
2262
|
+
return /* @__PURE__ */ q("div", {
|
|
2263
2263
|
ref: d,
|
|
2264
2264
|
role: "progressbar",
|
|
2265
2265
|
"aria-valuemin": 0,
|
|
@@ -2267,24 +2267,24 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2267
2267
|
"aria-valuenow": s ? void 0 : p,
|
|
2268
2268
|
"aria-valuetext": s ? void 0 : m,
|
|
2269
2269
|
"data-test-id": l,
|
|
2270
|
-
className:
|
|
2270
|
+
className: Y("relative inline-flex items-center justify-center", c),
|
|
2271
2271
|
style: {
|
|
2272
2272
|
width: e * 2,
|
|
2273
2273
|
height: e * 2
|
|
2274
2274
|
},
|
|
2275
2275
|
...u,
|
|
2276
|
-
children: [/* @__PURE__ */
|
|
2276
|
+
children: [/* @__PURE__ */ q("svg", {
|
|
2277
2277
|
width: e * 2,
|
|
2278
2278
|
height: e * 2,
|
|
2279
2279
|
viewBox: `0 0 ${e * 2} ${e * 2}`,
|
|
2280
|
-
className:
|
|
2281
|
-
children: [/* @__PURE__ */
|
|
2280
|
+
className: Y("-rotate-90", s && "animate-spin"),
|
|
2281
|
+
children: [/* @__PURE__ */ K("circle", {
|
|
2282
2282
|
cx: e,
|
|
2283
2283
|
cy: e,
|
|
2284
2284
|
r: n,
|
|
2285
2285
|
strokeWidth: i,
|
|
2286
2286
|
className: "fill-none stroke-bg-subtle"
|
|
2287
|
-
}), /* @__PURE__ */
|
|
2287
|
+
}), /* @__PURE__ */ K("circle", {
|
|
2288
2288
|
cx: e,
|
|
2289
2289
|
cy: e,
|
|
2290
2290
|
r: n,
|
|
@@ -2296,14 +2296,14 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2296
2296
|
strokeDashoffset: s ? `${r * .75}px` : `${r - r * p / 100}px`
|
|
2297
2297
|
}
|
|
2298
2298
|
})]
|
|
2299
|
-
}), !a && !s && /* @__PURE__ */
|
|
2300
|
-
className:
|
|
2299
|
+
}), !a && !s && /* @__PURE__ */ K("span", {
|
|
2300
|
+
className: Y("absolute text-fg-secondary", Ln[t]),
|
|
2301
2301
|
"data-test-id": l ? `${l}-text` : void 0,
|
|
2302
2302
|
children: m
|
|
2303
2303
|
})]
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ q("div", {
|
|
2307
2307
|
ref: d,
|
|
2308
2308
|
role: "progressbar",
|
|
2309
2309
|
"aria-valuemin": 0,
|
|
@@ -2311,30 +2311,30 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2311
2311
|
"aria-valuenow": p,
|
|
2312
2312
|
"aria-valuetext": m,
|
|
2313
2313
|
"data-test-id": l,
|
|
2314
|
-
className:
|
|
2314
|
+
className: Y("flex w-full items-center gap-2", c),
|
|
2315
2315
|
...u,
|
|
2316
|
-
children: [/* @__PURE__ */
|
|
2317
|
-
className:
|
|
2318
|
-
children: /* @__PURE__ */
|
|
2316
|
+
children: [/* @__PURE__ */ K("div", {
|
|
2317
|
+
className: Y("w-full overflow-hidden rounded-full bg-bg-subtle", In[t]),
|
|
2318
|
+
children: /* @__PURE__ */ K("div", {
|
|
2319
2319
|
className: "h-full rounded-full bg-brand-500 transition-all duration-300 ease-linear",
|
|
2320
2320
|
style: { width: `${p}%` }
|
|
2321
2321
|
})
|
|
2322
|
-
}), !a && /* @__PURE__ */
|
|
2323
|
-
className:
|
|
2322
|
+
}), !a && /* @__PURE__ */ K("span", {
|
|
2323
|
+
className: Y("shrink-0 text-fg-secondary", Ln[t]),
|
|
2324
2324
|
"data-test-id": l ? `${l}-text` : void 0,
|
|
2325
2325
|
children: m
|
|
2326
2326
|
})]
|
|
2327
2327
|
});
|
|
2328
|
-
}),
|
|
2329
|
-
let p = u(), m = e ?? p, h = `${p}-label`, g = /* @__PURE__ */
|
|
2328
|
+
}), zn = r(null), Bn = a(function({ name: e, label: t, value: n, defaultValue: r, onChange: i, disabled: a, size: o = "md", orientation: s = "vertical", children: c, className: l, dataTestId: d }, f) {
|
|
2329
|
+
let p = u(), m = e ?? p, h = `${p}-label`, g = /* @__PURE__ */ K("div", {
|
|
2330
2330
|
ref: f,
|
|
2331
2331
|
role: "radiogroup",
|
|
2332
2332
|
"aria-labelledby": t ? h : void 0,
|
|
2333
2333
|
"data-test-id": d,
|
|
2334
|
-
className:
|
|
2334
|
+
className: Y("flex gap-3", s === "vertical" ? "flex-col" : "flex-row flex-wrap items-center gap-4", l),
|
|
2335
2335
|
children: c
|
|
2336
2336
|
});
|
|
2337
|
-
return /* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ K(zn.Provider, {
|
|
2338
2338
|
value: {
|
|
2339
2339
|
name: m,
|
|
2340
2340
|
value: n,
|
|
@@ -2343,35 +2343,35 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2343
2343
|
disabled: a,
|
|
2344
2344
|
size: o
|
|
2345
2345
|
},
|
|
2346
|
-
children: t ? /* @__PURE__ */
|
|
2346
|
+
children: t ? /* @__PURE__ */ q("div", {
|
|
2347
2347
|
className: "flex flex-col gap-1.5",
|
|
2348
|
-
children: [/* @__PURE__ */
|
|
2348
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2349
2349
|
id: h,
|
|
2350
2350
|
className: "text-p-std font-medium text-fg-default inline-flex",
|
|
2351
2351
|
children: t
|
|
2352
2352
|
}), g]
|
|
2353
2353
|
}) : g
|
|
2354
2354
|
});
|
|
2355
|
-
}),
|
|
2355
|
+
}), Vn = {
|
|
2356
2356
|
md: "h-5 w-5",
|
|
2357
2357
|
sm: "h-4 w-4"
|
|
2358
|
-
},
|
|
2358
|
+
}, Hn = {
|
|
2359
2359
|
md: "h-2 w-2",
|
|
2360
2360
|
sm: "h-1.5 w-1.5"
|
|
2361
|
-
},
|
|
2362
|
-
let g = c(
|
|
2363
|
-
return /* @__PURE__ */
|
|
2361
|
+
}, Un = 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) {
|
|
2362
|
+
let g = c(zn), _ = u(), v = a ?? _, y = t ?? g?.size ?? "md", b = o ?? g?.disabled, x = g !== null, S = x && g.value !== void 0 ? X(g.value, e) : void 0, C = x && g.defaultValue !== void 0 ? X(g.defaultValue, e) : void 0, w = x ? S : s, T = x ? C : l;
|
|
2363
|
+
return /* @__PURE__ */ q("label", {
|
|
2364
2364
|
htmlFor: v,
|
|
2365
2365
|
"data-test-id": p,
|
|
2366
|
-
className:
|
|
2367
|
-
children: [/* @__PURE__ */
|
|
2366
|
+
className: Y("inline-flex items-start gap-2.5", b ? "cursor-not-allowed opacity-60" : "cursor-pointer", f),
|
|
2367
|
+
children: [/* @__PURE__ */ q("span", {
|
|
2368
2368
|
className: "relative inline-flex shrink-0 items-center justify-center mt-0.5",
|
|
2369
|
-
children: [/* @__PURE__ */
|
|
2369
|
+
children: [/* @__PURE__ */ K("input", {
|
|
2370
2370
|
ref: h,
|
|
2371
2371
|
id: v,
|
|
2372
2372
|
type: "radio",
|
|
2373
2373
|
name: g?.name,
|
|
2374
|
-
value: e,
|
|
2374
|
+
value: String(e),
|
|
2375
2375
|
checked: w,
|
|
2376
2376
|
defaultChecked: T,
|
|
2377
2377
|
disabled: b,
|
|
@@ -2381,37 +2381,37 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2381
2381
|
className: "peer sr-only",
|
|
2382
2382
|
"aria-invalid": i || void 0,
|
|
2383
2383
|
...m
|
|
2384
|
-
}), /* @__PURE__ */
|
|
2385
|
-
className:
|
|
2386
|
-
children: /* @__PURE__ */
|
|
2384
|
+
}), /* @__PURE__ */ K("span", {
|
|
2385
|
+
className: Y("flex items-center justify-center rounded-full border bg-bg-default transition-colors", Vn[y], i ? "border-red-600" : "border-border-strong", !b && !i && "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"),
|
|
2386
|
+
children: /* @__PURE__ */ K("span", { className: Y("rounded-full bg-brand-500 transition-opacity", Hn[y], b && "!bg-fg-disabled") })
|
|
2387
2387
|
})]
|
|
2388
|
-
}), (n || r) && /* @__PURE__ */
|
|
2388
|
+
}), (n || r) && /* @__PURE__ */ q("span", {
|
|
2389
2389
|
className: "flex flex-col gap-0.5",
|
|
2390
|
-
children: [n && /* @__PURE__ */
|
|
2390
|
+
children: [n && /* @__PURE__ */ K("span", {
|
|
2391
2391
|
className: "text-p-std font-medium text-fg-default leading-tight",
|
|
2392
2392
|
children: n
|
|
2393
|
-
}), r && /* @__PURE__ */
|
|
2393
|
+
}), r && /* @__PURE__ */ K("span", {
|
|
2394
2394
|
className: "text-p-sm text-fg-secondary leading-snug",
|
|
2395
2395
|
children: r
|
|
2396
2396
|
})]
|
|
2397
2397
|
})]
|
|
2398
2398
|
});
|
|
2399
|
-
}),
|
|
2399
|
+
}), Wn = 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) {
|
|
2400
2400
|
let [h, g] = m(a), _ = o !== void 0, v = _ ? o : h, y = u(), b = () => {
|
|
2401
2401
|
let e = !v;
|
|
2402
2402
|
_ || g(e), s?.(e);
|
|
2403
2403
|
};
|
|
2404
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ q("div", {
|
|
2405
2405
|
ref: p,
|
|
2406
2406
|
"data-test-id": d,
|
|
2407
|
-
className:
|
|
2407
|
+
className: Y("flex flex-col gap-1", l),
|
|
2408
2408
|
...f,
|
|
2409
|
-
children: [/* @__PURE__ */
|
|
2409
|
+
children: [/* @__PURE__ */ K(rn, {
|
|
2410
2410
|
id: y,
|
|
2411
2411
|
clamp: v ? void 0 : t,
|
|
2412
2412
|
...c,
|
|
2413
2413
|
children: v ? e : n ?? e
|
|
2414
|
-
}), /* @__PURE__ */
|
|
2414
|
+
}), /* @__PURE__ */ K("button", {
|
|
2415
2415
|
type: "button",
|
|
2416
2416
|
onClick: (e) => {
|
|
2417
2417
|
e.stopPropagation(), b();
|
|
@@ -2422,23 +2422,23 @@ var wn = "inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std ro
|
|
|
2422
2422
|
children: v ? i : r
|
|
2423
2423
|
})]
|
|
2424
2424
|
});
|
|
2425
|
-
}),
|
|
2425
|
+
}), Gn = {
|
|
2426
2426
|
lg: "h-12 text-p-md px-3.5",
|
|
2427
2427
|
md: "h-10 text-p-std px-3",
|
|
2428
2428
|
sm: "h-8 text-p-sm px-2.5"
|
|
2429
2429
|
};
|
|
2430
|
-
function
|
|
2430
|
+
function Kn(e) {
|
|
2431
2431
|
return e.findIndex((e) => !e.disabled);
|
|
2432
2432
|
}
|
|
2433
|
-
var
|
|
2434
|
-
let A = u(), j = T ?? A, N = `${j}-listbox`, [P, F] = m(!1), [I, L] = m(r), R = n !== void 0, z = R ? n : I, B = p(null), V = p(null), te = p(null), [
|
|
2435
|
-
let t = v ?
|
|
2436
|
-
return t ? e.filter((e) => (e.searchText ?? (typeof e.label == "string" ? e.label : void 0) ?? e.value).toLowerCase().includes(t)) : e;
|
|
2433
|
+
var qn = a(function({ options: e, value: n, defaultValue: r, onChange: i, placeholder: a = "Select…", label: o, labelAddons: s, helperText: c, errorText: d, error: h = !1, required: g = !1, loading: _ = !1, searchable: v = !1, searchPlaceholder: y = "Search…", emptyText: x = "No results", size: C = "md", disabled: w, id: T, className: E, wrapperClassName: D, dataTestId: O }, k) {
|
|
2434
|
+
let A = u(), j = T ?? A, N = `${j}-listbox`, [P, F] = m(!1), [I, L] = m(r), R = n !== void 0, z = R ? n : I, B = p(null), V = p(null), te = p(null), [ne, re] = m(-1), [ie, ae] = m(""), H = h || !!d, U = d ? `${j}-error` : c ? `${j}-help` : void 0, oe = e.find((e) => X(e.value, z)), W = f(() => {
|
|
2435
|
+
let t = v ? ie.trim().toLowerCase() : "";
|
|
2436
|
+
return t ? e.filter((e) => (e.searchText ?? (typeof e.label == "string" ? e.label : void 0) ?? String(e.value)).toLowerCase().includes(t)) : e;
|
|
2437
2437
|
}, [
|
|
2438
2438
|
e,
|
|
2439
|
-
|
|
2439
|
+
ie,
|
|
2440
2440
|
v
|
|
2441
|
-
]),
|
|
2441
|
+
]), G = (e) => {
|
|
2442
2442
|
R || L(e), i?.(e), F(!1), v && V.current?.focus();
|
|
2443
2443
|
};
|
|
2444
2444
|
l(() => {
|
|
@@ -2449,52 +2449,52 @@ var Un = a(function({ options: e, value: n, defaultValue: r, onChange: i, placeh
|
|
|
2449
2449
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
2450
2450
|
}, [P]), l(() => {
|
|
2451
2451
|
if (!P) {
|
|
2452
|
-
|
|
2452
|
+
re(-1), ae("");
|
|
2453
2453
|
return;
|
|
2454
2454
|
}
|
|
2455
|
-
let e =
|
|
2456
|
-
|
|
2455
|
+
let e = W.findIndex((e) => X(e.value, z));
|
|
2456
|
+
re(e >= 0 && !W[e]?.disabled ? e : Kn(W));
|
|
2457
2457
|
}, [
|
|
2458
2458
|
P,
|
|
2459
2459
|
z,
|
|
2460
|
-
|
|
2460
|
+
W
|
|
2461
2461
|
]), l(() => {
|
|
2462
2462
|
P && v && te.current?.focus();
|
|
2463
2463
|
}, [P, v]), l(() => {
|
|
2464
2464
|
_ && F(!1);
|
|
2465
2465
|
}, [_]);
|
|
2466
|
-
let
|
|
2467
|
-
let t =
|
|
2466
|
+
let J = (e) => {
|
|
2467
|
+
let t = W.length;
|
|
2468
2468
|
if (t === 0) return;
|
|
2469
|
-
let n =
|
|
2470
|
-
for (let r = 0; r < t && (n = (n + e + t) % t,
|
|
2471
|
-
|
|
2472
|
-
},
|
|
2473
|
-
let e =
|
|
2474
|
-
e && !e.disabled &&
|
|
2469
|
+
let n = ne < 0 ? e === 1 ? -1 : 0 : ne;
|
|
2470
|
+
for (let r = 0; r < t && (n = (n + e + t) % t, W[n]?.disabled); r++);
|
|
2471
|
+
re(n);
|
|
2472
|
+
}, se = () => {
|
|
2473
|
+
let e = W[ne];
|
|
2474
|
+
e && !e.disabled && G(e.value);
|
|
2475
2475
|
};
|
|
2476
|
-
return /* @__PURE__ */
|
|
2476
|
+
return /* @__PURE__ */ q("div", {
|
|
2477
2477
|
ref: B,
|
|
2478
2478
|
"data-test-id": O,
|
|
2479
|
-
className:
|
|
2479
|
+
className: Y("flex flex-col gap-1.5 w-full relative", D),
|
|
2480
2480
|
children: [
|
|
2481
|
-
(o || s) && /* @__PURE__ */
|
|
2481
|
+
(o || s) && /* @__PURE__ */ q("div", {
|
|
2482
2482
|
className: "flex items-center gap-1.5",
|
|
2483
|
-
children: [o && /* @__PURE__ */
|
|
2483
|
+
children: [o && /* @__PURE__ */ q("label", {
|
|
2484
2484
|
htmlFor: j,
|
|
2485
2485
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
2486
|
-
children: [o, g && /* @__PURE__ */
|
|
2486
|
+
children: [o, g && /* @__PURE__ */ K("span", {
|
|
2487
2487
|
className: "text-red-600",
|
|
2488
2488
|
"aria-hidden": !0,
|
|
2489
2489
|
children: "*"
|
|
2490
2490
|
})]
|
|
2491
|
-
}), s && /* @__PURE__ */
|
|
2491
|
+
}), s && /* @__PURE__ */ K("span", {
|
|
2492
2492
|
className: "inline-flex items-center gap-1",
|
|
2493
2493
|
children: s
|
|
2494
2494
|
})]
|
|
2495
2495
|
}),
|
|
2496
|
-
/* @__PURE__ */
|
|
2497
|
-
ref:
|
|
2496
|
+
/* @__PURE__ */ q("button", {
|
|
2497
|
+
ref: rt(k, V),
|
|
2498
2498
|
id: j,
|
|
2499
2499
|
type: "button",
|
|
2500
2500
|
disabled: w,
|
|
@@ -2508,169 +2508,169 @@ var Un = a(function({ options: e, value: n, defaultValue: r, onChange: i, placeh
|
|
|
2508
2508
|
return;
|
|
2509
2509
|
}
|
|
2510
2510
|
if (e.key === "Enter" || e.key === " ") {
|
|
2511
|
-
|
|
2511
|
+
se();
|
|
2512
2512
|
return;
|
|
2513
2513
|
}
|
|
2514
|
-
|
|
2514
|
+
J(e.key === "ArrowDown" ? 1 : -1);
|
|
2515
2515
|
} else e.key === "Escape" && F(!1);
|
|
2516
2516
|
},
|
|
2517
2517
|
"aria-haspopup": "listbox",
|
|
2518
2518
|
"aria-expanded": P,
|
|
2519
|
-
"aria-invalid":
|
|
2519
|
+
"aria-invalid": H || void 0,
|
|
2520
2520
|
"aria-required": g || void 0,
|
|
2521
2521
|
"aria-busy": _ || void 0,
|
|
2522
2522
|
"aria-disabled": _ || void 0,
|
|
2523
|
-
"aria-describedby":
|
|
2524
|
-
"aria-controls": P &&
|
|
2525
|
-
className:
|
|
2526
|
-
children: [/* @__PURE__ */
|
|
2527
|
-
className:
|
|
2528
|
-
children:
|
|
2529
|
-
}), _ ? /* @__PURE__ */
|
|
2523
|
+
"aria-describedby": U,
|
|
2524
|
+
"aria-controls": P && W.length > 0 ? N : void 0,
|
|
2525
|
+
className: Y("inline-flex items-center justify-between w-full rounded-lg border bg-bg-default transition-colors outline-none", "text-left", H ? "border-red-600" : "border-border-default", !w && !H && "hover:border-border-strong", "focus-visible:ring-2", H ? "focus-visible:ring-red-300 focus-visible:border-red-600" : "focus-visible:ring-brand-300 focus-visible:border-brand-500", w && "bg-bg-container border-border-default cursor-not-allowed text-fg-disabled", _ && "cursor-wait", Gn[C], E),
|
|
2526
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2527
|
+
className: Y("truncate", !oe && "text-fg-tertiary"),
|
|
2528
|
+
children: oe ? oe.label : a
|
|
2529
|
+
}), _ ? /* @__PURE__ */ K(M, {
|
|
2530
2530
|
className: "h-4 w-4 ml-2 shrink-0 text-fg-secondary animate-spin",
|
|
2531
2531
|
"aria-hidden": !0
|
|
2532
|
-
}) : /* @__PURE__ */
|
|
2533
|
-
className:
|
|
2532
|
+
}) : /* @__PURE__ */ K(S, {
|
|
2533
|
+
className: Y("h-4 w-4 ml-2 shrink-0 text-fg-secondary transition-transform", P && "rotate-180"),
|
|
2534
2534
|
"aria-hidden": !0
|
|
2535
2535
|
})]
|
|
2536
2536
|
}),
|
|
2537
|
-
P && /* @__PURE__ */
|
|
2537
|
+
P && /* @__PURE__ */ q("div", {
|
|
2538
2538
|
className: "absolute left-0 right-0 top-full mt-1 rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 overflow-hidden",
|
|
2539
|
-
children: [v && /* @__PURE__ */
|
|
2539
|
+
children: [v && /* @__PURE__ */ q("div", {
|
|
2540
2540
|
className: "flex items-center gap-2 px-3 py-2 border-b border-border-default",
|
|
2541
|
-
children: [/* @__PURE__ */
|
|
2541
|
+
children: [/* @__PURE__ */ K(ee, {
|
|
2542
2542
|
className: "h-3.5 w-3.5 shrink-0 text-fg-tertiary",
|
|
2543
2543
|
"aria-hidden": !0
|
|
2544
|
-
}), /* @__PURE__ */
|
|
2544
|
+
}), /* @__PURE__ */ K("input", {
|
|
2545
2545
|
ref: te,
|
|
2546
2546
|
type: "text",
|
|
2547
2547
|
role: "combobox",
|
|
2548
2548
|
"aria-expanded": !0,
|
|
2549
|
-
"aria-controls":
|
|
2549
|
+
"aria-controls": W.length > 0 ? N : void 0,
|
|
2550
2550
|
"aria-autocomplete": "list",
|
|
2551
|
-
"aria-activedescendant":
|
|
2552
|
-
value:
|
|
2553
|
-
onChange: (e) =>
|
|
2551
|
+
"aria-activedescendant": ne >= 0 ? `${N}-opt-${ne}` : void 0,
|
|
2552
|
+
value: ie,
|
|
2553
|
+
onChange: (e) => ae(e.target.value),
|
|
2554
2554
|
onKeyDown: (e) => {
|
|
2555
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(),
|
|
2555
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), J(e.key === "ArrowDown" ? 1 : -1)) : e.key === "Enter" ? (e.preventDefault(), se()) : e.key === "Escape" ? (e.preventDefault(), F(!1), V.current?.focus()) : e.key === "Tab" && (V.current?.focus(), F(!1));
|
|
2556
2556
|
},
|
|
2557
2557
|
placeholder: y,
|
|
2558
2558
|
className: "w-full bg-transparent outline-none text-p-std text-fg-default placeholder:text-fg-tertiary"
|
|
2559
2559
|
})]
|
|
2560
|
-
}),
|
|
2560
|
+
}), W.length === 0 ? /* @__PURE__ */ K("p", {
|
|
2561
2561
|
className: "px-3 py-6 text-center text-p-sm text-fg-secondary",
|
|
2562
2562
|
children: x
|
|
2563
|
-
}) : /* @__PURE__ */
|
|
2563
|
+
}) : /* @__PURE__ */ K("ul", {
|
|
2564
2564
|
id: N,
|
|
2565
2565
|
role: "listbox",
|
|
2566
2566
|
className: "max-h-60 overflow-y-auto py-1",
|
|
2567
|
-
children:
|
|
2568
|
-
let r = e.value
|
|
2569
|
-
return /* @__PURE__ */
|
|
2567
|
+
children: W.map((e, n) => {
|
|
2568
|
+
let r = X(e.value, z), i = n === ne;
|
|
2569
|
+
return /* @__PURE__ */ q(t, { children: [!!e.group && e.group !== W[n - 1]?.group && /* @__PURE__ */ K("li", {
|
|
2570
2570
|
role: "presentation",
|
|
2571
2571
|
className: "px-3 pt-2 pb-1 text-label-sm font-medium uppercase tracking-wide text-fg-tertiary select-none",
|
|
2572
2572
|
children: e.group
|
|
2573
|
-
}), /* @__PURE__ */
|
|
2573
|
+
}), /* @__PURE__ */ q("li", {
|
|
2574
2574
|
id: `${N}-opt-${n}`,
|
|
2575
2575
|
role: "option",
|
|
2576
2576
|
"aria-selected": r,
|
|
2577
2577
|
"aria-disabled": e.disabled || void 0,
|
|
2578
|
-
onMouseEnter: () => !e.disabled &&
|
|
2579
|
-
onClick: () => !e.disabled &&
|
|
2580
|
-
className:
|
|
2581
|
-
children: [/* @__PURE__ */
|
|
2578
|
+
onMouseEnter: () => !e.disabled && re(n),
|
|
2579
|
+
onClick: () => !e.disabled && G(e.value),
|
|
2580
|
+
className: Y("flex items-center justify-between gap-2 px-3 py-2 text-p-std cursor-pointer select-none", e.disabled && "opacity-50 cursor-not-allowed", i && !e.disabled && "bg-bg-subtle", r && "font-medium"),
|
|
2581
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2582
2582
|
className: "truncate",
|
|
2583
2583
|
children: e.label
|
|
2584
|
-
}), r && /* @__PURE__ */
|
|
2585
|
-
})] }, e.value);
|
|
2584
|
+
}), r && /* @__PURE__ */ K(b, { className: "h-4 w-4 text-brand-500 shrink-0" })]
|
|
2585
|
+
})] }, String(e.value));
|
|
2586
2586
|
})
|
|
2587
2587
|
})]
|
|
2588
2588
|
}),
|
|
2589
|
-
d ? /* @__PURE__ */
|
|
2589
|
+
d ? /* @__PURE__ */ K("p", {
|
|
2590
2590
|
id: `${j}-error`,
|
|
2591
2591
|
className: "text-p-sm text-red-700",
|
|
2592
2592
|
children: d
|
|
2593
|
-
}) : c ? /* @__PURE__ */
|
|
2593
|
+
}) : c ? /* @__PURE__ */ K("p", {
|
|
2594
2594
|
id: `${j}-help`,
|
|
2595
2595
|
className: "text-p-sm text-fg-secondary",
|
|
2596
2596
|
children: c
|
|
2597
2597
|
}) : null
|
|
2598
2598
|
]
|
|
2599
2599
|
});
|
|
2600
|
-
}),
|
|
2601
|
-
function
|
|
2602
|
-
return c(
|
|
2600
|
+
}), Jn = r(null);
|
|
2601
|
+
function Yn() {
|
|
2602
|
+
return c(Jn) ?? {
|
|
2603
2603
|
collapsed: !1,
|
|
2604
2604
|
toggle: () => {}
|
|
2605
2605
|
};
|
|
2606
2606
|
}
|
|
2607
|
-
var
|
|
2607
|
+
var Xn = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange: n, children: r, className: i, logo: a, title: o, subtitle: s, dataTestId: c, ...l }, u) {
|
|
2608
2608
|
let [d, f] = m(e), p = t !== void 0, h = p ? t : d, g = () => {
|
|
2609
2609
|
let e = !h;
|
|
2610
2610
|
p || f(e), n?.(e);
|
|
2611
2611
|
};
|
|
2612
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ K(Jn.Provider, {
|
|
2613
2613
|
value: {
|
|
2614
2614
|
collapsed: h,
|
|
2615
2615
|
toggle: g
|
|
2616
2616
|
},
|
|
2617
|
-
children: /* @__PURE__ */
|
|
2617
|
+
children: /* @__PURE__ */ q("aside", {
|
|
2618
2618
|
ref: u,
|
|
2619
2619
|
"data-test-id": c,
|
|
2620
|
-
className:
|
|
2620
|
+
className: Y("flex flex-col bg-bg-default border-r border-border-default transition-all duration-200", h ? "w-16" : "w-64", i),
|
|
2621
2621
|
...l,
|
|
2622
|
-
children: [/* @__PURE__ */
|
|
2623
|
-
className:
|
|
2622
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2623
|
+
className: Y("flex items-center gap-3 px-4 py-4 border-b border-border-default", h && "justify-center px-2"),
|
|
2624
2624
|
children: [
|
|
2625
|
-
a && /* @__PURE__ */
|
|
2625
|
+
a && /* @__PURE__ */ K("div", {
|
|
2626
2626
|
className: "shrink-0",
|
|
2627
2627
|
children: a
|
|
2628
2628
|
}),
|
|
2629
|
-
!h && /* @__PURE__ */
|
|
2629
|
+
!h && /* @__PURE__ */ q("div", {
|
|
2630
2630
|
className: "flex flex-col min-w-0",
|
|
2631
|
-
children: [o && /* @__PURE__ */
|
|
2631
|
+
children: [o && /* @__PURE__ */ K("div", {
|
|
2632
2632
|
className: "text-p-md font-semibold text-fg-default truncate",
|
|
2633
2633
|
children: o
|
|
2634
|
-
}), s && /* @__PURE__ */
|
|
2634
|
+
}), s && /* @__PURE__ */ K("div", {
|
|
2635
2635
|
className: "text-p-sm text-fg-secondary truncate",
|
|
2636
2636
|
children: s
|
|
2637
2637
|
})]
|
|
2638
2638
|
}),
|
|
2639
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ K("button", {
|
|
2640
2640
|
type: "button",
|
|
2641
2641
|
onClick: g,
|
|
2642
2642
|
"aria-label": h ? "Expand sidebar" : "Collapse sidebar",
|
|
2643
|
-
className:
|
|
2644
|
-
children: /* @__PURE__ */
|
|
2643
|
+
className: Y("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"),
|
|
2644
|
+
children: /* @__PURE__ */ K(N, { className: "h-4 w-4" })
|
|
2645
2645
|
})
|
|
2646
2646
|
]
|
|
2647
|
-
}), /* @__PURE__ */
|
|
2647
|
+
}), /* @__PURE__ */ K("nav", {
|
|
2648
2648
|
className: "flex-1 overflow-y-auto p-2 flex flex-col gap-0.5",
|
|
2649
2649
|
children: r
|
|
2650
2650
|
})]
|
|
2651
2651
|
})
|
|
2652
2652
|
});
|
|
2653
|
-
}),
|
|
2654
|
-
let { collapsed: d } =
|
|
2653
|
+
}), Zn = a(function({ icon: e, label: t, active: n, badge: r, children: i, onClick: a, href: o, className: s, dataTestId: c, ...l }, u) {
|
|
2654
|
+
let { collapsed: d } = Yn(), [f, p] = m(n ?? !1), h = !!i, g = /* @__PURE__ */ q(G, { children: [e && /* @__PURE__ */ K("span", {
|
|
2655
2655
|
className: "inline-flex shrink-0",
|
|
2656
2656
|
children: e
|
|
2657
|
-
}), !d && /* @__PURE__ */
|
|
2658
|
-
/* @__PURE__ */
|
|
2657
|
+
}), !d && /* @__PURE__ */ q(G, { children: [
|
|
2658
|
+
/* @__PURE__ */ K("span", {
|
|
2659
2659
|
className: "flex-1 truncate text-left",
|
|
2660
2660
|
children: t
|
|
2661
2661
|
}),
|
|
2662
|
-
r && /* @__PURE__ */
|
|
2662
|
+
r && /* @__PURE__ */ K("span", {
|
|
2663
2663
|
className: "shrink-0",
|
|
2664
2664
|
children: r
|
|
2665
2665
|
}),
|
|
2666
|
-
h && /* @__PURE__ */
|
|
2667
|
-
className:
|
|
2666
|
+
h && /* @__PURE__ */ K(w, {
|
|
2667
|
+
className: Y("h-4 w-4 shrink-0 text-fg-tertiary transition-transform", f && "rotate-90"),
|
|
2668
2668
|
"aria-hidden": !0
|
|
2669
2669
|
})
|
|
2670
2670
|
] })] }), _ = () => {
|
|
2671
2671
|
h && p((e) => !e), a?.();
|
|
2672
|
-
}, v =
|
|
2673
|
-
return /* @__PURE__ */
|
|
2672
|
+
}, v = Y("group relative flex items-center gap-3 rounded-md px-3 py-2 text-p-std font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300", d && "px-2 justify-center", n ? "bg-brand-20 text-brand-800 before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:h-5 before:w-0.5 before:rounded-r before:bg-brand-500" : "text-fg-default hover:bg-bg-container", s);
|
|
2673
|
+
return /* @__PURE__ */ q(G, { children: [o ? /* @__PURE__ */ K("a", {
|
|
2674
2674
|
ref: u,
|
|
2675
2675
|
href: o,
|
|
2676
2676
|
onClick: _,
|
|
@@ -2678,24 +2678,24 @@ var Kn = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange:
|
|
|
2678
2678
|
className: v,
|
|
2679
2679
|
...l,
|
|
2680
2680
|
children: g
|
|
2681
|
-
}) : /* @__PURE__ */
|
|
2681
|
+
}) : /* @__PURE__ */ K("button", {
|
|
2682
2682
|
ref: u,
|
|
2683
2683
|
type: "button",
|
|
2684
2684
|
onClick: _,
|
|
2685
2685
|
"data-test-id": c,
|
|
2686
|
-
className:
|
|
2686
|
+
className: Y(v, "w-full"),
|
|
2687
2687
|
...l,
|
|
2688
2688
|
children: g
|
|
2689
|
-
}), h && f && !d && /* @__PURE__ */
|
|
2689
|
+
}), h && f && !d && /* @__PURE__ */ K("div", {
|
|
2690
2690
|
className: "flex flex-col gap-0.5 pl-8",
|
|
2691
2691
|
children: i
|
|
2692
2692
|
})] });
|
|
2693
|
-
}),
|
|
2693
|
+
}), Qn = {
|
|
2694
2694
|
text: "h-[1em] mb-[0.4em] origin-[0%_55%] scale-y-[0.6] rounded-sm",
|
|
2695
2695
|
circular: "size-10 rounded-full",
|
|
2696
2696
|
rectangular: "h-4 w-full",
|
|
2697
2697
|
rounded: "h-4 w-full rounded-md"
|
|
2698
|
-
},
|
|
2698
|
+
}, $n = {
|
|
2699
2699
|
pulse: "animate-pulse",
|
|
2700
2700
|
wave: [
|
|
2701
2701
|
"relative overflow-hidden",
|
|
@@ -2705,40 +2705,40 @@ var Kn = a(function({ defaultCollapsed: e = !1, collapsed: t, onCollapsedChange:
|
|
|
2705
2705
|
].join(" "),
|
|
2706
2706
|
none: ""
|
|
2707
2707
|
};
|
|
2708
|
-
function
|
|
2708
|
+
function er(e) {
|
|
2709
2709
|
if (e !== void 0) return typeof e == "number" ? `${e}px` : e;
|
|
2710
2710
|
}
|
|
2711
|
-
var
|
|
2711
|
+
var tr = 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) {
|
|
2712
2712
|
let d = a != null, f = Math.max(1, i), p = {
|
|
2713
|
-
...n === void 0 ? null : { width:
|
|
2714
|
-
...r === void 0 ? null : { height:
|
|
2713
|
+
...n === void 0 ? null : { width: er(n) },
|
|
2714
|
+
...r === void 0 ? null : { height: er(r) },
|
|
2715
2715
|
...o
|
|
2716
|
-
}, m =
|
|
2717
|
-
return d ? /* @__PURE__ */
|
|
2716
|
+
}, m = Y("block bg-bg-subtle leading-none", Qn[e], $n[t]);
|
|
2717
|
+
return d ? /* @__PURE__ */ K("span", {
|
|
2718
2718
|
ref: u,
|
|
2719
2719
|
"data-test-id": c,
|
|
2720
|
-
className:
|
|
2720
|
+
className: Y(m, "inline-block h-auto w-auto scale-100", s),
|
|
2721
2721
|
style: p,
|
|
2722
2722
|
...l,
|
|
2723
|
-
children: /* @__PURE__ */
|
|
2723
|
+
children: /* @__PURE__ */ K("span", {
|
|
2724
2724
|
className: "invisible inline-block",
|
|
2725
2725
|
"aria-hidden": !0,
|
|
2726
2726
|
children: a
|
|
2727
2727
|
})
|
|
2728
|
-
}) : f === 1 ? /* @__PURE__ */
|
|
2728
|
+
}) : f === 1 ? /* @__PURE__ */ K("span", {
|
|
2729
2729
|
ref: u,
|
|
2730
2730
|
"data-test-id": c,
|
|
2731
|
-
className:
|
|
2731
|
+
className: Y(m, s),
|
|
2732
2732
|
style: p,
|
|
2733
2733
|
role: "status",
|
|
2734
2734
|
"aria-label": "Loading",
|
|
2735
2735
|
...l
|
|
2736
|
-
}) : /* @__PURE__ */
|
|
2736
|
+
}) : /* @__PURE__ */ K("span", {
|
|
2737
2737
|
ref: u,
|
|
2738
2738
|
"data-test-id": c,
|
|
2739
|
-
className:
|
|
2739
|
+
className: Y("block", s),
|
|
2740
2740
|
...l,
|
|
2741
|
-
children: Array.from({ length: f }, (e, t) => /* @__PURE__ */
|
|
2741
|
+
children: Array.from({ length: f }, (e, t) => /* @__PURE__ */ K("span", {
|
|
2742
2742
|
className: m,
|
|
2743
2743
|
style: p,
|
|
2744
2744
|
"aria-hidden": t !== 0 || void 0,
|
|
@@ -2746,7 +2746,7 @@ var Zn = a(function({ variant: e = "text", animation: t = "pulse", width: n, hei
|
|
|
2746
2746
|
"aria-label": t === 0 ? "Loading" : void 0
|
|
2747
2747
|
}, t))
|
|
2748
2748
|
});
|
|
2749
|
-
}),
|
|
2749
|
+
}), nr = {
|
|
2750
2750
|
success: {
|
|
2751
2751
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
2752
2752
|
icon: x
|
|
@@ -2757,7 +2757,7 @@ var Zn = a(function({ variant: e = "text", animation: t = "pulse", width: n, hei
|
|
|
2757
2757
|
},
|
|
2758
2758
|
danger: {
|
|
2759
2759
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
2760
|
-
icon:
|
|
2760
|
+
icon: U
|
|
2761
2761
|
},
|
|
2762
2762
|
info: {
|
|
2763
2763
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
@@ -2767,19 +2767,19 @@ var Zn = a(function({ variant: e = "text", animation: t = "pulse", width: n, hei
|
|
|
2767
2767
|
container: "bg-gray-900 dark:bg-gray-700 text-white",
|
|
2768
2768
|
icon: j
|
|
2769
2769
|
}
|
|
2770
|
-
},
|
|
2770
|
+
}, rr = {
|
|
2771
2771
|
success: "text-green-400",
|
|
2772
2772
|
warning: "text-yellow-300",
|
|
2773
2773
|
danger: "text-red-400",
|
|
2774
2774
|
info: "text-blue-400",
|
|
2775
2775
|
neutral: "text-white/70"
|
|
2776
|
-
},
|
|
2777
|
-
function
|
|
2778
|
-
let e = c(
|
|
2776
|
+
}, ir = r(null);
|
|
2777
|
+
function ar() {
|
|
2778
|
+
let e = c(ir);
|
|
2779
2779
|
if (!e) throw Error("useSnackbar must be used inside <SnackbarProvider>");
|
|
2780
2780
|
return e;
|
|
2781
2781
|
}
|
|
2782
|
-
function
|
|
2782
|
+
function or({ children: e, dataTestId: t }) {
|
|
2783
2783
|
let [n, r] = m([]), i = p(/* @__PURE__ */ new Map()), a = s((e) => {
|
|
2784
2784
|
r((t) => t.filter((t) => t.id !== e));
|
|
2785
2785
|
let t = i.current.get(e);
|
|
@@ -2802,30 +2802,30 @@ function nr({ children: e, dataTestId: t }) {
|
|
|
2802
2802
|
return () => {
|
|
2803
2803
|
e.forEach(clearTimeout), e.clear();
|
|
2804
2804
|
};
|
|
2805
|
-
}, []), /* @__PURE__ */
|
|
2805
|
+
}, []), /* @__PURE__ */ q(ir.Provider, {
|
|
2806
2806
|
value: {
|
|
2807
2807
|
show: o,
|
|
2808
2808
|
dismiss: a
|
|
2809
2809
|
},
|
|
2810
|
-
children: [e,
|
|
2810
|
+
children: [e, J(/* @__PURE__ */ K("div", {
|
|
2811
2811
|
"data-test-id": t,
|
|
2812
2812
|
className: "fixed left-1/2 -translate-x-1/2 bottom-6 z-[100] flex flex-col gap-2 w-[min(400px,calc(100vw-2rem))] pointer-events-none",
|
|
2813
2813
|
children: n.map((e) => {
|
|
2814
|
-
let { container: t, icon: n } =
|
|
2815
|
-
return /* @__PURE__ */
|
|
2814
|
+
let { container: t, icon: n } = nr[e.variant ?? "neutral"];
|
|
2815
|
+
return /* @__PURE__ */ q("div", {
|
|
2816
2816
|
role: "status",
|
|
2817
2817
|
"data-test-id": e.dataTestId,
|
|
2818
|
-
className:
|
|
2818
|
+
className: Y("pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-lg shadow-z4", t),
|
|
2819
2819
|
children: [
|
|
2820
|
-
/* @__PURE__ */
|
|
2821
|
-
className:
|
|
2820
|
+
/* @__PURE__ */ K(n, {
|
|
2821
|
+
className: Y("h-5 w-5 shrink-0", rr[e.variant ?? "neutral"]),
|
|
2822
2822
|
"aria-hidden": !0
|
|
2823
2823
|
}),
|
|
2824
|
-
/* @__PURE__ */
|
|
2824
|
+
/* @__PURE__ */ K("p", {
|
|
2825
2825
|
className: "flex-1 text-p-std",
|
|
2826
2826
|
children: e.message
|
|
2827
2827
|
}),
|
|
2828
|
-
e.action && /* @__PURE__ */
|
|
2828
|
+
e.action && /* @__PURE__ */ K("button", {
|
|
2829
2829
|
type: "button",
|
|
2830
2830
|
onClick: () => {
|
|
2831
2831
|
e.action?.onClick(), a(e.id);
|
|
@@ -2833,12 +2833,12 @@ function nr({ children: e, dataTestId: t }) {
|
|
|
2833
2833
|
className: "text-p-std font-semibold text-brand-400 hover:text-brand-300 px-1",
|
|
2834
2834
|
children: e.action.label
|
|
2835
2835
|
}),
|
|
2836
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ K("button", {
|
|
2837
2837
|
type: "button",
|
|
2838
2838
|
onClick: () => a(e.id),
|
|
2839
2839
|
"aria-label": "Close",
|
|
2840
2840
|
className: "shrink-0 p-1 rounded-md text-white/70 hover:text-white hover:bg-white/10",
|
|
2841
|
-
children: /* @__PURE__ */
|
|
2841
|
+
children: /* @__PURE__ */ K(H, { className: "h-4 w-4" })
|
|
2842
2842
|
})
|
|
2843
2843
|
]
|
|
2844
2844
|
}, e.id);
|
|
@@ -2848,15 +2848,15 @@ function nr({ children: e, dataTestId: t }) {
|
|
|
2848
2848
|
}
|
|
2849
2849
|
//#endregion
|
|
2850
2850
|
//#region src/components/Status/Status.tsx
|
|
2851
|
-
var
|
|
2851
|
+
var sr = {
|
|
2852
2852
|
lg: "h-7 px-2.5 text-p-std gap-1.5",
|
|
2853
2853
|
md: "h-6 px-2 text-p-sm gap-1.5",
|
|
2854
2854
|
sm: "h-5 px-1.5 text-p-sm gap-1"
|
|
2855
|
-
},
|
|
2855
|
+
}, cr = {
|
|
2856
2856
|
lg: "h-2 w-2",
|
|
2857
2857
|
md: "h-1.5 w-1.5",
|
|
2858
2858
|
sm: "h-1.5 w-1.5"
|
|
2859
|
-
},
|
|
2859
|
+
}, lr = {
|
|
2860
2860
|
general: {
|
|
2861
2861
|
container: "bg-bg-subtle text-fg-default dark:text-fg-default",
|
|
2862
2862
|
dot: "bg-gray-600 dark:bg-gray-400"
|
|
@@ -2889,102 +2889,102 @@ var rr = {
|
|
|
2889
2889
|
container: "bg-bg-subtle text-fg-disabled",
|
|
2890
2890
|
dot: "bg-border-strong"
|
|
2891
2891
|
}
|
|
2892
|
-
},
|
|
2893
|
-
let { container: u, dot: d } =
|
|
2894
|
-
return /* @__PURE__ */
|
|
2892
|
+
}, ur = a(function({ variant: e = "general", size: t = "md", leftIcon: n, rightIcon: r, dot: i = !0, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
2893
|
+
let { container: u, dot: d } = lr[e];
|
|
2894
|
+
return /* @__PURE__ */ q("span", {
|
|
2895
2895
|
ref: l,
|
|
2896
2896
|
"data-test-id": s,
|
|
2897
|
-
className:
|
|
2897
|
+
className: Y("inline-flex items-center rounded-full font-medium whitespace-nowrap select-none", sr[t], u, a),
|
|
2898
2898
|
...c,
|
|
2899
2899
|
children: [
|
|
2900
|
-
n ? /* @__PURE__ */
|
|
2900
|
+
n ? /* @__PURE__ */ K("span", {
|
|
2901
2901
|
className: "inline-flex shrink-0",
|
|
2902
2902
|
children: n
|
|
2903
|
-
}) : i ? /* @__PURE__ */
|
|
2904
|
-
className:
|
|
2903
|
+
}) : i ? /* @__PURE__ */ K("span", {
|
|
2904
|
+
className: Y("inline-block shrink-0 rounded-full", cr[t], d),
|
|
2905
2905
|
"aria-hidden": !0
|
|
2906
2906
|
}) : null,
|
|
2907
2907
|
o,
|
|
2908
|
-
r && /* @__PURE__ */
|
|
2908
|
+
r && /* @__PURE__ */ K("span", {
|
|
2909
2909
|
className: "inline-flex shrink-0",
|
|
2910
2910
|
children: r
|
|
2911
2911
|
})
|
|
2912
2912
|
]
|
|
2913
2913
|
});
|
|
2914
|
-
}),
|
|
2914
|
+
}), dr = {
|
|
2915
2915
|
lg: "size-9",
|
|
2916
2916
|
sm: "size-6"
|
|
2917
|
-
},
|
|
2917
|
+
}, fr = {
|
|
2918
2918
|
lg: "h-9",
|
|
2919
2919
|
sm: "h-6"
|
|
2920
|
-
},
|
|
2920
|
+
}, pr = {
|
|
2921
2921
|
lg: "border-2",
|
|
2922
2922
|
sm: "border"
|
|
2923
|
-
},
|
|
2923
|
+
}, mr = {
|
|
2924
2924
|
lg: "text-p-std",
|
|
2925
2925
|
sm: "text-p-xs"
|
|
2926
|
-
},
|
|
2926
|
+
}, hr = {
|
|
2927
2927
|
lg: "size-5",
|
|
2928
2928
|
sm: "size-3.5"
|
|
2929
|
-
},
|
|
2929
|
+
}, gr = {
|
|
2930
2930
|
lg: "size-3",
|
|
2931
2931
|
sm: "size-2"
|
|
2932
|
-
},
|
|
2932
|
+
}, _r = {
|
|
2933
2933
|
lg: "text-p-std",
|
|
2934
2934
|
sm: "text-p-sm"
|
|
2935
|
-
},
|
|
2935
|
+
}, vr = {
|
|
2936
2936
|
lg: "text-p-sm",
|
|
2937
2937
|
sm: "text-p-xs"
|
|
2938
|
-
},
|
|
2938
|
+
}, yr = {
|
|
2939
2939
|
upcoming: "bg-bg-default border-border-strong text-fg-tertiary",
|
|
2940
2940
|
active: "bg-bg-default border-brand-500 text-brand-700",
|
|
2941
2941
|
completed: "bg-brand-500 border-brand-500 text-fg-inverse",
|
|
2942
2942
|
rejected: "bg-red-700 border-red-800 text-fg-inverse"
|
|
2943
|
-
},
|
|
2943
|
+
}, br = {
|
|
2944
2944
|
upcoming: "ring-4 ring-gray-100/80",
|
|
2945
2945
|
active: "ring-4 ring-brand-40/80",
|
|
2946
2946
|
completed: "ring-4 ring-brand-40/80",
|
|
2947
2947
|
rejected: "ring-4 ring-red-100/80"
|
|
2948
2948
|
};
|
|
2949
|
-
function
|
|
2950
|
-
return t === "completed" ? /* @__PURE__ */
|
|
2949
|
+
function xr(e, t, n, r) {
|
|
2950
|
+
return t === "completed" ? /* @__PURE__ */ K(E, { className: hr[r] }) : t === "rejected" ? /* @__PURE__ */ K(D, { className: hr[r] }) : e === "number" ? n + 1 : e === "dot" ? /* @__PURE__ */ K("span", { className: Y("rounded-full", gr[r], t === "active" ? "bg-brand-500" : "bg-transparent") }) : null;
|
|
2951
2951
|
}
|
|
2952
|
-
var
|
|
2952
|
+
var Sr = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "number", orientation: i = "horizontal", size: a = "lg", className: o, dataTestId: s, ...c }, l) {
|
|
2953
2953
|
let u = i === "vertical", d = (e) => (e?.status ?? "upcoming") === "completed";
|
|
2954
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ K("ol", {
|
|
2955
2955
|
ref: l,
|
|
2956
2956
|
"data-test-id": s,
|
|
2957
|
-
className:
|
|
2957
|
+
className: Y("flex", u ? "flex-col" : "w-full items-start", o),
|
|
2958
2958
|
...c,
|
|
2959
2959
|
children: e.map((i, o) => {
|
|
2960
|
-
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__ */
|
|
2961
|
-
className:
|
|
2962
|
-
children:
|
|
2963
|
-
}), h = /* @__PURE__ */
|
|
2964
|
-
className:
|
|
2965
|
-
children: [/* @__PURE__ */
|
|
2966
|
-
className:
|
|
2960
|
+
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__ */ K("span", {
|
|
2961
|
+
className: Y("relative z-10 inline-flex shrink-0 items-center justify-center rounded-full font-semibold transition-colors", dr[a], pr[a], mr[a], yr[s], i.highlighted && br[s]),
|
|
2962
|
+
children: xr(r, s, o, a)
|
|
2963
|
+
}), h = /* @__PURE__ */ q("div", {
|
|
2964
|
+
className: Y("flex flex-col", u ? "gap-0.5 pb-6" : "mt-2 items-center gap-0.5 text-center"),
|
|
2965
|
+
children: [/* @__PURE__ */ K("span", {
|
|
2966
|
+
className: Y("font-medium text-fg-default", _r[a]),
|
|
2967
2967
|
children: i.label
|
|
2968
|
-
}), i.description && /* @__PURE__ */
|
|
2969
|
-
className:
|
|
2968
|
+
}), i.description && /* @__PURE__ */ K("span", {
|
|
2969
|
+
className: Y("text-fg-secondary", vr[a]),
|
|
2970
2970
|
children: i.description
|
|
2971
2971
|
})]
|
|
2972
2972
|
});
|
|
2973
|
-
return /* @__PURE__ */
|
|
2973
|
+
return /* @__PURE__ */ q("li", {
|
|
2974
2974
|
"aria-current": i.value === t ? "step" : void 0,
|
|
2975
|
-
className:
|
|
2976
|
-
children: [/* @__PURE__ */
|
|
2977
|
-
className:
|
|
2975
|
+
className: Y("relative flex", u ? "flex-row gap-3" : "flex-1 basis-0 min-w-0 flex-col"),
|
|
2976
|
+
children: [/* @__PURE__ */ q("div", {
|
|
2977
|
+
className: Y("relative flex shrink-0", u ? "w-9 flex-col items-center justify-center" : Y("w-full items-center justify-center", fr[a])),
|
|
2978
2978
|
children: [
|
|
2979
|
-
!c && /* @__PURE__ */
|
|
2979
|
+
!c && /* @__PURE__ */ K("span", {
|
|
2980
2980
|
"aria-hidden": !0,
|
|
2981
|
-
className:
|
|
2981
|
+
className: Y("absolute", u ? "left-1/2 top-0 bottom-1/2 w-0.5 -translate-x-1/2" : "left-0 right-1/2 top-1/2 h-0.5 -translate-y-1/2", f ? "bg-brand-500" : "bg-border-default")
|
|
2982
2982
|
}),
|
|
2983
|
-
!l && /* @__PURE__ */
|
|
2983
|
+
!l && /* @__PURE__ */ K("span", {
|
|
2984
2984
|
"aria-hidden": !0,
|
|
2985
|
-
className:
|
|
2985
|
+
className: Y("absolute", u ? "left-1/2 top-1/2 bottom-0 w-0.5 -translate-x-1/2" : "left-1/2 right-0 top-1/2 h-0.5 -translate-y-1/2", p ? "bg-brand-500" : "bg-border-default")
|
|
2986
2986
|
}),
|
|
2987
|
-
n ? /* @__PURE__ */
|
|
2987
|
+
n ? /* @__PURE__ */ K("button", {
|
|
2988
2988
|
type: "button",
|
|
2989
2989
|
onClick: () => n(i.value),
|
|
2990
2990
|
"aria-label": typeof i.label == "string" ? i.label : void 0,
|
|
@@ -2996,17 +2996,17 @@ var vr = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
2996
2996
|
}, i.value);
|
|
2997
2997
|
})
|
|
2998
2998
|
});
|
|
2999
|
-
}),
|
|
2999
|
+
}), Cr = {
|
|
3000
3000
|
md: "h-6 w-11",
|
|
3001
3001
|
sm: "h-5 w-9"
|
|
3002
|
-
},
|
|
3002
|
+
}, wr = {
|
|
3003
3003
|
md: "h-5 w-5 peer-checked:translate-x-5",
|
|
3004
3004
|
sm: "h-4 w-4 peer-checked:translate-x-4"
|
|
3005
|
-
},
|
|
3006
|
-
let p = u(), m = i ?? p, h = /* @__PURE__ */
|
|
3005
|
+
}, Tr = 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) {
|
|
3006
|
+
let p = u(), m = i ?? p, h = /* @__PURE__ */ q("span", {
|
|
3007
3007
|
className: "relative inline-flex shrink-0",
|
|
3008
3008
|
children: [
|
|
3009
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ K("input", {
|
|
3010
3010
|
ref: f,
|
|
3011
3011
|
id: m,
|
|
3012
3012
|
type: "checkbox",
|
|
@@ -3017,44 +3017,44 @@ var vr = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3017
3017
|
className: "peer sr-only",
|
|
3018
3018
|
...d
|
|
3019
3019
|
}),
|
|
3020
|
-
/* @__PURE__ */
|
|
3021
|
-
/* @__PURE__ */
|
|
3020
|
+
/* @__PURE__ */ K("span", { className: Y("rounded-full bg-gray-300 dark:bg-gray-700 transition-colors", Cr[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") }),
|
|
3021
|
+
/* @__PURE__ */ K("span", { className: Y("absolute top-0.5 left-0.5 rounded-full bg-white dark:bg-white shadow-z1 transition-transform", wr[e]) })
|
|
3022
3022
|
]
|
|
3023
3023
|
});
|
|
3024
|
-
return !t && !n ? /* @__PURE__ */
|
|
3024
|
+
return !t && !n ? /* @__PURE__ */ K("label", {
|
|
3025
3025
|
htmlFor: m,
|
|
3026
3026
|
"data-test-id": l,
|
|
3027
|
-
className:
|
|
3027
|
+
className: Y("inline-flex", a ? "cursor-not-allowed opacity-60" : "cursor-pointer", c),
|
|
3028
3028
|
children: h
|
|
3029
|
-
}) : /* @__PURE__ */
|
|
3029
|
+
}) : /* @__PURE__ */ q("label", {
|
|
3030
3030
|
htmlFor: m,
|
|
3031
3031
|
"data-test-id": l,
|
|
3032
|
-
className:
|
|
3033
|
-
children: [h, /* @__PURE__ */
|
|
3032
|
+
className: Y("inline-flex items-start gap-3", r === "left" && "flex-row-reverse justify-end", a ? "cursor-not-allowed opacity-60" : "cursor-pointer", c),
|
|
3033
|
+
children: [h, /* @__PURE__ */ q("span", {
|
|
3034
3034
|
className: "flex flex-col gap-0.5",
|
|
3035
|
-
children: [t && /* @__PURE__ */
|
|
3035
|
+
children: [t && /* @__PURE__ */ K("span", {
|
|
3036
3036
|
className: "text-p-std font-medium text-fg-default leading-tight",
|
|
3037
3037
|
children: t
|
|
3038
|
-
}), n && /* @__PURE__ */
|
|
3038
|
+
}), n && /* @__PURE__ */ K("span", {
|
|
3039
3039
|
className: "text-p-sm text-fg-secondary leading-snug",
|
|
3040
3040
|
children: n
|
|
3041
3041
|
})]
|
|
3042
3042
|
})]
|
|
3043
3043
|
});
|
|
3044
|
-
}),
|
|
3044
|
+
}), Er = {
|
|
3045
3045
|
comfortable: "[&_td]:py-3 [&_th]:py-3",
|
|
3046
3046
|
compact: "[&_td]:py-2 [&_th]:py-2"
|
|
3047
|
-
},
|
|
3047
|
+
}, Dr = {
|
|
3048
3048
|
left: "text-left",
|
|
3049
3049
|
center: "text-center",
|
|
3050
3050
|
right: "text-right"
|
|
3051
|
-
},
|
|
3052
|
-
return /* @__PURE__ */
|
|
3051
|
+
}, Or = a(function({ density: e = "comfortable", striped: t = !1, hoverable: n = !0, stickyHeader: r = !1, wrapperClassName: i, className: a, children: o, dataTestId: s, ...c }, l) {
|
|
3052
|
+
return /* @__PURE__ */ K("div", {
|
|
3053
3053
|
"data-test-id": s,
|
|
3054
|
-
className:
|
|
3055
|
-
children: /* @__PURE__ */
|
|
3054
|
+
className: Y("w-full overflow-x-auto rounded-lg border border-border-default bg-bg-default", i),
|
|
3055
|
+
children: /* @__PURE__ */ K("table", {
|
|
3056
3056
|
ref: l,
|
|
3057
|
-
className:
|
|
3057
|
+
className: Y("w-full border-collapse text-p-std text-fg-default", Er[e], a),
|
|
3058
3058
|
"data-striped": t || void 0,
|
|
3059
3059
|
"data-hoverable": n || void 0,
|
|
3060
3060
|
"data-sticky": r || void 0,
|
|
@@ -3062,43 +3062,43 @@ var vr = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3062
3062
|
children: o
|
|
3063
3063
|
})
|
|
3064
3064
|
});
|
|
3065
|
-
}),
|
|
3066
|
-
return /* @__PURE__ */
|
|
3065
|
+
}), kr = a(function({ className: e, children: t, dataTestId: n, ...r }, i) {
|
|
3066
|
+
return /* @__PURE__ */ K("thead", {
|
|
3067
3067
|
ref: i,
|
|
3068
3068
|
"data-test-id": n,
|
|
3069
|
-
className:
|
|
3069
|
+
className: Y("bg-bg-container text-p-sm font-semibold text-fg-secondary uppercase tracking-wider", "[[data-sticky]_&]:sticky [[data-sticky]_&]:top-0 [[data-sticky]_&]:z-10", e),
|
|
3070
3070
|
...r,
|
|
3071
3071
|
children: t
|
|
3072
3072
|
});
|
|
3073
|
-
}),
|
|
3074
|
-
return /* @__PURE__ */
|
|
3073
|
+
}), Ar = a(function({ className: e, children: t, dataTestId: n, ...r }, i) {
|
|
3074
|
+
return /* @__PURE__ */ K("tbody", {
|
|
3075
3075
|
ref: i,
|
|
3076
3076
|
"data-test-id": n,
|
|
3077
|
-
className:
|
|
3077
|
+
className: Y("[&>tr]:border-t [&>tr]:border-border-default", "[[data-striped]_&>tr:nth-child(even)]:bg-bg-container", "[[data-hoverable]_&>tr:hover]:bg-bg-container", e),
|
|
3078
3078
|
...r,
|
|
3079
3079
|
children: t
|
|
3080
3080
|
});
|
|
3081
|
-
}),
|
|
3082
|
-
return /* @__PURE__ */
|
|
3081
|
+
}), jr = a(function({ className: e, children: t, dataTestId: n, ...r }, i) {
|
|
3082
|
+
return /* @__PURE__ */ K("tr", {
|
|
3083
3083
|
ref: i,
|
|
3084
3084
|
"data-test-id": n,
|
|
3085
3085
|
className: e,
|
|
3086
3086
|
...r,
|
|
3087
3087
|
children: t
|
|
3088
3088
|
});
|
|
3089
|
-
}),
|
|
3090
|
-
let l = /* @__PURE__ */
|
|
3089
|
+
}), Mr = a(function({ sortable: e = !1, sortDir: t = null, onSortChange: n, align: r = "left", className: i, children: a, dataTestId: o, ...s }, c) {
|
|
3090
|
+
let l = /* @__PURE__ */ q(G, { children: [a, e && /* @__PURE__ */ K("span", {
|
|
3091
3091
|
className: "inline-flex ml-1 align-middle text-fg-tertiary",
|
|
3092
|
-
children:
|
|
3092
|
+
children: K(t === "asc" ? v : t === "desc" ? _ : T, { className: "h-3.5 w-3.5" })
|
|
3093
3093
|
})] });
|
|
3094
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ K("th", {
|
|
3095
3095
|
ref: c,
|
|
3096
3096
|
scope: "col",
|
|
3097
3097
|
"data-test-id": o,
|
|
3098
|
-
className:
|
|
3098
|
+
className: Y("px-4 whitespace-nowrap", Dr[r], i),
|
|
3099
3099
|
"aria-sort": t === "asc" ? "ascending" : t === "desc" ? "descending" : void 0,
|
|
3100
3100
|
...s,
|
|
3101
|
-
children: e ? /* @__PURE__ */
|
|
3101
|
+
children: e ? /* @__PURE__ */ K("button", {
|
|
3102
3102
|
type: "button",
|
|
3103
3103
|
onClick: () => {
|
|
3104
3104
|
n?.(t === "asc" ? "desc" : t === "desc" ? null : "asc");
|
|
@@ -3107,37 +3107,37 @@ var vr = a(function({ steps: e, activeValue: t, onStepSelect: n, marker: r = "nu
|
|
|
3107
3107
|
children: l
|
|
3108
3108
|
}) : l
|
|
3109
3109
|
});
|
|
3110
|
-
}),
|
|
3111
|
-
return /* @__PURE__ */
|
|
3110
|
+
}), Nr = a(function({ align: e = "left", className: t, children: n, dataTestId: r, ...i }, a) {
|
|
3111
|
+
return /* @__PURE__ */ K("td", {
|
|
3112
3112
|
ref: a,
|
|
3113
3113
|
"data-test-id": r,
|
|
3114
|
-
className:
|
|
3114
|
+
className: Y("px-4", Dr[e], t),
|
|
3115
3115
|
...i,
|
|
3116
3116
|
children: n
|
|
3117
3117
|
});
|
|
3118
3118
|
});
|
|
3119
|
-
function
|
|
3120
|
-
return /* @__PURE__ */
|
|
3119
|
+
function Pr({ columns: e, rows: t, rowKey: n, empty: r = "No results", density: i, striped: a, hoverable: o, sortKey: s, sortDir: c = null, onSortChange: l, onRowClick: u, className: d, dataTestId: f }) {
|
|
3120
|
+
return /* @__PURE__ */ q(Or, {
|
|
3121
3121
|
density: i,
|
|
3122
3122
|
striped: a,
|
|
3123
3123
|
hoverable: o,
|
|
3124
3124
|
className: d,
|
|
3125
3125
|
dataTestId: f,
|
|
3126
|
-
children: [/* @__PURE__ */
|
|
3126
|
+
children: [/* @__PURE__ */ K(kr, { children: /* @__PURE__ */ K(jr, { children: e.map((e) => /* @__PURE__ */ K(Mr, {
|
|
3127
3127
|
align: e.align,
|
|
3128
3128
|
sortable: e.sortable,
|
|
3129
3129
|
sortDir: s === e.key ? c : null,
|
|
3130
3130
|
onSortChange: (t) => l?.(e.key, t),
|
|
3131
3131
|
children: e.header
|
|
3132
|
-
}, e.key)) }) }), /* @__PURE__ */
|
|
3132
|
+
}, e.key)) }) }), /* @__PURE__ */ K(Ar, { children: t.length === 0 ? /* @__PURE__ */ K(jr, { children: /* @__PURE__ */ K(Nr, {
|
|
3133
3133
|
colSpan: e.length,
|
|
3134
3134
|
className: "text-center text-fg-tertiary py-10",
|
|
3135
3135
|
align: "center",
|
|
3136
3136
|
children: r
|
|
3137
|
-
}) }) : t.map((t, r) => /* @__PURE__ */
|
|
3137
|
+
}) }) : t.map((t, r) => /* @__PURE__ */ K(jr, {
|
|
3138
3138
|
onClick: u ? () => u(t) : void 0,
|
|
3139
3139
|
className: u ? "cursor-pointer" : void 0,
|
|
3140
|
-
children: e.map((e) => /* @__PURE__ */
|
|
3140
|
+
children: e.map((e) => /* @__PURE__ */ K(Nr, {
|
|
3141
3141
|
align: e.align,
|
|
3142
3142
|
children: e.render ? e.render(t) : e.accessor ? e.accessor(t) : null
|
|
3143
3143
|
}, e.key))
|
|
@@ -3146,13 +3146,13 @@ function Ar({ columns: e, rows: t, rowKey: n, empty: r = "No results", density:
|
|
|
3146
3146
|
}
|
|
3147
3147
|
//#endregion
|
|
3148
3148
|
//#region src/components/Tabs/Tabs.tsx
|
|
3149
|
-
var
|
|
3150
|
-
function
|
|
3151
|
-
let e = c(
|
|
3149
|
+
var Fr = r(null);
|
|
3150
|
+
function Ir() {
|
|
3151
|
+
let e = c(Fr);
|
|
3152
3152
|
if (!e) throw Error("Tab components must be used inside <Tabs>");
|
|
3153
3153
|
return e;
|
|
3154
3154
|
}
|
|
3155
|
-
function
|
|
3155
|
+
function Lr(t) {
|
|
3156
3156
|
let n = [];
|
|
3157
3157
|
e.forEach(t, (e) => {
|
|
3158
3158
|
o(e) && n.push(e);
|
|
@@ -3166,9 +3166,9 @@ function Nr(t) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
return "";
|
|
3168
3168
|
}
|
|
3169
|
-
var
|
|
3170
|
-
let [f, p] = m(() => e ??
|
|
3171
|
-
return /* @__PURE__ */
|
|
3169
|
+
var Rr = 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) {
|
|
3170
|
+
let [f, p] = m(() => e ?? Lr(s)), h = t !== void 0, g = h ? t : f, _ = u();
|
|
3171
|
+
return /* @__PURE__ */ K(Fr.Provider, {
|
|
3172
3172
|
value: {
|
|
3173
3173
|
value: g,
|
|
3174
3174
|
setValue: (e) => {
|
|
@@ -3179,18 +3179,18 @@ var Pr = a(function({ defaultValue: e, value: t, onValueChange: n, variant: r =
|
|
|
3179
3179
|
tabsId: _,
|
|
3180
3180
|
disabled: a
|
|
3181
3181
|
},
|
|
3182
|
-
children: /* @__PURE__ */
|
|
3182
|
+
children: /* @__PURE__ */ K("div", {
|
|
3183
3183
|
ref: d,
|
|
3184
3184
|
"data-test-id": c,
|
|
3185
|
-
className:
|
|
3185
|
+
className: Y("flex flex-col gap-4", o),
|
|
3186
3186
|
...l,
|
|
3187
3187
|
children: s
|
|
3188
3188
|
})
|
|
3189
3189
|
});
|
|
3190
|
-
}),
|
|
3191
|
-
let { variant: s } =
|
|
3192
|
-
return /* @__PURE__ */
|
|
3193
|
-
ref:
|
|
3190
|
+
}), zr = a(function({ children: e, scrollable: t = !1, className: n, dataTestId: r, onKeyDown: i, ...a }, o) {
|
|
3191
|
+
let { variant: s } = Ir(), c = p(null);
|
|
3192
|
+
return /* @__PURE__ */ K("div", {
|
|
3193
|
+
ref: rt(o, c),
|
|
3194
3194
|
role: "tablist",
|
|
3195
3195
|
onKeyDown: (e) => {
|
|
3196
3196
|
i?.(e);
|
|
@@ -3205,17 +3205,17 @@ var Pr = a(function({ defaultValue: e, value: t, onValueChange: n, variant: r =
|
|
|
3205
3205
|
}), a.click());
|
|
3206
3206
|
},
|
|
3207
3207
|
"data-test-id": r,
|
|
3208
|
-
className:
|
|
3208
|
+
className: Y("inline-flex", s === "underline" && "border-b border-border-default gap-1 w-full", s === "pills" && "gap-1 p-1 rounded-full bg-bg-container", s === "boxed" && "gap-0 rounded-lg border border-border-default overflow-hidden bg-bg-container", t && Y("overflow-x-auto flex-nowrap scroll-smooth [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-16px),transparent)]"), n),
|
|
3209
3209
|
...a,
|
|
3210
3210
|
children: e
|
|
3211
3211
|
});
|
|
3212
3212
|
});
|
|
3213
|
-
|
|
3214
|
-
var
|
|
3213
|
+
zr.displayName = "TabList";
|
|
3214
|
+
var Br = {
|
|
3215
3215
|
lg: "h-11 px-4 text-p-md",
|
|
3216
3216
|
md: "h-10 px-3 text-p-std",
|
|
3217
3217
|
sm: "h-8 px-2.5 text-p-sm"
|
|
3218
|
-
},
|
|
3218
|
+
}, Vr = {
|
|
3219
3219
|
underline: {
|
|
3220
3220
|
on: "bg-brand-500 text-white",
|
|
3221
3221
|
off: "bg-bg-subtle text-fg-secondary"
|
|
@@ -3228,8 +3228,8 @@ var Ir = {
|
|
|
3228
3228
|
on: "bg-brand-500 text-white",
|
|
3229
3229
|
off: "bg-bg-subtle text-fg-secondary"
|
|
3230
3230
|
}
|
|
3231
|
-
},
|
|
3232
|
-
let { value: h, setValue: g, variant: _, size: v, tabsId: y, disabled: b } =
|
|
3231
|
+
}, Hr = 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) {
|
|
3232
|
+
let { value: h, setValue: g, variant: _, size: v, tabsId: y, disabled: b } = Ir(), x = X(h, e), S = b || n, C = i != null && i !== !1, w = f ?? `${y}-tab-${e}`, T = `${y}-panel-${e}`, E = Y("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", Br[v], S && "opacity-50 cursor-not-allowed"), D = _ === "underline" ? Y("rounded-t-lg", x ? "text-fg-default" : "text-fg-secondary hover:text-fg-default hover:bg-bg-subtle/60") : _ === "pills" ? Y("rounded-full", x ? "bg-bg-default text-fg-default shadow-z1" : "bg-transparent text-fg-secondary hover:text-fg-default") : Y("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__ */ q("button", {
|
|
3233
3233
|
ref: m,
|
|
3234
3234
|
id: w,
|
|
3235
3235
|
type: "button",
|
|
@@ -3242,34 +3242,34 @@ var Ir = {
|
|
|
3242
3242
|
onClick: (t) => {
|
|
3243
3243
|
S || (g(e), d?.(t));
|
|
3244
3244
|
},
|
|
3245
|
-
className:
|
|
3245
|
+
className: Y(E, D, o && "pr-9", l),
|
|
3246
3246
|
...p,
|
|
3247
3247
|
children: [
|
|
3248
|
-
r && /* @__PURE__ */
|
|
3248
|
+
r && /* @__PURE__ */ K("span", {
|
|
3249
3249
|
className: "inline-flex shrink-0",
|
|
3250
3250
|
children: r
|
|
3251
3251
|
}),
|
|
3252
|
-
/* @__PURE__ */
|
|
3252
|
+
/* @__PURE__ */ K("span", {
|
|
3253
3253
|
className: "truncate",
|
|
3254
3254
|
children: t
|
|
3255
3255
|
}),
|
|
3256
|
-
C && (a ? /* @__PURE__ */
|
|
3256
|
+
C && (a ? /* @__PURE__ */ K(Re, {
|
|
3257
3257
|
size: "xs",
|
|
3258
3258
|
...a,
|
|
3259
3259
|
children: i
|
|
3260
|
-
}) : /* @__PURE__ */
|
|
3261
|
-
className:
|
|
3260
|
+
}) : /* @__PURE__ */ K("span", {
|
|
3261
|
+
className: Y("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 ? Vr[_].on : Vr[_].off),
|
|
3262
3262
|
children: i
|
|
3263
3263
|
})),
|
|
3264
|
-
_ === "underline" && /* @__PURE__ */
|
|
3264
|
+
_ === "underline" && /* @__PURE__ */ K("span", {
|
|
3265
3265
|
"aria-hidden": !0,
|
|
3266
|
-
className:
|
|
3266
|
+
className: Y("pointer-events-none absolute inset-x-0 -bottom-px h-[2px] rounded-full bg-brand-500 transition-opacity duration-150", x ? "opacity-100" : "opacity-0")
|
|
3267
3267
|
})
|
|
3268
3268
|
]
|
|
3269
3269
|
});
|
|
3270
|
-
return o ? /* @__PURE__ */
|
|
3270
|
+
return o ? /* @__PURE__ */ q("span", {
|
|
3271
3271
|
className: "relative inline-flex",
|
|
3272
|
-
children: [O, /* @__PURE__ */
|
|
3272
|
+
children: [O, /* @__PURE__ */ K("button", {
|
|
3273
3273
|
type: "button",
|
|
3274
3274
|
"aria-label": c,
|
|
3275
3275
|
disabled: S,
|
|
@@ -3280,9 +3280,9 @@ var Ir = {
|
|
|
3280
3280
|
children: o
|
|
3281
3281
|
})]
|
|
3282
3282
|
}) : O;
|
|
3283
|
-
}),
|
|
3284
|
-
let { value: c, tabsId: l } =
|
|
3285
|
-
return !u && !a ? null : /* @__PURE__ */
|
|
3283
|
+
}), Ur = a(function({ value: e, children: t, className: n, dataTestId: r, id: i, keepMounted: a = !1, ...o }, s) {
|
|
3284
|
+
let { value: c, tabsId: l } = Ir(), u = X(c, e);
|
|
3285
|
+
return !u && !a ? null : /* @__PURE__ */ K("div", {
|
|
3286
3286
|
ref: s,
|
|
3287
3287
|
id: i ?? `${l}-panel-${e}`,
|
|
3288
3288
|
role: "tabpanel",
|
|
@@ -3293,28 +3293,28 @@ var Ir = {
|
|
|
3293
3293
|
...o,
|
|
3294
3294
|
children: t
|
|
3295
3295
|
});
|
|
3296
|
-
}),
|
|
3296
|
+
}), Wr = 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) {
|
|
3297
3297
|
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;
|
|
3298
|
-
return /* @__PURE__ */
|
|
3299
|
-
className:
|
|
3298
|
+
return /* @__PURE__ */ q("div", {
|
|
3299
|
+
className: Y("flex flex-col gap-1.5 w-full", f),
|
|
3300
3300
|
"data-test-id": _,
|
|
3301
3301
|
children: [
|
|
3302
|
-
(e || t) && /* @__PURE__ */
|
|
3302
|
+
(e || t) && /* @__PURE__ */ q("div", {
|
|
3303
3303
|
className: "flex items-center gap-1.5",
|
|
3304
|
-
children: [e && /* @__PURE__ */
|
|
3304
|
+
children: [e && /* @__PURE__ */ q("label", {
|
|
3305
3305
|
htmlFor: S,
|
|
3306
3306
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
3307
|
-
children: [e, s && /* @__PURE__ */
|
|
3307
|
+
children: [e, s && /* @__PURE__ */ K("span", {
|
|
3308
3308
|
className: "text-red-600",
|
|
3309
3309
|
"aria-hidden": !0,
|
|
3310
3310
|
children: "*"
|
|
3311
3311
|
})]
|
|
3312
|
-
}), t && /* @__PURE__ */
|
|
3312
|
+
}), t && /* @__PURE__ */ K("span", {
|
|
3313
3313
|
className: "inline-flex items-center gap-1",
|
|
3314
3314
|
children: t
|
|
3315
3315
|
})]
|
|
3316
3316
|
}),
|
|
3317
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ K("textarea", {
|
|
3318
3318
|
ref: b,
|
|
3319
3319
|
id: S,
|
|
3320
3320
|
disabled: o,
|
|
@@ -3328,23 +3328,23 @@ var Ir = {
|
|
|
3328
3328
|
},
|
|
3329
3329
|
"aria-invalid": C || void 0,
|
|
3330
3330
|
"aria-describedby": w,
|
|
3331
|
-
className:
|
|
3331
|
+
className: Y("w-full px-3 py-2.5 rounded-lg border bg-bg-default text-p-std text-fg-default placeholder:text-fg-tertiary outline-none transition-colors resize-y", C ? "border-red-600" : "border-border-default", !o && !C && "hover:border-border-strong", "focus:ring-2", C ? "focus:ring-red-300 focus:border-red-600" : "focus:ring-brand-300 focus:border-brand-500", o && "bg-bg-container border-border-default cursor-not-allowed", d),
|
|
3332
3332
|
...y
|
|
3333
3333
|
}),
|
|
3334
|
-
/* @__PURE__ */
|
|
3334
|
+
/* @__PURE__ */ q("div", {
|
|
3335
3335
|
className: "flex items-start justify-between gap-2",
|
|
3336
|
-
children: [/* @__PURE__ */
|
|
3336
|
+
children: [/* @__PURE__ */ K("div", {
|
|
3337
3337
|
className: "flex-1 min-w-0",
|
|
3338
|
-
children: r ? /* @__PURE__ */
|
|
3338
|
+
children: r ? /* @__PURE__ */ K("p", {
|
|
3339
3339
|
id: `${S}-error`,
|
|
3340
3340
|
className: "text-p-sm text-red-700",
|
|
3341
3341
|
children: r
|
|
3342
|
-
}) : n ? /* @__PURE__ */
|
|
3342
|
+
}) : n ? /* @__PURE__ */ K("p", {
|
|
3343
3343
|
id: `${S}-help`,
|
|
3344
3344
|
className: "text-p-sm text-fg-secondary",
|
|
3345
3345
|
children: n
|
|
3346
3346
|
}) : null
|
|
3347
|
-
}), E && /* @__PURE__ */
|
|
3347
|
+
}), E && /* @__PURE__ */ q("p", {
|
|
3348
3348
|
className: "text-p-sm text-fg-tertiary tabular-nums shrink-0",
|
|
3349
3349
|
children: [
|
|
3350
3350
|
k,
|
|
@@ -3355,16 +3355,16 @@ var Ir = {
|
|
|
3355
3355
|
})
|
|
3356
3356
|
]
|
|
3357
3357
|
});
|
|
3358
|
-
}),
|
|
3358
|
+
}), Gr = a(function({ checked: e, label: t, id: n, disabled: r, className: i, dataTestId: a, ...o }, s) {
|
|
3359
3359
|
let c = u(), l = n ?? c;
|
|
3360
|
-
return /* @__PURE__ */
|
|
3360
|
+
return /* @__PURE__ */ q("label", {
|
|
3361
3361
|
htmlFor: l,
|
|
3362
3362
|
"data-test-id": a,
|
|
3363
|
-
className:
|
|
3364
|
-
children: [/* @__PURE__ */
|
|
3363
|
+
className: Y("inline-flex items-center gap-3", r ? "cursor-not-allowed opacity-60" : "cursor-pointer", i),
|
|
3364
|
+
children: [/* @__PURE__ */ q("span", {
|
|
3365
3365
|
className: "relative inline-flex shrink-0",
|
|
3366
3366
|
children: [
|
|
3367
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ K("input", {
|
|
3368
3368
|
ref: s,
|
|
3369
3369
|
id: l,
|
|
3370
3370
|
type: "checkbox",
|
|
@@ -3375,40 +3375,40 @@ var Ir = {
|
|
|
3375
3375
|
className: "peer sr-only",
|
|
3376
3376
|
...o
|
|
3377
3377
|
}),
|
|
3378
|
-
/* @__PURE__ */
|
|
3379
|
-
className:
|
|
3380
|
-
children: [/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ q("span", {
|
|
3379
|
+
className: Y("inline-flex h-8 w-16 items-center justify-between rounded-full px-2 transition-colors", "bg-gray-200 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"),
|
|
3380
|
+
children: [/* @__PURE__ */ K(te, {
|
|
3381
3381
|
className: "size-4 text-yellow-500 z-1",
|
|
3382
3382
|
"aria-hidden": !0
|
|
3383
|
-
}), /* @__PURE__ */
|
|
3383
|
+
}), /* @__PURE__ */ K(F, {
|
|
3384
3384
|
className: "size-4 text-gray-400 z-1",
|
|
3385
3385
|
"aria-hidden": !0
|
|
3386
3386
|
})]
|
|
3387
3387
|
}),
|
|
3388
|
-
/* @__PURE__ */
|
|
3388
|
+
/* @__PURE__ */ K("span", {
|
|
3389
3389
|
"aria-hidden": !0,
|
|
3390
3390
|
className: "absolute left-1 top-1 size-6 rounded-full bg-white shadow-z1 transition-transform peer-checked:translate-x-8 peer-checked:bg-gray-600"
|
|
3391
3391
|
})
|
|
3392
3392
|
]
|
|
3393
|
-
}), t && /* @__PURE__ */
|
|
3393
|
+
}), t && /* @__PURE__ */ K("span", {
|
|
3394
3394
|
className: "text-p-std font-medium text-fg-default",
|
|
3395
3395
|
children: t
|
|
3396
3396
|
})]
|
|
3397
3397
|
});
|
|
3398
|
-
}),
|
|
3398
|
+
}), Kr = {
|
|
3399
3399
|
lg: "px-3 py-2 text-p-std",
|
|
3400
3400
|
sm: "px-2 py-1 text-p-sm"
|
|
3401
|
-
},
|
|
3401
|
+
}, qr = {
|
|
3402
3402
|
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
3403
3403
|
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
3404
3404
|
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
3405
3405
|
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
3406
|
-
},
|
|
3406
|
+
}, Jr = {
|
|
3407
3407
|
top: "top-full left-1/2 -translate-x-1/2 border-t-fg-default border-x-transparent border-b-transparent",
|
|
3408
3408
|
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-fg-default border-x-transparent border-t-transparent",
|
|
3409
3409
|
left: "left-full top-1/2 -translate-y-1/2 border-l-fg-default border-y-transparent border-r-transparent",
|
|
3410
3410
|
right: "right-full top-1/2 -translate-y-1/2 border-r-fg-default border-y-transparent border-l-transparent"
|
|
3411
|
-
},
|
|
3411
|
+
}, Yr = a(function({ content: e, children: t, side: r = "top", size: i = "sm", delay: a = 150, className: s, dataTestId: c }, l) {
|
|
3412
3412
|
let [d, f] = m(!1), h = p(null), g = u(), _ = () => {
|
|
3413
3413
|
h.current && clearTimeout(h.current), h.current = setTimeout(() => f(!0), a);
|
|
3414
3414
|
}, v = () => {
|
|
@@ -3416,7 +3416,7 @@ var Ir = {
|
|
|
3416
3416
|
};
|
|
3417
3417
|
if (!o(t)) return t;
|
|
3418
3418
|
let y = t.props ?? {};
|
|
3419
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ q("span", {
|
|
3420
3420
|
ref: l,
|
|
3421
3421
|
"data-test-id": c,
|
|
3422
3422
|
className: "relative inline-flex",
|
|
@@ -3426,43 +3426,43 @@ var Ir = {
|
|
|
3426
3426
|
onFocus: _,
|
|
3427
3427
|
onBlur: v,
|
|
3428
3428
|
"aria-describedby": d ? g : y["aria-describedby"]
|
|
3429
|
-
}), d && /* @__PURE__ */
|
|
3429
|
+
}), d && /* @__PURE__ */ q("span", {
|
|
3430
3430
|
role: "tooltip",
|
|
3431
3431
|
id: g,
|
|
3432
|
-
className:
|
|
3433
|
-
children: [e, /* @__PURE__ */
|
|
3432
|
+
className: Y("absolute z-50 whitespace-nowrap rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none", Kr[i], qr[r], s),
|
|
3433
|
+
children: [e, /* @__PURE__ */ K("span", {
|
|
3434
3434
|
"aria-hidden": !0,
|
|
3435
|
-
className:
|
|
3435
|
+
className: Y("absolute h-0 w-0 border-4", Jr[r])
|
|
3436
3436
|
})]
|
|
3437
3437
|
})]
|
|
3438
3438
|
});
|
|
3439
|
-
}),
|
|
3439
|
+
}), Xr = "We'll be back soon", Zr = "We're currently performing scheduled maintenance to make your experience even better. Please check back shortly.", Qr = {
|
|
3440
3440
|
lg: "xl",
|
|
3441
3441
|
sm: "lg"
|
|
3442
|
-
},
|
|
3443
|
-
return /* @__PURE__ */
|
|
3442
|
+
}, $r = a(function({ size: e = "lg", title: t, description: n, illustration: r, ...i }, a) {
|
|
3443
|
+
return /* @__PURE__ */ K(sn, {
|
|
3444
3444
|
ref: a,
|
|
3445
3445
|
size: e,
|
|
3446
|
-
title: t ??
|
|
3447
|
-
description: n ??
|
|
3448
|
-
illustration: r ?? /* @__PURE__ */
|
|
3446
|
+
title: t ?? Xr,
|
|
3447
|
+
description: n ?? Zr,
|
|
3448
|
+
illustration: r ?? /* @__PURE__ */ K(Qt, {
|
|
3449
3449
|
icon: O,
|
|
3450
3450
|
tone: "brand",
|
|
3451
3451
|
shape: "circle",
|
|
3452
|
-
size:
|
|
3452
|
+
size: Qr[e]
|
|
3453
3453
|
}),
|
|
3454
3454
|
...i
|
|
3455
3455
|
});
|
|
3456
3456
|
});
|
|
3457
3457
|
//#endregion
|
|
3458
3458
|
//#region src/components/Upload/Upload.tsx
|
|
3459
|
-
function
|
|
3459
|
+
function ei(e, t) {
|
|
3460
3460
|
let n = t.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
3461
3461
|
if (!n.length) return !0;
|
|
3462
3462
|
let r = e.name.toLowerCase(), i = e.type.toLowerCase();
|
|
3463
3463
|
return n.some((e) => e.endsWith("/*") ? i.startsWith(e.slice(0, -1)) : e.startsWith(".") ? r.endsWith(e) : i === e);
|
|
3464
3464
|
}
|
|
3465
|
-
var
|
|
3465
|
+
var ti = 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, mode: f = "dropzone", triggerLabel: h, triggerIcon: g, label: _, required: v, error: y = !1, errorText: b, labelAddons: x, className: S, dataTestId: C, ...w }, T) {
|
|
3466
3466
|
let E = p(null), [D, O] = m(!1), k = p(0), A = y || !!b, j = u(), M = b ? `${j}-error` : void 0, N = (t) => {
|
|
3467
3467
|
if (!t.length) return;
|
|
3468
3468
|
if (!o) {
|
|
@@ -3478,7 +3478,7 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3478
3478
|
});
|
|
3479
3479
|
continue;
|
|
3480
3480
|
}
|
|
3481
|
-
if (e && !
|
|
3481
|
+
if (e && !ei(i, e)) {
|
|
3482
3482
|
a.push({
|
|
3483
3483
|
file: i,
|
|
3484
3484
|
reason: "type"
|
|
@@ -3504,7 +3504,7 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3504
3504
|
r.length && i?.(r), a.length && d?.(a);
|
|
3505
3505
|
}, P = (e) => {
|
|
3506
3506
|
e.preventDefault(), k.current = 0, O(!1), !a && N(Array.from(e.dataTransfer.files ?? []));
|
|
3507
|
-
}, F = r ?? `${e ? e.toUpperCase().replace(/\./g, "") : "Any file"}${n ? `, up to ${n} MB` : ""}`, I = /* @__PURE__ */
|
|
3507
|
+
}, F = r ?? `${e ? e.toUpperCase().replace(/\./g, "") : "Any file"}${n ? `, up to ${n} MB` : ""}`, I = /* @__PURE__ */ K("input", {
|
|
3508
3508
|
ref: E,
|
|
3509
3509
|
type: "file",
|
|
3510
3510
|
accept: e,
|
|
@@ -3514,49 +3514,49 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3514
3514
|
N(Array.from(e.target.files ?? [])), e.target.value = "";
|
|
3515
3515
|
},
|
|
3516
3516
|
className: "sr-only"
|
|
3517
|
-
}), z = (_ || x) && /* @__PURE__ */
|
|
3517
|
+
}), z = (_ || x) && /* @__PURE__ */ q("div", {
|
|
3518
3518
|
className: "flex items-center gap-1.5",
|
|
3519
|
-
children: [_ && /* @__PURE__ */
|
|
3519
|
+
children: [_ && /* @__PURE__ */ q("span", {
|
|
3520
3520
|
className: "text-p-std font-medium text-fg-default inline-flex items-center gap-1",
|
|
3521
|
-
children: [_, v && /* @__PURE__ */
|
|
3521
|
+
children: [_, v && /* @__PURE__ */ K("span", {
|
|
3522
3522
|
className: "text-red-600",
|
|
3523
3523
|
"aria-hidden": !0,
|
|
3524
3524
|
children: "*"
|
|
3525
3525
|
})]
|
|
3526
|
-
}), x && /* @__PURE__ */
|
|
3526
|
+
}), x && /* @__PURE__ */ K("span", {
|
|
3527
3527
|
className: "inline-flex items-center gap-1",
|
|
3528
3528
|
children: x
|
|
3529
3529
|
})]
|
|
3530
|
-
}), ee = b ? /* @__PURE__ */
|
|
3530
|
+
}), ee = b ? /* @__PURE__ */ K("p", {
|
|
3531
3531
|
id: `${j}-error`,
|
|
3532
3532
|
className: "text-p-sm text-red-700",
|
|
3533
3533
|
children: b
|
|
3534
3534
|
}) : null;
|
|
3535
3535
|
if (f !== "dropzone") {
|
|
3536
3536
|
let e = f === "icon";
|
|
3537
|
-
return /* @__PURE__ */
|
|
3537
|
+
return /* @__PURE__ */ q("div", {
|
|
3538
3538
|
ref: T,
|
|
3539
3539
|
"data-test-id": C,
|
|
3540
|
-
className:
|
|
3540
|
+
className: Y("flex flex-col gap-1.5", S),
|
|
3541
3541
|
...w,
|
|
3542
3542
|
children: [
|
|
3543
3543
|
z,
|
|
3544
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ K(Ke, {
|
|
3545
3545
|
type: "button",
|
|
3546
3546
|
variant: "secondary",
|
|
3547
3547
|
iconOnly: e,
|
|
3548
3548
|
disabled: a,
|
|
3549
3549
|
onClick: () => E.current?.click(),
|
|
3550
|
-
leftIcon: e ? void 0 : g ?? /* @__PURE__ */
|
|
3550
|
+
leftIcon: e ? void 0 : g ?? /* @__PURE__ */ K(L, { className: "h-4 w-4" }),
|
|
3551
3551
|
"aria-label": e ? "Upload file" : void 0,
|
|
3552
|
-
children: e ? g ?? /* @__PURE__ */
|
|
3552
|
+
children: e ? g ?? /* @__PURE__ */ K(R, { className: "h-4 w-4" }) : h ?? "Choose a file"
|
|
3553
3553
|
}),
|
|
3554
3554
|
I,
|
|
3555
3555
|
ee
|
|
3556
3556
|
]
|
|
3557
3557
|
});
|
|
3558
3558
|
}
|
|
3559
|
-
let B = /* @__PURE__ */
|
|
3559
|
+
let B = /* @__PURE__ */ q("div", {
|
|
3560
3560
|
ref: T,
|
|
3561
3561
|
onDragEnter: () => {
|
|
3562
3562
|
k.current += 1, a || O(!0);
|
|
@@ -3576,22 +3576,22 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3576
3576
|
"aria-invalid": A || void 0,
|
|
3577
3577
|
"aria-describedby": M,
|
|
3578
3578
|
"data-test-id": C,
|
|
3579
|
-
className:
|
|
3579
|
+
className: Y("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", A ? "border-red-300 bg-bg-danger-lighter" : D ? "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", S),
|
|
3580
3580
|
...w,
|
|
3581
3581
|
children: [
|
|
3582
|
-
/* @__PURE__ */
|
|
3582
|
+
/* @__PURE__ */ K("div", {
|
|
3583
3583
|
className: "h-10 w-10 rounded-full bg-bg-default flex items-center justify-center text-fg-secondary shadow-z1",
|
|
3584
|
-
children: /* @__PURE__ */
|
|
3584
|
+
children: /* @__PURE__ */ K(re, { className: "h-5 w-5" })
|
|
3585
3585
|
}),
|
|
3586
|
-
/* @__PURE__ */
|
|
3586
|
+
/* @__PURE__ */ q("div", {
|
|
3587
3587
|
className: "flex flex-col gap-0.5",
|
|
3588
|
-
children: [/* @__PURE__ */
|
|
3588
|
+
children: [/* @__PURE__ */ q("p", {
|
|
3589
3589
|
className: "text-p-std text-fg-default",
|
|
3590
|
-
children: [/* @__PURE__ */
|
|
3590
|
+
children: [/* @__PURE__ */ K("span", {
|
|
3591
3591
|
className: "font-semibold text-brand-700",
|
|
3592
3592
|
children: "Choose a file"
|
|
3593
3593
|
}), " or drag & drop it here."]
|
|
3594
|
-
}), /* @__PURE__ */
|
|
3594
|
+
}), /* @__PURE__ */ K("p", {
|
|
3595
3595
|
className: "text-p-sm text-fg-tertiary",
|
|
3596
3596
|
children: F
|
|
3597
3597
|
})]
|
|
@@ -3599,7 +3599,7 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3599
3599
|
I
|
|
3600
3600
|
]
|
|
3601
3601
|
});
|
|
3602
|
-
return !z && !ee ? B : /* @__PURE__ */
|
|
3602
|
+
return !z && !ee ? B : /* @__PURE__ */ q("div", {
|
|
3603
3603
|
className: "flex flex-col gap-1.5",
|
|
3604
3604
|
children: [
|
|
3605
3605
|
z,
|
|
@@ -3607,60 +3607,60 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3607
3607
|
ee
|
|
3608
3608
|
]
|
|
3609
3609
|
});
|
|
3610
|
-
}),
|
|
3610
|
+
}), ni = {
|
|
3611
3611
|
processing: "border-border-default bg-bg-default",
|
|
3612
3612
|
completed: "border-border-default bg-bg-default",
|
|
3613
3613
|
error: "border-red-300 bg-bg-danger-lighter"
|
|
3614
|
-
},
|
|
3614
|
+
}, ri = a(function({ name: e, meta: t, status: n = "processing", progress: r = 0, errorText: i, onRetry: a, onRemove: o, previewSrc: s, className: c, dataTestId: l, ...u }, d) {
|
|
3615
3615
|
let [f, p] = m(!1), g = !!s && !f;
|
|
3616
|
-
return /* @__PURE__ */
|
|
3616
|
+
return /* @__PURE__ */ q("div", {
|
|
3617
3617
|
ref: d,
|
|
3618
3618
|
"data-test-id": l,
|
|
3619
|
-
className:
|
|
3619
|
+
className: Y("flex items-start gap-3 px-3 py-2.5 rounded-lg border", ni[n], c),
|
|
3620
3620
|
...u,
|
|
3621
3621
|
children: [
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
className:
|
|
3624
|
-
children: g ? /* @__PURE__ */
|
|
3622
|
+
/* @__PURE__ */ K("div", {
|
|
3623
|
+
className: Y("shrink-0 flex items-center justify-center h-9 w-9 rounded-md overflow-hidden", !g && (n === "error" ? "bg-red-100 dark:bg-red-900/30 text-red-700" : "bg-bg-subtle text-fg-secondary")),
|
|
3624
|
+
children: g ? /* @__PURE__ */ K("img", {
|
|
3625
3625
|
src: s,
|
|
3626
3626
|
alt: "",
|
|
3627
3627
|
className: "h-full w-full object-cover",
|
|
3628
3628
|
onError: () => p(!0)
|
|
3629
|
-
}) : /* @__PURE__ */
|
|
3629
|
+
}) : /* @__PURE__ */ K(A, { className: "h-4 w-4" })
|
|
3630
3630
|
}),
|
|
3631
|
-
/* @__PURE__ */
|
|
3631
|
+
/* @__PURE__ */ q("div", {
|
|
3632
3632
|
className: "flex-1 min-w-0",
|
|
3633
3633
|
children: [
|
|
3634
|
-
/* @__PURE__ */
|
|
3634
|
+
/* @__PURE__ */ q("div", {
|
|
3635
3635
|
className: "flex items-baseline justify-between gap-2",
|
|
3636
|
-
children: [/* @__PURE__ */
|
|
3636
|
+
children: [/* @__PURE__ */ K("p", {
|
|
3637
3637
|
className: "truncate text-p-std font-medium text-fg-default",
|
|
3638
3638
|
children: e
|
|
3639
|
-
}), /* @__PURE__ */
|
|
3639
|
+
}), /* @__PURE__ */ q("div", {
|
|
3640
3640
|
className: "flex items-center gap-1 shrink-0",
|
|
3641
|
-
children: [n === "completed" && /* @__PURE__ */
|
|
3641
|
+
children: [n === "completed" && /* @__PURE__ */ K(x, {
|
|
3642
3642
|
className: "h-4 w-4 text-green-600",
|
|
3643
3643
|
"aria-label": "Completed"
|
|
3644
|
-
}), n === "error" && /* @__PURE__ */
|
|
3644
|
+
}), n === "error" && /* @__PURE__ */ K(h, {
|
|
3645
3645
|
className: "h-4 w-4 text-red-600",
|
|
3646
3646
|
"aria-label": "Failed"
|
|
3647
3647
|
})]
|
|
3648
3648
|
})]
|
|
3649
3649
|
}),
|
|
3650
|
-
t && /* @__PURE__ */
|
|
3650
|
+
t && /* @__PURE__ */ K("p", {
|
|
3651
3651
|
className: "text-p-sm text-fg-tertiary mt-0.5",
|
|
3652
3652
|
children: t
|
|
3653
3653
|
}),
|
|
3654
|
-
n === "processing" && /* @__PURE__ */
|
|
3654
|
+
n === "processing" && /* @__PURE__ */ K("div", {
|
|
3655
3655
|
className: "mt-2 h-1 w-full rounded-full bg-bg-subtle overflow-hidden",
|
|
3656
|
-
children: /* @__PURE__ */
|
|
3656
|
+
children: /* @__PURE__ */ K("div", {
|
|
3657
3657
|
className: "h-full bg-brand-500 transition-[width] duration-200",
|
|
3658
3658
|
style: { width: `${Math.min(100, Math.max(0, r))}%` }
|
|
3659
3659
|
})
|
|
3660
3660
|
}),
|
|
3661
|
-
n === "error" && i && /* @__PURE__ */
|
|
3661
|
+
n === "error" && i && /* @__PURE__ */ q("p", {
|
|
3662
3662
|
className: "text-p-sm text-red-700 mt-1",
|
|
3663
|
-
children: [i, a && /* @__PURE__ */
|
|
3663
|
+
children: [i, a && /* @__PURE__ */ K("button", {
|
|
3664
3664
|
type: "button",
|
|
3665
3665
|
onClick: a,
|
|
3666
3666
|
className: "ml-2 underline font-medium hover:no-underline",
|
|
@@ -3669,24 +3669,24 @@ var Zr = a(function({ accept: e, multiple: t = !1, maxSizeMB: n, hint: r, onFile
|
|
|
3669
3669
|
})
|
|
3670
3670
|
]
|
|
3671
3671
|
}),
|
|
3672
|
-
o && /* @__PURE__ */
|
|
3672
|
+
o && /* @__PURE__ */ K("button", {
|
|
3673
3673
|
type: "button",
|
|
3674
3674
|
onClick: o,
|
|
3675
3675
|
"aria-label": "Remove",
|
|
3676
3676
|
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",
|
|
3677
|
-
children:
|
|
3677
|
+
children: K(n === "completed" ? ne : H, { className: "h-4 w-4" })
|
|
3678
3678
|
})
|
|
3679
3679
|
]
|
|
3680
3680
|
});
|
|
3681
3681
|
});
|
|
3682
3682
|
//#endregion
|
|
3683
3683
|
//#region src/hooks/useStepper.ts
|
|
3684
|
-
function
|
|
3684
|
+
function ii(e, t) {
|
|
3685
3685
|
return t <= 0 ? 0 : Math.min(Math.max(e, 0), t - 1);
|
|
3686
3686
|
}
|
|
3687
|
-
function
|
|
3688
|
-
let [a, o] = m(() =>
|
|
3689
|
-
let n =
|
|
3687
|
+
function ai({ count: e, initialStep: t = 0, step: n, onStepChange: r, loop: i = !1 }) {
|
|
3688
|
+
let [a, o] = m(() => ii(t, e)), s = n !== void 0, c = s ? ii(n, e) : a, l = (t) => {
|
|
3689
|
+
let n = ii(t, e);
|
|
3690
3690
|
s || o(n), r?.(n);
|
|
3691
3691
|
};
|
|
3692
3692
|
return {
|
|
@@ -3714,25 +3714,37 @@ function ti({ count: e, initialStep: t = 0, step: n, onStepChange: r, loop: i =
|
|
|
3714
3714
|
}
|
|
3715
3715
|
//#endregion
|
|
3716
3716
|
//#region src/hooks/useOnOutsideClick.ts
|
|
3717
|
-
|
|
3717
|
+
var Z = [];
|
|
3718
|
+
function oi(e) {
|
|
3719
|
+
let t = Z[Z.length - 1];
|
|
3720
|
+
if (!t) return;
|
|
3721
|
+
let { ref: n, callback: r, shouldRemoveCallback: i } = t;
|
|
3722
|
+
n && !n.contains(e.target) && (i && Z.splice(Z.length - 1, 1), r(e));
|
|
3723
|
+
}
|
|
3724
|
+
var si = (e, t, n, r, i = !0) => {
|
|
3718
3725
|
l(() => {
|
|
3719
|
-
if (
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
+
if (e && n && r) return Z.push({
|
|
3727
|
+
ref: e,
|
|
3728
|
+
callback: t,
|
|
3729
|
+
uid: r,
|
|
3730
|
+
shouldRemoveCallback: i
|
|
3731
|
+
}), Z.length === 1 && document.addEventListener("mousedown", oi), () => {
|
|
3732
|
+
Z.length === 0 && document.removeEventListener("mousedown", oi);
|
|
3726
3733
|
};
|
|
3727
3734
|
}, [
|
|
3728
3735
|
e,
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
])
|
|
3732
|
-
|
|
3736
|
+
n,
|
|
3737
|
+
r
|
|
3738
|
+
]), l(() => {
|
|
3739
|
+
if (!n && Z.length > 0) {
|
|
3740
|
+
let e = Z.findIndex((e) => e.uid === r);
|
|
3741
|
+
e >= 0 && Z.splice(e, 1);
|
|
3742
|
+
}
|
|
3743
|
+
}, [n]);
|
|
3744
|
+
};
|
|
3733
3745
|
//#endregion
|
|
3734
3746
|
//#region src/hooks/useEscapeKey.ts
|
|
3735
|
-
function
|
|
3747
|
+
function ci(e, t = !0) {
|
|
3736
3748
|
l(() => {
|
|
3737
3749
|
if (!t) return;
|
|
3738
3750
|
let n = (t) => {
|
|
@@ -3743,18 +3755,18 @@ function ri(e, t = !0) {
|
|
|
3743
3755
|
}
|
|
3744
3756
|
//#endregion
|
|
3745
3757
|
//#region src/hooks/useHideBodyScroll.ts
|
|
3746
|
-
var
|
|
3747
|
-
function
|
|
3758
|
+
var li = 0, ui = "";
|
|
3759
|
+
function di(e) {
|
|
3748
3760
|
l(() => {
|
|
3749
|
-
if (e) return
|
|
3750
|
-
--
|
|
3761
|
+
if (e) return li === 0 && (ui = document.body.style.overflow, document.body.style.overflow = "hidden"), li += 1, () => {
|
|
3762
|
+
--li, li === 0 && (document.body.style.overflow = ui);
|
|
3751
3763
|
};
|
|
3752
3764
|
}, [e]);
|
|
3753
3765
|
}
|
|
3754
3766
|
//#endregion
|
|
3755
3767
|
//#region src/hooks/useIsMobile.ts
|
|
3756
|
-
var
|
|
3757
|
-
function
|
|
3768
|
+
var fi = 768;
|
|
3769
|
+
function pi(e = fi) {
|
|
3758
3770
|
let [t, n] = m(!1);
|
|
3759
3771
|
return l(() => {
|
|
3760
3772
|
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
@@ -3764,14 +3776,14 @@ function ci(e = si) {
|
|
|
3764
3776
|
}
|
|
3765
3777
|
//#endregion
|
|
3766
3778
|
//#region src/hooks/useFormContext.ts
|
|
3767
|
-
function
|
|
3768
|
-
let e = c(
|
|
3779
|
+
function mi() {
|
|
3780
|
+
let e = c(dn);
|
|
3769
3781
|
if (!e) throw Error("useFormContext must be used inside a FormContainer.");
|
|
3770
3782
|
return e;
|
|
3771
3783
|
}
|
|
3772
3784
|
//#endregion
|
|
3773
3785
|
//#region src/hooks/useFormProps.ts
|
|
3774
|
-
var Q = (() => void 0),
|
|
3786
|
+
var Q = (() => void 0), hi = {
|
|
3775
3787
|
control: Q,
|
|
3776
3788
|
register: Q,
|
|
3777
3789
|
errors: {},
|
|
@@ -3791,12 +3803,12 @@ var Q = (() => void 0), ui = {
|
|
|
3791
3803
|
dirtyFields: {},
|
|
3792
3804
|
submit: Q
|
|
3793
3805
|
};
|
|
3794
|
-
function
|
|
3795
|
-
return c(
|
|
3806
|
+
function gi() {
|
|
3807
|
+
return c(dn) ?? hi;
|
|
3796
3808
|
}
|
|
3797
3809
|
//#endregion
|
|
3798
3810
|
//#region src/tokens/colors.ts
|
|
3799
|
-
var
|
|
3811
|
+
var _i = {
|
|
3800
3812
|
900: "#31531C",
|
|
3801
3813
|
800: "#416E26",
|
|
3802
3814
|
700: "#518A2F",
|
|
@@ -3822,7 +3834,7 @@ var fi = {
|
|
|
3822
3834
|
100: "#f2f5f8",
|
|
3823
3835
|
50: "#f5f7fa",
|
|
3824
3836
|
20: "#f7f9fc"
|
|
3825
|
-
},
|
|
3837
|
+
}, vi = "#FEFEFE", yi = {
|
|
3826
3838
|
900: "#0b4627",
|
|
3827
3839
|
800: "#0f5c33",
|
|
3828
3840
|
700: "#3D8B46",
|
|
@@ -3833,7 +3845,7 @@ var fi = {
|
|
|
3833
3845
|
200: "#aeeacb",
|
|
3834
3846
|
100: "#d0f5e1",
|
|
3835
3847
|
50: "#e0faec"
|
|
3836
|
-
},
|
|
3848
|
+
}, bi = {
|
|
3837
3849
|
900: "#2443B8",
|
|
3838
3850
|
800: "#2E63D6",
|
|
3839
3851
|
700: "#3475E8",
|
|
@@ -3844,7 +3856,7 @@ var fi = {
|
|
|
3844
3856
|
200: "#9ACAFA",
|
|
3845
3857
|
100: "#C1DEFC",
|
|
3846
3858
|
50: "#E6F2FE"
|
|
3847
|
-
},
|
|
3859
|
+
}, xi = {
|
|
3848
3860
|
900: "#081FA6",
|
|
3849
3861
|
800: "#0E2AB2",
|
|
3850
3862
|
700: "#2431B9",
|
|
@@ -3856,7 +3868,7 @@ var fi = {
|
|
|
3856
3868
|
100: "#CBC4ED",
|
|
3857
3869
|
50: "#EAE7F7",
|
|
3858
3870
|
20: "#F5F3FB"
|
|
3859
|
-
},
|
|
3871
|
+
}, Si = {
|
|
3860
3872
|
900: "#4A0A20",
|
|
3861
3873
|
800: "#79012F",
|
|
3862
3874
|
700: "#A2023F",
|
|
@@ -3867,7 +3879,7 @@ var fi = {
|
|
|
3867
3879
|
200: "#FE7DAF",
|
|
3868
3880
|
100: "#FEA8C9",
|
|
3869
3881
|
50: "#FFD4E4"
|
|
3870
|
-
},
|
|
3882
|
+
}, Ci = {
|
|
3871
3883
|
900: "#8b1822",
|
|
3872
3884
|
800: "#ad1f2b",
|
|
3873
3885
|
700: "#d02533",
|
|
@@ -3879,7 +3891,7 @@ var fi = {
|
|
|
3879
3891
|
100: "#ffd5d8",
|
|
3880
3892
|
50: "#ffebec",
|
|
3881
3893
|
20: "#fff4f4"
|
|
3882
|
-
},
|
|
3894
|
+
}, wi = {
|
|
3883
3895
|
900: "#EB7520",
|
|
3884
3896
|
800: "#ED912A",
|
|
3885
3897
|
700: "#EEA02F",
|
|
@@ -3890,47 +3902,47 @@ var fi = {
|
|
|
3890
3902
|
200: "#F7DE8E",
|
|
3891
3903
|
100: "#FAEBB9",
|
|
3892
3904
|
50: "#FDF7E4"
|
|
3893
|
-
},
|
|
3894
|
-
brand:
|
|
3905
|
+
}, Ti = {
|
|
3906
|
+
brand: _i,
|
|
3895
3907
|
gray: $,
|
|
3896
|
-
green:
|
|
3897
|
-
blue:
|
|
3898
|
-
purple:
|
|
3899
|
-
pink:
|
|
3900
|
-
red:
|
|
3901
|
-
yellow:
|
|
3902
|
-
},
|
|
3903
|
-
bgDefault:
|
|
3908
|
+
green: yi,
|
|
3909
|
+
blue: bi,
|
|
3910
|
+
purple: xi,
|
|
3911
|
+
pink: Si,
|
|
3912
|
+
red: Ci,
|
|
3913
|
+
yellow: wi
|
|
3914
|
+
}, Ei = {
|
|
3915
|
+
bgDefault: vi,
|
|
3904
3916
|
bgContainer: $[50],
|
|
3905
3917
|
bgSubtle: $[100],
|
|
3906
|
-
bgBrandLighter:
|
|
3907
|
-
bgInfoLighter:
|
|
3908
|
-
bgSuccessLighter:
|
|
3909
|
-
bgWarningLighter:
|
|
3910
|
-
bgDangerLighter:
|
|
3918
|
+
bgBrandLighter: _i[20],
|
|
3919
|
+
bgInfoLighter: bi[50],
|
|
3920
|
+
bgSuccessLighter: yi[50],
|
|
3921
|
+
bgWarningLighter: wi[50],
|
|
3922
|
+
bgDangerLighter: Ci[50],
|
|
3911
3923
|
fgDefault: $[900],
|
|
3912
3924
|
fgSecondary: $[600],
|
|
3913
3925
|
fgTertiary: $[500],
|
|
3914
3926
|
fgDisabled: $[400],
|
|
3915
|
-
fgInverse:
|
|
3916
|
-
fgBrand:
|
|
3917
|
-
fgInfo:
|
|
3918
|
-
fgSuccess:
|
|
3919
|
-
fgWarning:
|
|
3920
|
-
fgDanger:
|
|
3927
|
+
fgInverse: vi,
|
|
3928
|
+
fgBrand: _i[500],
|
|
3929
|
+
fgInfo: bi[600],
|
|
3930
|
+
fgSuccess: yi[600],
|
|
3931
|
+
fgWarning: wi[800],
|
|
3932
|
+
fgDanger: Ci[800],
|
|
3921
3933
|
borderDefault: $[200],
|
|
3922
3934
|
borderSubtle: $[100],
|
|
3923
3935
|
borderStrong: $[300],
|
|
3924
|
-
borderBrand:
|
|
3936
|
+
borderBrand: _i[500],
|
|
3925
3937
|
iconPrimary: $[900],
|
|
3926
3938
|
iconSecondary: $[600],
|
|
3927
|
-
iconInverse:
|
|
3928
|
-
iconBrand:
|
|
3929
|
-
iconInfo:
|
|
3930
|
-
iconDanger:
|
|
3931
|
-
iconWarning:
|
|
3932
|
-
},
|
|
3933
|
-
...
|
|
3939
|
+
iconInverse: vi,
|
|
3940
|
+
iconBrand: _i[500],
|
|
3941
|
+
iconInfo: bi[600],
|
|
3942
|
+
iconDanger: Ci[800],
|
|
3943
|
+
iconWarning: wi[800]
|
|
3944
|
+
}, Di = {
|
|
3945
|
+
...Ei,
|
|
3934
3946
|
bgDefault: "#0B1120",
|
|
3935
3947
|
bgContainer: "#0F172A",
|
|
3936
3948
|
bgSubtle: "#121C30",
|
|
@@ -3939,16 +3951,16 @@ var fi = {
|
|
|
3939
3951
|
bgSuccessLighter: "rgba(31, 193, 107, 0.15)",
|
|
3940
3952
|
bgWarningLighter: "rgba(237, 145, 42, 0.15)",
|
|
3941
3953
|
bgDangerLighter: "rgba(230, 27, 0, 0.15)",
|
|
3942
|
-
fgDefault:
|
|
3954
|
+
fgDefault: vi,
|
|
3943
3955
|
fgSecondary: $[400],
|
|
3944
3956
|
fgTertiary: $[500],
|
|
3945
3957
|
fgDisabled: $[600],
|
|
3946
3958
|
borderDefault: "rgba(255, 255, 255, 0.05)",
|
|
3947
3959
|
borderSubtle: "rgba(255, 255, 255, 0.03)",
|
|
3948
3960
|
borderStrong: "rgba(255, 255, 255, 0.10)",
|
|
3949
|
-
iconPrimary:
|
|
3961
|
+
iconPrimary: vi,
|
|
3950
3962
|
iconSecondary: $[400]
|
|
3951
|
-
},
|
|
3963
|
+
}, Oi = {
|
|
3952
3964
|
ps: [
|
|
3953
3965
|
"Noto Sans Armenian",
|
|
3954
3966
|
"Noto Sans",
|
|
@@ -3963,7 +3975,7 @@ var fi = {
|
|
|
3963
3975
|
"system-ui",
|
|
3964
3976
|
"sans-serif"
|
|
3965
3977
|
]
|
|
3966
|
-
},
|
|
3978
|
+
}, ki = {
|
|
3967
3979
|
xl: {
|
|
3968
3980
|
fontSize: "64px",
|
|
3969
3981
|
lineHeight: "72px"
|
|
@@ -3988,7 +4000,7 @@ var fi = {
|
|
|
3988
4000
|
fontSize: "24px",
|
|
3989
4001
|
lineHeight: "32px"
|
|
3990
4002
|
}
|
|
3991
|
-
},
|
|
4003
|
+
}, Ai = {
|
|
3992
4004
|
lg: {
|
|
3993
4005
|
fontSize: "20px",
|
|
3994
4006
|
lineHeight: "28px"
|
|
@@ -4009,7 +4021,7 @@ var fi = {
|
|
|
4009
4021
|
fontSize: "10px",
|
|
4010
4022
|
lineHeight: "14px"
|
|
4011
4023
|
}
|
|
4012
|
-
},
|
|
4024
|
+
}, ji = {
|
|
4013
4025
|
lg: {
|
|
4014
4026
|
fontSize: "20px",
|
|
4015
4027
|
lineHeight: "28px"
|
|
@@ -4034,19 +4046,19 @@ var fi = {
|
|
|
4034
4046
|
fontSize: "6px",
|
|
4035
4047
|
lineHeight: "6px"
|
|
4036
4048
|
}
|
|
4037
|
-
},
|
|
4038
|
-
headline:
|
|
4039
|
-
paragraph:
|
|
4040
|
-
label:
|
|
4041
|
-
},
|
|
4049
|
+
}, Mi = {
|
|
4050
|
+
headline: ki,
|
|
4051
|
+
paragraph: Ai,
|
|
4052
|
+
label: ji
|
|
4053
|
+
}, Ni = {
|
|
4042
4054
|
sm: "2rem",
|
|
4043
4055
|
md: "2.5rem",
|
|
4044
4056
|
lg: "3rem"
|
|
4045
|
-
},
|
|
4057
|
+
}, Pi = {
|
|
4046
4058
|
sm: "0.875rem",
|
|
4047
4059
|
md: "1rem",
|
|
4048
4060
|
lg: "1.25rem"
|
|
4049
|
-
},
|
|
4061
|
+
}, Fi = {
|
|
4050
4062
|
xs: "2px",
|
|
4051
4063
|
sm: "4px",
|
|
4052
4064
|
md: "8px",
|
|
@@ -4055,7 +4067,7 @@ var fi = {
|
|
|
4055
4067
|
"2xl": "20px",
|
|
4056
4068
|
"3xl": "24px",
|
|
4057
4069
|
full: "9999px"
|
|
4058
|
-
},
|
|
4070
|
+
}, Ii = {
|
|
4059
4071
|
z1: "0 1px 2px 0 rgba(0, 0, 0, 0.06)",
|
|
4060
4072
|
z2: "0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04)",
|
|
4061
4073
|
z3: "0 4px 8px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.04)",
|
|
@@ -4063,6 +4075,6 @@ var fi = {
|
|
|
4063
4075
|
z5: "0 8px 16px 0 rgba(0, 0, 0, 0.12), 0 24px 32px 0 rgba(0, 0, 0, 0.12)"
|
|
4064
4076
|
};
|
|
4065
4077
|
//#endregion
|
|
4066
|
-
export {
|
|
4078
|
+
export { be as Accordion, xe as AccordionItem, Oe as Avatar, ke as AvatarGroup, Re as Badge, Ve as Breadcrumb, Ke as Button, Je as ButtonGroup, Ze as Card, $e as CardGroup, nt as Checkbox, lt as Copy, gt as Counter, Pr as DataTable, Et as DatePicker, At as DistributionBar, he as Divider, Rt as Drawer, Kt as DropdownContent, qt as DropdownItem, Yt as DropdownLabel, Ut as DropdownMenu, Jt as DropdownSeparator, Wt as DropdownTrigger, sn as Empty, un as Filter, fn as FormContainer, pn as FormField, Qt as IconTile, mn as InfoField, gn as InlineAlert, mt as Input, _n as Link, yn as Modal, xn as MultiSelect, En as NotificationBadge, An as Pagination, Nn as PersonCard, ct as Popover, Rn as Progress, Un as Radio, Bn as RadioGroup, Wn as ReadMore, qn as Select, Xn as Sidebar, Zn as SidebarItem, tr as Skeleton, or as SnackbarProvider, ur as Status, Sr as StepIndicator, Tr as Switch, Ar as TBody, Nr as TD, Mr as TH, kr as THead, jr as TR, Hr as Tab, zr as TabList, Ur as TabPanel, Or as Table, Rr as Tabs, rn as Text, Wr as TextArea, Gr as ThemeSwitch, Yr as Tooltip, $r as UnderConstruction, ti as Upload, ri as UploadItem, bi as blue, _i as brand, Y as cn, Ti as colorPrimitives, Ni as controlHeight, Di as darkTheme, Oi as fontFamily, $ as gray, yi as green, ki as headline, Pi as iconSize, ji as label, Ei as lightTheme, Ai as paragraph, Si as pink, xi as purple, Fi as radius, Ci as red, Ii as shadows, Mi as typography, ci as useEscapeKey, ce as useFieldArray, mi as useFormContext, gi as useFormProps, di as useHideBodyScroll, pi as useIsMobile, si as useOnOutsideClick, ar as useSnackbar, ai as useStepper, vi as white, wi as yellow };
|
|
4067
4079
|
|
|
4068
4080
|
//# sourceMappingURL=index.js.map
|