@donkit-ai/design-system 1.4.12 → 1.4.13
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/index.cjs.js +3 -3
- package/dist/index.d.ts +8 -0
- package/dist/index.es.js +477 -470
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import K, { useState as
|
|
2
|
-
import { Check as Ne, X as
|
|
1
|
+
import K, { useState as D, useRef as E, useEffect as M, useLayoutEffect as Ve } from "react";
|
|
2
|
+
import { Check as Ne, X as re, ChevronDown as he, Minus as Ye, Plus as He, XCircle as we, AlertTriangle as ge, CheckCircle as ye, Info as ke, ChevronUp as qe, ChevronsUpDown as Ke, ChevronLeft as Xe, ChevronRight as Ge, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Re, Square as es, ArrowUp as ss, Zap as ts, Cpu as Se, FileText as ns, ThumbsUp as rs, ThumbsDown as as } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const I = {
|
|
5
5
|
1: 16,
|
|
@@ -8,7 +8,7 @@ const I = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var je = { exports: {} }, ue = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -18,27 +18,27 @@ var be = { exports: {} }, ue = {};
|
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
21
|
+
var De;
|
|
22
22
|
function is() {
|
|
23
|
-
if (
|
|
24
|
-
|
|
23
|
+
if (De) return ue;
|
|
24
|
+
De = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
26
|
-
function
|
|
26
|
+
function n(i, a, r) {
|
|
27
27
|
var o = null;
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (r !== void 0 && (o = "" + r), a.key !== void 0 && (o = "" + a.key), "key" in a) {
|
|
29
|
+
r = {};
|
|
30
30
|
for (var l in a)
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return a =
|
|
31
|
+
l !== "key" && (r[l] = a[l]);
|
|
32
|
+
} else r = a;
|
|
33
|
+
return a = r.ref, {
|
|
34
34
|
$$typeof: s,
|
|
35
35
|
type: i,
|
|
36
36
|
key: o,
|
|
37
37
|
ref: a !== void 0 ? a : null,
|
|
38
|
-
props:
|
|
38
|
+
props: r
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return ue.Fragment = t, ue.jsx =
|
|
41
|
+
return ue.Fragment = t, ue.jsx = n, ue.jsxs = n, ue;
|
|
42
42
|
}
|
|
43
43
|
var fe = {};
|
|
44
44
|
/**
|
|
@@ -50,9 +50,9 @@ var fe = {};
|
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
|
-
var
|
|
53
|
+
var Ae;
|
|
54
54
|
function os() {
|
|
55
|
-
return
|
|
55
|
+
return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function s(c) {
|
|
57
57
|
if (c == null) return null;
|
|
58
58
|
if (typeof c == "function")
|
|
@@ -65,7 +65,7 @@ function os() {
|
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case R:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case A:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case Y:
|
|
71
71
|
return "SuspenseList";
|
|
@@ -76,7 +76,7 @@ function os() {
|
|
|
76
76
|
switch (typeof c.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), c.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case b:
|
|
80
80
|
return "Portal";
|
|
81
81
|
case $:
|
|
82
82
|
return c.displayName || "Context";
|
|
@@ -99,7 +99,7 @@ function os() {
|
|
|
99
99
|
function t(c) {
|
|
100
100
|
return "" + c;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function n(c) {
|
|
103
103
|
try {
|
|
104
104
|
t(c);
|
|
105
105
|
var w = !1;
|
|
@@ -131,7 +131,7 @@ function os() {
|
|
|
131
131
|
var c = X.A;
|
|
132
132
|
return c === null ? null : c.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function r() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function o(c) {
|
|
@@ -223,7 +223,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
W
|
|
224
224
|
), g[W + F] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (W = null, z !== void 0 && (
|
|
226
|
+
if (W = null, z !== void 0 && (n(z), W = "" + z), o(w) && (n(w.key), W = "" + w.key), "key" in w) {
|
|
227
227
|
z = {};
|
|
228
228
|
for (var ie in w)
|
|
229
229
|
ie !== "key" && (z[ie] = w[ie]);
|
|
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
function h(c) {
|
|
247
247
|
return typeof c == "object" && c !== null && c.$$typeof === _;
|
|
248
248
|
}
|
|
249
|
-
var u = K, _ = Symbol.for("react.transitional.element"),
|
|
249
|
+
var u = K, _ = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), X = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, x = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
u = {
|
|
@@ -256,8 +256,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
256
256
|
};
|
|
257
257
|
var k, L = {}, H = u.react_stack_bottom_frame.bind(
|
|
258
258
|
u,
|
|
259
|
-
|
|
260
|
-
)(), G = v(i(
|
|
259
|
+
r
|
|
260
|
+
)(), G = v(i(r)), g = {};
|
|
261
261
|
fe.Fragment = S, fe.jsx = function(c, w, z) {
|
|
262
262
|
var F = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return f(
|
|
@@ -281,13 +281,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
281
281
|
};
|
|
282
282
|
}()), fe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
286
|
-
function ls({ size: s = "m", color: t = "default", className:
|
|
284
|
+
process.env.NODE_ENV === "production" ? je.exports = is() : je.exports = os();
|
|
285
|
+
var e = je.exports;
|
|
286
|
+
function ls({ size: s = "m", color: t = "default", className: n = "", ...i }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
290
|
-
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${t}`,
|
|
290
|
+
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${t}`, n].filter(Boolean).join(" "),
|
|
291
291
|
role: "status",
|
|
292
292
|
"aria-label": "Loading",
|
|
293
293
|
...i
|
|
@@ -298,10 +298,10 @@ const cs = { xs: 12, s: 14, m: 16, l: 20 };
|
|
|
298
298
|
function me({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
301
|
-
size:
|
|
301
|
+
size: n = "m",
|
|
302
302
|
fullWidth: i = !1,
|
|
303
303
|
icon: a,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: r = !1,
|
|
305
305
|
state: o = "idle",
|
|
306
306
|
onClick: l,
|
|
307
307
|
type: m = "button",
|
|
@@ -310,20 +310,20 @@ function me({
|
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const u = a && !s, _ = o === "loading",
|
|
313
|
+
const u = a && !s, _ = o === "loading", b = o === "success", S = o === "error", R = _ || b || S, B = n === "xs" ? "s" : "m", y = cs[n] ?? 16, $ = _ ? /* @__PURE__ */ e.jsx(ls, { size: B }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Ne, { size: y, strokeWidth: 2.5 }) }) : S ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(re, { size: y, strokeWidth: 2.5 }) }) : null, O = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
|
-
`ds-button--${
|
|
316
|
+
`ds-button--${n}`,
|
|
317
317
|
i && "ds-button--full",
|
|
318
318
|
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
320
|
+
].filter(Boolean).join(" "), A = o !== "idle" ? o : void 0, Y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
321
|
R ? $ : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
322
322
|
s
|
|
323
323
|
] });
|
|
324
324
|
if (d) {
|
|
325
325
|
const q = (P) => {
|
|
326
|
-
if (
|
|
326
|
+
if (r || _) {
|
|
327
327
|
P.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
@@ -333,12 +333,12 @@ function me({
|
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: O,
|
|
336
|
-
href:
|
|
336
|
+
href: r || _ ? void 0 : d,
|
|
337
337
|
onClick: q,
|
|
338
338
|
"aria-label": f,
|
|
339
|
-
"aria-disabled":
|
|
339
|
+
"aria-disabled": r || _ ? "true" : void 0,
|
|
340
340
|
"aria-busy": _ ? "true" : void 0,
|
|
341
|
-
"data-state":
|
|
341
|
+
"data-state": A,
|
|
342
342
|
...h,
|
|
343
343
|
children: Y
|
|
344
344
|
}
|
|
@@ -349,11 +349,11 @@ function me({
|
|
|
349
349
|
{
|
|
350
350
|
type: m,
|
|
351
351
|
className: O,
|
|
352
|
-
disabled:
|
|
352
|
+
disabled: r,
|
|
353
353
|
onClick: _ ? void 0 : l,
|
|
354
354
|
"aria-label": f,
|
|
355
355
|
"aria-busy": _ ? "true" : void 0,
|
|
356
|
-
"data-state":
|
|
356
|
+
"data-state": A,
|
|
357
357
|
...h,
|
|
358
358
|
children: Y
|
|
359
359
|
}
|
|
@@ -362,17 +362,17 @@ function me({
|
|
|
362
362
|
function Us({
|
|
363
363
|
label: s,
|
|
364
364
|
error: t,
|
|
365
|
-
hint:
|
|
365
|
+
hint: n,
|
|
366
366
|
fullWidth: i = !0,
|
|
367
367
|
icon: a,
|
|
368
|
-
iconRight:
|
|
368
|
+
iconRight: r,
|
|
369
369
|
onIconRightClick: o,
|
|
370
370
|
size: l = "m",
|
|
371
371
|
disabled: m,
|
|
372
372
|
id: d,
|
|
373
373
|
...f
|
|
374
374
|
}) {
|
|
375
|
-
const p = d || `input-${K.useId()}`, h =
|
|
375
|
+
const p = d || `input-${K.useId()}`, h = n ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, _ = u || h;
|
|
376
376
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
377
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
378
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -381,14 +381,14 @@ function Us({
|
|
|
381
381
|
"input",
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
|
-
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${
|
|
384
|
+
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${r ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
385
385
|
disabled: m,
|
|
386
386
|
"aria-invalid": t ? "true" : "false",
|
|
387
387
|
"aria-describedby": _,
|
|
388
388
|
...f
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
|
|
391
|
+
r && /* @__PURE__ */ e.jsx(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
@@ -396,59 +396,59 @@ function Us({
|
|
|
396
396
|
onClick: o,
|
|
397
397
|
tabIndex: -1,
|
|
398
398
|
"aria-label": "Toggle visibility",
|
|
399
|
-
children:
|
|
399
|
+
children: r
|
|
400
400
|
}
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
403
|
-
|
|
403
|
+
n && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: n }),
|
|
404
404
|
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: u, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
407
|
function Vs({
|
|
408
408
|
label: s,
|
|
409
409
|
error: t,
|
|
410
|
-
hint:
|
|
410
|
+
hint: n,
|
|
411
411
|
fullWidth: i = !0,
|
|
412
412
|
size: a = "m",
|
|
413
|
-
disabled:
|
|
413
|
+
disabled: r,
|
|
414
414
|
id: o,
|
|
415
415
|
resize: l = !0,
|
|
416
416
|
rows: m = 3,
|
|
417
417
|
...d
|
|
418
418
|
}) {
|
|
419
|
-
const f = o || `textarea-${K.useId()}`, p =
|
|
420
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${
|
|
419
|
+
const f = o || `textarea-${K.useId()}`, p = n ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, u = h || p;
|
|
420
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${r ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
421
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
423
423
|
"textarea",
|
|
424
424
|
{
|
|
425
425
|
id: f,
|
|
426
426
|
className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: r,
|
|
428
428
|
"aria-invalid": t ? "true" : "false",
|
|
429
429
|
"aria-describedby": u,
|
|
430
430
|
rows: m,
|
|
431
431
|
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
|
|
434
|
+
n && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: n }),
|
|
435
435
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
438
|
function Ys({
|
|
439
439
|
label: s,
|
|
440
440
|
value: t,
|
|
441
|
-
onChange:
|
|
441
|
+
onChange: n,
|
|
442
442
|
options: i = [],
|
|
443
443
|
placeholder: a = "Select option",
|
|
444
|
-
error:
|
|
444
|
+
error: r,
|
|
445
445
|
fullWidth: o = !0,
|
|
446
446
|
size: l = "m",
|
|
447
447
|
disabled: m = !1,
|
|
448
448
|
id: d,
|
|
449
449
|
...f
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] =
|
|
451
|
+
const [p, h] = D(!1), [u, _] = D(!1), [b, S] = D({}), [R, B] = D("down"), [y, $] = D(-1), O = E(null), A = E(null), Y = E(null), q = E(null), P = d || `select-${K.useId()}`, N = `${P}-label`, C = r ? `${P}-error` : void 0, X = 150, U = (g = !1) => {
|
|
452
452
|
u || (_(!0), $(-1), q.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
454
|
h(!1), _(!1), g && ((c = Y.current) == null || c.focus());
|
|
@@ -475,13 +475,13 @@ function Ys({
|
|
|
475
475
|
};
|
|
476
476
|
}, [p]), M(() => {
|
|
477
477
|
const g = (c) => {
|
|
478
|
-
O.current && !O.current.contains(c.target) &&
|
|
478
|
+
O.current && !O.current.contains(c.target) && A.current && !A.current.contains(c.target) && U();
|
|
479
479
|
};
|
|
480
480
|
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
481
481
|
}, [u]), M(() => {
|
|
482
482
|
var c;
|
|
483
|
-
if (!p || y < 0 || !
|
|
484
|
-
(c =
|
|
483
|
+
if (!p || y < 0 || !A.current) return;
|
|
484
|
+
(c = A.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [y, p]);
|
|
486
486
|
const k = (g) => {
|
|
487
487
|
switch (g.key) {
|
|
@@ -499,7 +499,7 @@ function Ys({
|
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
g.preventDefault(), p ? y >= 0 && (
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (n == null || n(i[y].value), U(!0)) : x();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
505
|
p && (g.preventDefault(), U(!0));
|
|
@@ -511,7 +511,7 @@ function Ys({
|
|
|
511
511
|
}, L = i.find((g) => g.value === t), H = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], G = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
|
-
ref:
|
|
514
|
+
ref: A,
|
|
515
515
|
role: "listbox",
|
|
516
516
|
"aria-labelledby": s ? N : void 0,
|
|
517
517
|
tabIndex: -1,
|
|
@@ -521,7 +521,7 @@ function Ys({
|
|
|
521
521
|
`ds-select-dropdown--${R}`,
|
|
522
522
|
u && "ds-select-dropdown--closing"
|
|
523
523
|
].filter(Boolean).join(" "),
|
|
524
|
-
style:
|
|
524
|
+
style: b,
|
|
525
525
|
children: i.map((g, c) => /* @__PURE__ */ e.jsx(
|
|
526
526
|
"button",
|
|
527
527
|
{
|
|
@@ -537,7 +537,7 @@ function Ys({
|
|
|
537
537
|
c === y && "ds-select-option--active"
|
|
538
538
|
].filter(Boolean).join(" "),
|
|
539
539
|
onClick: () => {
|
|
540
|
-
|
|
540
|
+
n == null || n(g.value), U(!0);
|
|
541
541
|
},
|
|
542
542
|
children: g.label
|
|
543
543
|
},
|
|
@@ -558,9 +558,9 @@ function Ys({
|
|
|
558
558
|
"aria-expanded": p,
|
|
559
559
|
"aria-activedescendant": p && y >= 0 ? `${P}-opt-${y}` : void 0,
|
|
560
560
|
"aria-labelledby": s ? N : void 0,
|
|
561
|
-
"aria-invalid":
|
|
561
|
+
"aria-invalid": r ? "true" : "false",
|
|
562
562
|
"aria-describedby": C,
|
|
563
|
-
className: `ds-select-trigger ds-select-trigger--${l} ${
|
|
563
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${r ? "ds-select-trigger--error" : ""}`,
|
|
564
564
|
onClick: () => {
|
|
565
565
|
m || (p ? U() : x());
|
|
566
566
|
},
|
|
@@ -581,17 +581,17 @@ function Ys({
|
|
|
581
581
|
]
|
|
582
582
|
}
|
|
583
583
|
) }),
|
|
584
|
-
|
|
584
|
+
r && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: r }),
|
|
585
585
|
typeof document < "u" && pe.createPortal(G, document.body)
|
|
586
586
|
] });
|
|
587
587
|
}
|
|
588
588
|
function Hs({
|
|
589
589
|
label: s,
|
|
590
590
|
value: t = 0,
|
|
591
|
-
onChange:
|
|
591
|
+
onChange: n,
|
|
592
592
|
min: i = 0,
|
|
593
593
|
max: a = 100,
|
|
594
|
-
step:
|
|
594
|
+
step: r = 1,
|
|
595
595
|
size: o = "m",
|
|
596
596
|
disabled: l = !1,
|
|
597
597
|
hint: m,
|
|
@@ -600,36 +600,36 @@ function Hs({
|
|
|
600
600
|
}) {
|
|
601
601
|
const p = () => {
|
|
602
602
|
if (l) return;
|
|
603
|
-
const R = Math.min(Number(t) +
|
|
604
|
-
|
|
603
|
+
const R = Math.min(Number(t) + r, a);
|
|
604
|
+
n == null || n(R);
|
|
605
605
|
}, h = () => {
|
|
606
606
|
if (l) return;
|
|
607
|
-
const R = Math.max(Number(t) -
|
|
608
|
-
|
|
607
|
+
const R = Math.max(Number(t) - r, i);
|
|
608
|
+
n == null || n(R);
|
|
609
609
|
}, u = (R) => {
|
|
610
610
|
if (l) return;
|
|
611
611
|
const B = R.target.value;
|
|
612
612
|
if (B === "") {
|
|
613
|
-
|
|
613
|
+
n == null || n(i);
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
616
|
const y = Number(B);
|
|
617
617
|
if (!isNaN(y)) {
|
|
618
618
|
const $ = Math.min(Math.max(y, i), a);
|
|
619
|
-
|
|
619
|
+
n == null || n($);
|
|
620
620
|
}
|
|
621
621
|
}, _ = [
|
|
622
622
|
"ds-stepper-wrapper",
|
|
623
623
|
l && "ds-stepper-wrapper--disabled",
|
|
624
624
|
d && "ds-stepper-wrapper--error"
|
|
625
|
-
].filter(Boolean).join(" "),
|
|
625
|
+
].filter(Boolean).join(" "), b = [
|
|
626
626
|
"ds-stepper",
|
|
627
627
|
`ds-stepper--${o}`,
|
|
628
628
|
l && "ds-stepper--disabled"
|
|
629
629
|
].filter(Boolean).join(" "), S = o === "xs" ? I[1] : o === "small" ? I[2] : I[3];
|
|
630
630
|
return /* @__PURE__ */ e.jsxs("div", { className: _, children: [
|
|
631
631
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
632
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
632
|
+
/* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
633
633
|
/* @__PURE__ */ e.jsx(
|
|
634
634
|
"button",
|
|
635
635
|
{
|
|
@@ -650,7 +650,7 @@ function Hs({
|
|
|
650
650
|
onChange: u,
|
|
651
651
|
min: i,
|
|
652
652
|
max: a,
|
|
653
|
-
step:
|
|
653
|
+
step: r,
|
|
654
654
|
disabled: l,
|
|
655
655
|
...f
|
|
656
656
|
}
|
|
@@ -674,20 +674,20 @@ function Hs({
|
|
|
674
674
|
function qs({
|
|
675
675
|
children: s,
|
|
676
676
|
padding: t = "m",
|
|
677
|
-
variant:
|
|
677
|
+
variant: n = "info",
|
|
678
678
|
hover: i = !1,
|
|
679
679
|
// deprecated, use variant="interactive"
|
|
680
680
|
onClick: a,
|
|
681
|
-
href:
|
|
681
|
+
href: r,
|
|
682
682
|
disabled: o = !1,
|
|
683
683
|
...l
|
|
684
684
|
}) {
|
|
685
|
-
const d = (i ? "interactive" :
|
|
685
|
+
const d = (i ? "interactive" : n) === "interactive" || a || r, f = [
|
|
686
686
|
"ds-card",
|
|
687
687
|
`ds-card--${t}`,
|
|
688
688
|
d && "ds-card--interactive"
|
|
689
689
|
].filter(Boolean).join(" ");
|
|
690
|
-
if (
|
|
690
|
+
if (r) {
|
|
691
691
|
const u = (_) => {
|
|
692
692
|
if (o) {
|
|
693
693
|
_.preventDefault();
|
|
@@ -699,7 +699,7 @@ function qs({
|
|
|
699
699
|
"a",
|
|
700
700
|
{
|
|
701
701
|
className: f,
|
|
702
|
-
href: o ? void 0 :
|
|
702
|
+
href: o ? void 0 : r,
|
|
703
703
|
onClick: u,
|
|
704
704
|
"aria-disabled": o ? "true" : void 0,
|
|
705
705
|
...l,
|
|
@@ -735,28 +735,28 @@ function Gs({ children: s, ...t }) {
|
|
|
735
735
|
function Js({ children: s, ...t }) {
|
|
736
736
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
737
737
|
}
|
|
738
|
-
function Zs({ children: s, secondary: t = !1, ...
|
|
739
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...
|
|
738
|
+
function Zs({ children: s, secondary: t = !1, ...n }) {
|
|
739
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...n, children: s });
|
|
740
740
|
}
|
|
741
|
-
function ds({ children: s, secondary: t = !1, ...
|
|
742
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...
|
|
741
|
+
function ds({ children: s, secondary: t = !1, ...n }) {
|
|
742
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...n, children: s });
|
|
743
743
|
}
|
|
744
|
-
function Fe({ children: s, secondary: t = !1, ...
|
|
745
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...
|
|
744
|
+
function Fe({ children: s, secondary: t = !1, ...n }) {
|
|
745
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...n, children: s });
|
|
746
746
|
}
|
|
747
747
|
function ce({
|
|
748
748
|
children: s,
|
|
749
749
|
variant: t = "default",
|
|
750
|
-
size:
|
|
750
|
+
size: n = "m",
|
|
751
751
|
role: i,
|
|
752
752
|
...a
|
|
753
753
|
}) {
|
|
754
|
-
const
|
|
754
|
+
const r = [
|
|
755
755
|
"ds-badge",
|
|
756
756
|
`ds-badge--${t}`,
|
|
757
|
-
`ds-badge--${
|
|
757
|
+
`ds-badge--${n}`
|
|
758
758
|
].filter(Boolean).join(" "), o = i || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
759
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
759
|
+
return /* @__PURE__ */ e.jsx("span", { className: r, role: o, ...a, children: s });
|
|
760
760
|
}
|
|
761
761
|
const us = {
|
|
762
762
|
info: ke,
|
|
@@ -767,16 +767,16 @@ const us = {
|
|
|
767
767
|
function Qs({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: t = "info",
|
|
770
|
-
title:
|
|
770
|
+
title: n,
|
|
771
771
|
onClose: i,
|
|
772
772
|
role: a,
|
|
773
|
-
...
|
|
773
|
+
...r
|
|
774
774
|
}) {
|
|
775
775
|
const o = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${n ? "" : "ds-alert--no-title"}`, role: l, ...r, children: [
|
|
777
777
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size: I[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
|
-
|
|
779
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: n }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
781
781
|
] }),
|
|
782
782
|
i && /* @__PURE__ */ e.jsx(
|
|
@@ -786,7 +786,7 @@ function Qs({
|
|
|
786
786
|
className: "ds-alert__close",
|
|
787
787
|
onClick: i,
|
|
788
788
|
"aria-label": "Close alert",
|
|
789
|
-
children: /* @__PURE__ */ e.jsx(
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[3], strokeWidth: 1.5 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
@@ -795,43 +795,43 @@ const fs = 200;
|
|
|
795
795
|
function et({
|
|
796
796
|
children: s,
|
|
797
797
|
title: t,
|
|
798
|
-
onClose:
|
|
798
|
+
onClose: n,
|
|
799
799
|
size: i = "m",
|
|
800
800
|
...a
|
|
801
801
|
}) {
|
|
802
|
-
const
|
|
803
|
-
!
|
|
804
|
-
m(!1),
|
|
802
|
+
const r = E(null), o = K.useId(), [l, m] = D(!1), d = () => {
|
|
803
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
804
|
+
m(!1), n();
|
|
805
805
|
}, fs));
|
|
806
806
|
};
|
|
807
807
|
M(() => {
|
|
808
|
-
const u = (
|
|
809
|
-
|
|
810
|
-
}, _ = (
|
|
811
|
-
|
|
808
|
+
const u = (b) => {
|
|
809
|
+
b.key === "Escape" && d();
|
|
810
|
+
}, _ = (b) => {
|
|
811
|
+
r.current && !r.current.contains(b.target) && d();
|
|
812
812
|
};
|
|
813
813
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", _), () => {
|
|
814
814
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", _);
|
|
815
815
|
};
|
|
816
|
-
}, [
|
|
816
|
+
}, [n, l]);
|
|
817
817
|
const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Ie), h = f.filter((u) => (u == null ? void 0 : u.type) !== Ie);
|
|
818
818
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", l && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...a, children: /* @__PURE__ */ e.jsxs(
|
|
819
819
|
"div",
|
|
820
820
|
{
|
|
821
821
|
className: `ds-modal ds-modal--${i}`,
|
|
822
|
-
ref:
|
|
822
|
+
ref: r,
|
|
823
823
|
role: "dialog",
|
|
824
824
|
"aria-modal": "true",
|
|
825
825
|
"aria-labelledby": t ? o : void 0,
|
|
826
826
|
children: [
|
|
827
|
-
(t ||
|
|
827
|
+
(t || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
828
828
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-modal__title", children: t }),
|
|
829
|
-
|
|
829
|
+
n && /* @__PURE__ */ e.jsx(
|
|
830
830
|
me,
|
|
831
831
|
{
|
|
832
832
|
variant: "ghost",
|
|
833
833
|
size: "small",
|
|
834
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
834
|
+
icon: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 }),
|
|
835
835
|
onClick: d,
|
|
836
836
|
"aria-label": "Close modal"
|
|
837
837
|
}
|
|
@@ -849,18 +849,18 @@ function Ie({ children: s }) {
|
|
|
849
849
|
function ms({
|
|
850
850
|
children: s,
|
|
851
851
|
title: t = "Code",
|
|
852
|
-
defaultExpanded:
|
|
852
|
+
defaultExpanded: n = !1,
|
|
853
853
|
expanded: i,
|
|
854
854
|
onToggle: a,
|
|
855
|
-
padding:
|
|
855
|
+
padding: r = "s",
|
|
856
856
|
className: o = "",
|
|
857
857
|
...l
|
|
858
858
|
}) {
|
|
859
|
-
const [m, d] =
|
|
859
|
+
const [m, d] = D(n), f = i !== void 0, p = f ? i : m, h = () => {
|
|
860
860
|
f ? a == null || a(!i) : d((_) => !_);
|
|
861
861
|
}, u = [
|
|
862
862
|
"ds-code-accordion",
|
|
863
|
-
`ds-code-accordion--${
|
|
863
|
+
`ds-code-accordion--${r}`,
|
|
864
864
|
p && "ds-code-accordion--expanded",
|
|
865
865
|
o
|
|
866
866
|
].filter(Boolean).join(" ");
|
|
@@ -888,28 +888,28 @@ function ms({
|
|
|
888
888
|
/* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__inner", children: /* @__PURE__ */ e.jsx("pre", { className: "ds-code-accordion__pre", children: /* @__PURE__ */ e.jsx("code", { children: s }) }) }) })
|
|
889
889
|
] });
|
|
890
890
|
}
|
|
891
|
-
function st({ children: s, block: t = !1, collapsible:
|
|
892
|
-
return t ?
|
|
891
|
+
function st({ children: s, block: t = !1, collapsible: n = !1, title: i = "Code", defaultExpanded: a = !1, ...r }) {
|
|
892
|
+
return t ? n ? /* @__PURE__ */ e.jsx(ms, { title: i, defaultExpanded: a, ...r, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block", ...r, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...r, children: s });
|
|
893
893
|
}
|
|
894
|
-
function tt({ href: s, children: t, onClick:
|
|
894
|
+
function tt({ href: s, children: t, onClick: n, target: i, rel: a, ...r }) {
|
|
895
895
|
const l = i === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
896
896
|
return /* @__PURE__ */ e.jsx(
|
|
897
897
|
"a",
|
|
898
898
|
{
|
|
899
899
|
href: s,
|
|
900
900
|
className: "ds-link",
|
|
901
|
-
onClick:
|
|
901
|
+
onClick: n,
|
|
902
902
|
target: i,
|
|
903
903
|
rel: l,
|
|
904
|
-
...
|
|
904
|
+
...r,
|
|
905
905
|
children: t
|
|
906
906
|
}
|
|
907
907
|
);
|
|
908
908
|
}
|
|
909
|
-
function
|
|
910
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant:
|
|
909
|
+
function nt({ children: s, size: t = "m", variant: n = "ghost", ...i }) {
|
|
910
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant: n }) : a) });
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant: a = "ghost", disabled: r = !1, icon: o, href: l, ...m }) {
|
|
913
913
|
const d = o && !s, f = [
|
|
914
914
|
"ds-tab",
|
|
915
915
|
`ds-tab--${i}`,
|
|
@@ -922,20 +922,20 @@ function nt({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
922
922
|
] });
|
|
923
923
|
if (l) {
|
|
924
924
|
const h = (u) => {
|
|
925
|
-
if (
|
|
925
|
+
if (r) {
|
|
926
926
|
u.preventDefault();
|
|
927
927
|
return;
|
|
928
928
|
}
|
|
929
|
-
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(),
|
|
929
|
+
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), n == null || n(u));
|
|
930
930
|
};
|
|
931
931
|
return /* @__PURE__ */ e.jsx(
|
|
932
932
|
"a",
|
|
933
933
|
{
|
|
934
934
|
role: "tab",
|
|
935
935
|
"aria-current": t ? "page" : void 0,
|
|
936
|
-
"aria-disabled":
|
|
936
|
+
"aria-disabled": r ? "true" : void 0,
|
|
937
937
|
className: f,
|
|
938
|
-
href:
|
|
938
|
+
href: r ? void 0 : l,
|
|
939
939
|
onClick: h,
|
|
940
940
|
...m,
|
|
941
941
|
children: p
|
|
@@ -948,24 +948,24 @@ function nt({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
948
948
|
role: "tab",
|
|
949
949
|
"aria-selected": t,
|
|
950
950
|
className: f,
|
|
951
|
-
onClick:
|
|
952
|
-
disabled:
|
|
951
|
+
onClick: n,
|
|
952
|
+
disabled: r,
|
|
953
953
|
...m,
|
|
954
954
|
children: p
|
|
955
955
|
}
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function at({ options: s, value: t, onChange:
|
|
959
|
-
const
|
|
960
|
-
if (!
|
|
961
|
-
const u =
|
|
958
|
+
function at({ options: s, value: t, onChange: n, size: i = "m", disabled: a = !1 }) {
|
|
959
|
+
const r = E(null), o = E(null), [l, m] = D(!1), d = E(!1), f = E(null), p = E(null), h = () => {
|
|
960
|
+
if (!r.current) return;
|
|
961
|
+
const u = r.current.querySelector(`[data-value="${t}"]`);
|
|
962
962
|
if (!u) return;
|
|
963
|
-
const _ =
|
|
963
|
+
const _ = r.current.getBoundingClientRect(), b = u.getBoundingClientRect(), S = b.left - _.left, R = b.width;
|
|
964
964
|
o.current ? (o.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = S + "px", o.current.style.width = R + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
965
|
-
if (!o.current || !
|
|
966
|
-
const B =
|
|
965
|
+
if (!o.current || !r.current) return;
|
|
966
|
+
const B = r.current.querySelector(`[data-value="${t}"]`);
|
|
967
967
|
if (!B) return;
|
|
968
|
-
const y =
|
|
968
|
+
const y = r.current.getBoundingClientRect(), $ = B.getBoundingClientRect();
|
|
969
969
|
o.current.style.transition = "none", o.current.style.left = $.left - y.left + "px", o.current.style.width = $.width + "px";
|
|
970
970
|
}));
|
|
971
971
|
};
|
|
@@ -973,11 +973,11 @@ function at({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
973
973
|
const u = f.current !== t;
|
|
974
974
|
f.current = t, d.current = l && u, h();
|
|
975
975
|
}), M(() => {
|
|
976
|
-
if (!
|
|
976
|
+
if (!r.current) return;
|
|
977
977
|
const u = new ResizeObserver(() => {
|
|
978
978
|
d.current = !1, p.current();
|
|
979
979
|
});
|
|
980
|
-
return u.observe(
|
|
980
|
+
return u.observe(r.current), () => u.disconnect();
|
|
981
981
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
982
982
|
"div",
|
|
983
983
|
{
|
|
@@ -986,7 +986,7 @@ function at({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
986
986
|
`ds-seg--${i}`,
|
|
987
987
|
a && "ds-seg--disabled"
|
|
988
988
|
].filter(Boolean).join(" "),
|
|
989
|
-
ref:
|
|
989
|
+
ref: r,
|
|
990
990
|
role: "group",
|
|
991
991
|
children: [
|
|
992
992
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -1003,7 +1003,7 @@ function at({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
1003
1003
|
type: "button",
|
|
1004
1004
|
"data-value": u.value,
|
|
1005
1005
|
className: ["ds-seg__btn", t === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1006
|
-
onClick: () => !a &&
|
|
1006
|
+
onClick: () => !a && n(u.value),
|
|
1007
1007
|
"aria-pressed": t === u.value,
|
|
1008
1008
|
disabled: a,
|
|
1009
1009
|
children: [
|
|
@@ -1020,17 +1020,17 @@ function at({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
1020
1020
|
function Ee({
|
|
1021
1021
|
children: s,
|
|
1022
1022
|
title: t,
|
|
1023
|
-
defaultExpanded:
|
|
1023
|
+
defaultExpanded: n = !1,
|
|
1024
1024
|
expanded: i,
|
|
1025
1025
|
onToggle: a,
|
|
1026
|
-
padding:
|
|
1026
|
+
padding: r = "m",
|
|
1027
1027
|
...o
|
|
1028
1028
|
}) {
|
|
1029
|
-
const [l, m] =
|
|
1029
|
+
const [l, m] = D(n), d = i !== void 0, f = d ? i : l, p = () => {
|
|
1030
1030
|
d ? a == null || a(!i) : m((u) => !u);
|
|
1031
1031
|
}, h = [
|
|
1032
1032
|
"ds-accordion",
|
|
1033
|
-
`ds-accordion--${
|
|
1033
|
+
`ds-accordion--${r}`,
|
|
1034
1034
|
f && "ds-accordion--expanded"
|
|
1035
1035
|
].filter(Boolean).join(" ");
|
|
1036
1036
|
return /* @__PURE__ */ e.jsxs("div", { className: h, ...o, children: [
|
|
@@ -1057,42 +1057,42 @@ function Ee({
|
|
|
1057
1057
|
/* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-inner", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-body", children: s }) }) })
|
|
1058
1058
|
] });
|
|
1059
1059
|
}
|
|
1060
|
-
const
|
|
1061
|
-
function ps(s, t,
|
|
1060
|
+
const ne = 8, le = 8;
|
|
1061
|
+
function ps(s, t, n) {
|
|
1062
1062
|
const i = window.innerWidth;
|
|
1063
|
-
let a,
|
|
1063
|
+
let a, r;
|
|
1064
1064
|
switch (s) {
|
|
1065
1065
|
case "top":
|
|
1066
|
-
a = t.top -
|
|
1066
|
+
a = t.top - n.height - ne, r = t.left + t.width / 2 - n.width / 2;
|
|
1067
1067
|
break;
|
|
1068
1068
|
case "bottom":
|
|
1069
|
-
a = t.bottom +
|
|
1069
|
+
a = t.bottom + ne, r = t.left + t.width / 2 - n.width / 2;
|
|
1070
1070
|
break;
|
|
1071
1071
|
case "left":
|
|
1072
|
-
a = t.top + t.height / 2 -
|
|
1072
|
+
a = t.top + t.height / 2 - n.height / 2, r = t.left - n.width - ne;
|
|
1073
1073
|
break;
|
|
1074
1074
|
case "right":
|
|
1075
|
-
a = t.top + t.height / 2 -
|
|
1075
|
+
a = t.top + t.height / 2 - n.height / 2, r = t.right + ne;
|
|
1076
1076
|
break;
|
|
1077
1077
|
default:
|
|
1078
|
-
a = t.bottom +
|
|
1078
|
+
a = t.bottom + ne, r = t.left;
|
|
1079
1079
|
}
|
|
1080
|
-
const o = Math.max(le, Math.min(i -
|
|
1080
|
+
const o = Math.max(le, Math.min(i - n.width - le, r)), l = r - o;
|
|
1081
1081
|
return { top: a, left: o, arrowOffset: l };
|
|
1082
1082
|
}
|
|
1083
|
-
function hs(s, t,
|
|
1083
|
+
function hs(s, t, n) {
|
|
1084
1084
|
const i = window.innerWidth, a = window.innerHeight;
|
|
1085
|
-
if (s.top >= t +
|
|
1086
|
-
if (a - s.bottom >= t +
|
|
1087
|
-
if (i - s.right >=
|
|
1088
|
-
if (s.left >=
|
|
1089
|
-
const
|
|
1090
|
-
return
|
|
1091
|
-
}
|
|
1092
|
-
function it({ children: s, content: t, position:
|
|
1093
|
-
const [a,
|
|
1085
|
+
if (s.top >= t + ne + le) return "top";
|
|
1086
|
+
if (a - s.bottom >= t + ne + le) return "bottom";
|
|
1087
|
+
if (i - s.right >= n + ne + le) return "right";
|
|
1088
|
+
if (s.left >= n + ne + le) return "left";
|
|
1089
|
+
const r = Math.max(s.top, a - s.bottom, s.left, i - s.right);
|
|
1090
|
+
return r === s.top ? "top" : r === a - s.bottom ? "bottom" : r === i - s.right ? "right" : "left";
|
|
1091
|
+
}
|
|
1092
|
+
function it({ children: s, content: t, position: n, ...i }) {
|
|
1093
|
+
const [a, r] = D(!1), [o, l] = D({ visibility: "hidden" }), [m, d] = D(n || "top"), f = E(null), p = E(null), h = E(!1), u = () => {
|
|
1094
1094
|
if (!f.current || !p.current) return;
|
|
1095
|
-
const
|
|
1095
|
+
const b = f.current.getBoundingClientRect(), S = p.current.getBoundingClientRect(), R = n || hs(b, S.height, S.width), { top: B, left: y, arrowOffset: $ } = ps(R, b, S);
|
|
1096
1096
|
d(R), l({
|
|
1097
1097
|
position: "fixed",
|
|
1098
1098
|
top: B,
|
|
@@ -1104,16 +1104,16 @@ function it({ children: s, content: t, position: r, ...i }) {
|
|
|
1104
1104
|
if (M(() => {
|
|
1105
1105
|
if (!a) return;
|
|
1106
1106
|
l({ position: "fixed", visibility: "hidden" });
|
|
1107
|
-
const
|
|
1107
|
+
const b = requestAnimationFrame(u);
|
|
1108
1108
|
return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1109
|
-
cancelAnimationFrame(
|
|
1109
|
+
cancelAnimationFrame(b), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1110
1110
|
};
|
|
1111
|
-
}, [a,
|
|
1111
|
+
}, [a, n]), M(() => {
|
|
1112
1112
|
if (!a) return;
|
|
1113
|
-
const
|
|
1114
|
-
f.current && !f.current.contains(S.target) &&
|
|
1113
|
+
const b = (S) => {
|
|
1114
|
+
f.current && !f.current.contains(S.target) && r(!1);
|
|
1115
1115
|
};
|
|
1116
|
-
return document.addEventListener("touchstart",
|
|
1116
|
+
return document.addEventListener("touchstart", b), () => document.removeEventListener("touchstart", b);
|
|
1117
1117
|
}, [a]), !t) return s;
|
|
1118
1118
|
const _ = a && /* @__PURE__ */ e.jsx(
|
|
1119
1119
|
"div",
|
|
@@ -1131,13 +1131,13 @@ function it({ children: s, content: t, position: r, ...i }) {
|
|
|
1131
1131
|
ref: f,
|
|
1132
1132
|
className: "ds-tooltip-wrapper",
|
|
1133
1133
|
onMouseEnter: () => {
|
|
1134
|
-
h.current ||
|
|
1134
|
+
h.current || r(!0);
|
|
1135
1135
|
},
|
|
1136
1136
|
onMouseLeave: () => {
|
|
1137
|
-
h.current ||
|
|
1137
|
+
h.current || r(!1);
|
|
1138
1138
|
},
|
|
1139
1139
|
onTouchStart: () => {
|
|
1140
|
-
h.current = !0,
|
|
1140
|
+
h.current = !0, r((b) => !b);
|
|
1141
1141
|
},
|
|
1142
1142
|
...i,
|
|
1143
1143
|
children: [
|
|
@@ -1150,15 +1150,15 @@ function it({ children: s, content: t, position: r, ...i }) {
|
|
|
1150
1150
|
function ot({
|
|
1151
1151
|
checked: s = !1,
|
|
1152
1152
|
onChange: t,
|
|
1153
|
-
size:
|
|
1153
|
+
size: n = "m",
|
|
1154
1154
|
disabled: i = !1,
|
|
1155
1155
|
label: a,
|
|
1156
|
-
id:
|
|
1156
|
+
id: r,
|
|
1157
1157
|
...o
|
|
1158
1158
|
}) {
|
|
1159
|
-
const l =
|
|
1159
|
+
const l = r || `toggle-${K.useId()}`, m = [
|
|
1160
1160
|
"ds-toggle",
|
|
1161
|
-
`ds-toggle--${
|
|
1161
|
+
`ds-toggle--${n}`,
|
|
1162
1162
|
i && "ds-toggle--disabled"
|
|
1163
1163
|
].filter(Boolean).join(" ");
|
|
1164
1164
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
@@ -1181,17 +1181,17 @@ function ot({
|
|
|
1181
1181
|
function lt({
|
|
1182
1182
|
checked: s = !1,
|
|
1183
1183
|
onChange: t,
|
|
1184
|
-
size:
|
|
1184
|
+
size: n = "m",
|
|
1185
1185
|
disabled: i = !1,
|
|
1186
1186
|
label: a,
|
|
1187
|
-
id:
|
|
1187
|
+
id: r,
|
|
1188
1188
|
...o
|
|
1189
1189
|
}) {
|
|
1190
|
-
const l =
|
|
1190
|
+
const l = r || `checkbox-${K.useId()}`, m = [
|
|
1191
1191
|
"ds-checkbox",
|
|
1192
|
-
`ds-checkbox--${
|
|
1192
|
+
`ds-checkbox--${n}`,
|
|
1193
1193
|
i && "ds-checkbox--disabled"
|
|
1194
|
-
].filter(Boolean).join(" "), d =
|
|
1194
|
+
].filter(Boolean).join(" "), d = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1195
1195
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1196
1196
|
/* @__PURE__ */ e.jsx(
|
|
1197
1197
|
"input",
|
|
@@ -1219,17 +1219,17 @@ function lt({
|
|
|
1219
1219
|
function ct({
|
|
1220
1220
|
checked: s = !1,
|
|
1221
1221
|
onChange: t,
|
|
1222
|
-
size:
|
|
1222
|
+
size: n = "m",
|
|
1223
1223
|
disabled: i = !1,
|
|
1224
1224
|
label: a,
|
|
1225
|
-
name:
|
|
1225
|
+
name: r,
|
|
1226
1226
|
value: o,
|
|
1227
1227
|
id: l,
|
|
1228
1228
|
...m
|
|
1229
1229
|
}) {
|
|
1230
1230
|
const d = l || `radio-${K.useId()}`, f = [
|
|
1231
1231
|
"ds-radio",
|
|
1232
|
-
`ds-radio--${
|
|
1232
|
+
`ds-radio--${n}`,
|
|
1233
1233
|
i && "ds-radio--disabled"
|
|
1234
1234
|
].filter(Boolean).join(" ");
|
|
1235
1235
|
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: d, children: [
|
|
@@ -1242,7 +1242,7 @@ function ct({
|
|
|
1242
1242
|
checked: s,
|
|
1243
1243
|
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1244
1244
|
disabled: i,
|
|
1245
|
-
name:
|
|
1245
|
+
name: r,
|
|
1246
1246
|
value: o,
|
|
1247
1247
|
...m
|
|
1248
1248
|
}
|
|
@@ -1251,25 +1251,25 @@ function ct({
|
|
|
1251
1251
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1252
1252
|
] });
|
|
1253
1253
|
}
|
|
1254
|
-
function xs({ width: s, height: t, shape:
|
|
1254
|
+
function xs({ width: s, height: t, shape: n = "rect", aspectRatio: i, className: a = "", style: r = {}, ...o }) {
|
|
1255
1255
|
return /* @__PURE__ */ e.jsx(
|
|
1256
1256
|
"span",
|
|
1257
1257
|
{
|
|
1258
|
-
className: ["ds-skeleton", `ds-skeleton--${
|
|
1259
|
-
style: { width: s, height: t, aspectRatio: i, ...
|
|
1258
|
+
className: ["ds-skeleton", `ds-skeleton--${n}`, a].filter(Boolean).join(" "),
|
|
1259
|
+
style: { width: s, height: t, aspectRatio: i, ...r },
|
|
1260
1260
|
"aria-hidden": "true",
|
|
1261
1261
|
...o
|
|
1262
1262
|
}
|
|
1263
1263
|
);
|
|
1264
1264
|
}
|
|
1265
|
-
function _s({ lines: s = 1, lastLineWidth: t = "70%", gap:
|
|
1265
|
+
function _s({ lines: s = 1, lastLineWidth: t = "70%", gap: n, className: i = "", style: a = {}, ...r }) {
|
|
1266
1266
|
return /* @__PURE__ */ e.jsx(
|
|
1267
1267
|
"span",
|
|
1268
1268
|
{
|
|
1269
1269
|
className: ["ds-skeleton-text", i].filter(Boolean).join(" "),
|
|
1270
|
-
style: { gap:
|
|
1270
|
+
style: { gap: n, ...a },
|
|
1271
1271
|
"aria-hidden": "true",
|
|
1272
|
-
...
|
|
1272
|
+
...r,
|
|
1273
1273
|
children: Array.from({ length: s }, (o, l) => /* @__PURE__ */ e.jsx(
|
|
1274
1274
|
"span",
|
|
1275
1275
|
{
|
|
@@ -1282,43 +1282,43 @@ function _s({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "",
|
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
1284
|
xs.Text = _s;
|
|
1285
|
-
function
|
|
1285
|
+
function js(s) {
|
|
1286
1286
|
let t = 2166136261;
|
|
1287
|
-
for (let
|
|
1288
|
-
t ^= s.charCodeAt(
|
|
1287
|
+
for (let n = 0; n < s.length; n++)
|
|
1288
|
+
t ^= s.charCodeAt(n), t = Math.imul(t, 16777619) >>> 0;
|
|
1289
1289
|
return t % 360;
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function bs(s) {
|
|
1292
1292
|
if (!s) return "";
|
|
1293
1293
|
const t = s.trim().split(/\s+/);
|
|
1294
1294
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1295
1295
|
}
|
|
1296
|
-
function dt({ seed: s, icon: t, src:
|
|
1297
|
-
const l =
|
|
1296
|
+
function dt({ seed: s, icon: t, src: n, size: i = 32, className: a = "", style: r = {}, ...o }) {
|
|
1297
|
+
const l = js(s ?? ""), [m, d] = D(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: bs(s) });
|
|
1298
1298
|
return /* @__PURE__ */ e.jsx(
|
|
1299
1299
|
"div",
|
|
1300
1300
|
{
|
|
1301
1301
|
className: ["ds-avatar", a].filter(Boolean).join(" "),
|
|
1302
|
-
style: { width: i, height: i, "--ds-avatar-h": l, ...
|
|
1302
|
+
style: { width: i, height: i, "--ds-avatar-h": l, ...r },
|
|
1303
1303
|
"aria-hidden": "true",
|
|
1304
1304
|
...o,
|
|
1305
|
-
children:
|
|
1305
|
+
children: n && !m ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => d(!0) }) : f
|
|
1306
1306
|
}
|
|
1307
1307
|
);
|
|
1308
1308
|
}
|
|
1309
1309
|
function ut({
|
|
1310
1310
|
children: s,
|
|
1311
1311
|
size: t = "compact",
|
|
1312
|
-
stickyTop:
|
|
1312
|
+
stickyTop: n,
|
|
1313
1313
|
maxHeight: i,
|
|
1314
1314
|
className: a = "",
|
|
1315
|
-
style:
|
|
1315
|
+
style: r = {},
|
|
1316
1316
|
...o
|
|
1317
1317
|
}) {
|
|
1318
1318
|
const l = {
|
|
1319
1319
|
...i ? { maxHeight: i } : {},
|
|
1320
|
-
...
|
|
1321
|
-
...
|
|
1320
|
+
...n !== void 0 ? { "--ds-table-sticky-top": typeof n == "number" ? `${n}px` : n } : {},
|
|
1321
|
+
...r
|
|
1322
1322
|
};
|
|
1323
1323
|
return /* @__PURE__ */ e.jsx(
|
|
1324
1324
|
"div",
|
|
@@ -1342,17 +1342,17 @@ function ft({ children: s, ...t }) {
|
|
|
1342
1342
|
function mt({ children: s, ...t }) {
|
|
1343
1343
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1344
1344
|
}
|
|
1345
|
-
function pt({ children: s, interactive: t, selected:
|
|
1345
|
+
function pt({ children: s, interactive: t, selected: n, subheader: i, exiting: a, updated: r, className: o = "", onClick: l, ...m }) {
|
|
1346
1346
|
return /* @__PURE__ */ e.jsx(
|
|
1347
1347
|
"tr",
|
|
1348
1348
|
{
|
|
1349
1349
|
className: [
|
|
1350
1350
|
"ds-table-row",
|
|
1351
1351
|
t || l ? "ds-table-row--interactive" : "",
|
|
1352
|
-
|
|
1352
|
+
n ? "ds-table-row--selected" : "",
|
|
1353
1353
|
i ? "ds-table-row--subheader" : "",
|
|
1354
1354
|
a ? "ds-table-row--exiting" : "",
|
|
1355
|
-
|
|
1355
|
+
r ? "ds-table-row--updated" : "",
|
|
1356
1356
|
o
|
|
1357
1357
|
].filter(Boolean).join(" "),
|
|
1358
1358
|
onClick: l,
|
|
@@ -1361,20 +1361,20 @@ function pt({ children: s, interactive: t, selected: r, subheader: i, exiting: a
|
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
1363
|
}
|
|
1364
|
-
function ht({ children: s, colSpan: t = 999, ...
|
|
1365
|
-
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...
|
|
1364
|
+
function ht({ children: s, colSpan: t = 999, ...n }) {
|
|
1365
|
+
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1366
1366
|
}
|
|
1367
|
-
function xt({ children: s, align: t = "left", sortDir:
|
|
1368
|
-
const m = !!i ||
|
|
1367
|
+
function xt({ children: s, align: t = "left", sortDir: n, onSort: i, width: a, className: r = "", style: o = {}, ...l }) {
|
|
1368
|
+
const m = !!i || n !== void 0, d = n === "asc" ? qe : n === "desc" ? he : Ke;
|
|
1369
1369
|
return /* @__PURE__ */ e.jsx(
|
|
1370
1370
|
"th",
|
|
1371
1371
|
{
|
|
1372
1372
|
className: [
|
|
1373
1373
|
"ds-th",
|
|
1374
1374
|
m ? "ds-th--sortable" : "",
|
|
1375
|
-
|
|
1375
|
+
n ? "ds-th--sorted" : "",
|
|
1376
1376
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1377
|
-
|
|
1377
|
+
r
|
|
1378
1378
|
].filter(Boolean).join(" "),
|
|
1379
1379
|
onClick: i,
|
|
1380
1380
|
style: { width: a, ...o },
|
|
@@ -1386,17 +1386,17 @@ function xt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
|
|
|
1386
1386
|
}
|
|
1387
1387
|
);
|
|
1388
1388
|
}
|
|
1389
|
-
function _t({ children: s, align: t = "left", secondary:
|
|
1389
|
+
function _t({ children: s, align: t = "left", secondary: n, muted: i, truncate: a, nowrap: r, className: o = "", ...l }) {
|
|
1390
1390
|
return /* @__PURE__ */ e.jsx(
|
|
1391
1391
|
"td",
|
|
1392
1392
|
{
|
|
1393
1393
|
className: [
|
|
1394
1394
|
"ds-td",
|
|
1395
1395
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1396
|
-
|
|
1396
|
+
n ? "ds-table-cell--secondary" : "",
|
|
1397
1397
|
i ? "ds-table-cell--muted" : "",
|
|
1398
1398
|
a ? "ds-table-cell--truncate" : "",
|
|
1399
|
-
|
|
1399
|
+
r ? "ds-table-cell--nowrap" : "",
|
|
1400
1400
|
o
|
|
1401
1401
|
].filter(Boolean).join(" "),
|
|
1402
1402
|
...l,
|
|
@@ -1404,47 +1404,47 @@ function _t({ children: s, align: t = "left", secondary: r, muted: i, truncate:
|
|
|
1404
1404
|
}
|
|
1405
1405
|
);
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function jt({
|
|
1408
1408
|
icon: s,
|
|
1409
1409
|
title: t,
|
|
1410
|
-
description:
|
|
1410
|
+
description: n,
|
|
1411
1411
|
action: i,
|
|
1412
1412
|
size: a = "m",
|
|
1413
|
-
className:
|
|
1413
|
+
className: r = "",
|
|
1414
1414
|
...o
|
|
1415
1415
|
}) {
|
|
1416
1416
|
return /* @__PURE__ */ e.jsxs(
|
|
1417
1417
|
"div",
|
|
1418
1418
|
{
|
|
1419
|
-
className: ["ds-empty-state", `ds-empty-state--${a}`,
|
|
1419
|
+
className: ["ds-empty-state", `ds-empty-state--${a}`, r].filter(Boolean).join(" "),
|
|
1420
1420
|
...o,
|
|
1421
1421
|
children: [
|
|
1422
1422
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1423
1423
|
/* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__title", children: t }),
|
|
1424
|
-
|
|
1424
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__description", children: n }),
|
|
1425
1425
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__action", children: i })
|
|
1426
1426
|
]
|
|
1427
1427
|
}
|
|
1428
1428
|
);
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function bt({
|
|
1431
1431
|
label: s,
|
|
1432
1432
|
hint: t,
|
|
1433
|
-
error:
|
|
1433
|
+
error: n,
|
|
1434
1434
|
required: i = !1,
|
|
1435
1435
|
disabled: a = !1,
|
|
1436
|
-
htmlFor:
|
|
1436
|
+
htmlFor: r,
|
|
1437
1437
|
children: o,
|
|
1438
1438
|
className: l = "",
|
|
1439
1439
|
style: m,
|
|
1440
1440
|
...d
|
|
1441
1441
|
}) {
|
|
1442
|
-
const f = K.useId(), p =
|
|
1442
|
+
const f = K.useId(), p = r ?? f, h = `${p}-hint`, u = `${p}-error`;
|
|
1443
1443
|
return /* @__PURE__ */ e.jsxs(
|
|
1444
1444
|
"div",
|
|
1445
1445
|
{
|
|
1446
1446
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1447
|
-
"data-state":
|
|
1447
|
+
"data-state": n ? "error" : void 0,
|
|
1448
1448
|
"data-required": i ? "" : void 0,
|
|
1449
1449
|
"data-disabled": a ? "" : void 0,
|
|
1450
1450
|
style: m,
|
|
@@ -1452,14 +1452,14 @@ function jt({
|
|
|
1452
1452
|
children: [
|
|
1453
1453
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1454
1454
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
|
|
1455
|
-
t && !
|
|
1456
|
-
|
|
1455
|
+
t && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1456
|
+
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: n })
|
|
1457
1457
|
]
|
|
1458
1458
|
}
|
|
1459
1459
|
);
|
|
1460
1460
|
}
|
|
1461
|
-
function vt({ label: s, value: t, delta:
|
|
1462
|
-
const m =
|
|
1461
|
+
function vt({ label: s, value: t, delta: n, size: i = "m", inline: a = !1, className: r = "", style: o, ...l }) {
|
|
1462
|
+
const m = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1463
1463
|
return /* @__PURE__ */ e.jsxs(
|
|
1464
1464
|
"div",
|
|
1465
1465
|
{
|
|
@@ -1467,14 +1467,14 @@ function vt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
|
|
|
1467
1467
|
"ds-stat",
|
|
1468
1468
|
`ds-stat--${i}`,
|
|
1469
1469
|
a && "ds-stat--inline",
|
|
1470
|
-
|
|
1470
|
+
r
|
|
1471
1471
|
].filter(Boolean).join(" "),
|
|
1472
1472
|
style: o,
|
|
1473
1473
|
...l,
|
|
1474
1474
|
children: [
|
|
1475
1475
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1476
1476
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1477
|
-
|
|
1477
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: n })
|
|
1478
1478
|
]
|
|
1479
1479
|
}
|
|
1480
1480
|
);
|
|
@@ -1482,19 +1482,19 @@ function vt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
|
|
|
1482
1482
|
function Nt({
|
|
1483
1483
|
children: s,
|
|
1484
1484
|
separator: t = "/",
|
|
1485
|
-
"aria-label":
|
|
1485
|
+
"aria-label": n = "Breadcrumb",
|
|
1486
1486
|
className: i = "",
|
|
1487
1487
|
style: a,
|
|
1488
|
-
...
|
|
1488
|
+
...r
|
|
1489
1489
|
}) {
|
|
1490
1490
|
const o = K.Children.toArray(s).filter(Boolean);
|
|
1491
1491
|
return /* @__PURE__ */ e.jsx(
|
|
1492
1492
|
"nav",
|
|
1493
1493
|
{
|
|
1494
1494
|
className: `ds-breadcrumb${i ? ` ${i}` : ""}`,
|
|
1495
|
-
"aria-label":
|
|
1495
|
+
"aria-label": n,
|
|
1496
1496
|
style: a,
|
|
1497
|
-
...
|
|
1497
|
+
...r,
|
|
1498
1498
|
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1499
1499
|
l,
|
|
1500
1500
|
m < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
@@ -1505,10 +1505,10 @@ function Nt({
|
|
|
1505
1505
|
function wt({
|
|
1506
1506
|
page: s,
|
|
1507
1507
|
total: t,
|
|
1508
|
-
onChange:
|
|
1508
|
+
onChange: n,
|
|
1509
1509
|
siblings: i = 1,
|
|
1510
1510
|
"aria-label": a = "Pagination",
|
|
1511
|
-
className:
|
|
1511
|
+
className: r = "",
|
|
1512
1512
|
style: o,
|
|
1513
1513
|
...l
|
|
1514
1514
|
}) {
|
|
@@ -1516,7 +1516,7 @@ function wt({
|
|
|
1516
1516
|
return /* @__PURE__ */ e.jsxs(
|
|
1517
1517
|
"nav",
|
|
1518
1518
|
{
|
|
1519
|
-
className: `ds-pagination${
|
|
1519
|
+
className: `ds-pagination${r ? ` ${r}` : ""}`,
|
|
1520
1520
|
"aria-label": a,
|
|
1521
1521
|
style: o,
|
|
1522
1522
|
...l,
|
|
@@ -1525,7 +1525,7 @@ function wt({
|
|
|
1525
1525
|
"button",
|
|
1526
1526
|
{
|
|
1527
1527
|
className: "ds-pagination-arrow",
|
|
1528
|
-
onClick: () =>
|
|
1528
|
+
onClick: () => n == null ? void 0 : n(s - 1),
|
|
1529
1529
|
disabled: s <= 1,
|
|
1530
1530
|
"aria-label": "Previous page",
|
|
1531
1531
|
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
@@ -1536,7 +1536,7 @@ function wt({
|
|
|
1536
1536
|
"button",
|
|
1537
1537
|
{
|
|
1538
1538
|
className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
|
|
1539
|
-
onClick: () => d !== s && (
|
|
1539
|
+
onClick: () => d !== s && (n == null ? void 0 : n(d)),
|
|
1540
1540
|
"aria-current": d === s ? "page" : void 0,
|
|
1541
1541
|
"aria-label": `Page ${d}`,
|
|
1542
1542
|
children: d
|
|
@@ -1548,7 +1548,7 @@ function wt({
|
|
|
1548
1548
|
"button",
|
|
1549
1549
|
{
|
|
1550
1550
|
className: "ds-pagination-arrow",
|
|
1551
|
-
onClick: () =>
|
|
1551
|
+
onClick: () => n == null ? void 0 : n(s + 1),
|
|
1552
1552
|
disabled: s >= t,
|
|
1553
1553
|
"aria-label": "Next page",
|
|
1554
1554
|
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
@@ -1558,36 +1558,36 @@ function wt({
|
|
|
1558
1558
|
}
|
|
1559
1559
|
);
|
|
1560
1560
|
}
|
|
1561
|
-
function vs(s, t,
|
|
1561
|
+
function vs(s, t, n) {
|
|
1562
1562
|
if (t <= 7) return Array.from({ length: t }, (o, l) => l + 1);
|
|
1563
|
-
const i = Math.max(2, s -
|
|
1564
|
-
i > 2 &&
|
|
1565
|
-
for (let o = i; o <= a; o++)
|
|
1566
|
-
return a < t - 1 &&
|
|
1563
|
+
const i = Math.max(2, s - n), a = Math.min(t - 1, s + n), r = [1];
|
|
1564
|
+
i > 2 && r.push("…");
|
|
1565
|
+
for (let o = i; o <= a; o++) r.push(o);
|
|
1566
|
+
return a < t - 1 && r.push("…"), r.push(t), r;
|
|
1567
1567
|
}
|
|
1568
1568
|
const Ns = 200;
|
|
1569
1569
|
function gt({
|
|
1570
1570
|
children: s,
|
|
1571
1571
|
title: t,
|
|
1572
|
-
onClose:
|
|
1572
|
+
onClose: n,
|
|
1573
1573
|
side: i = "right",
|
|
1574
1574
|
...a
|
|
1575
1575
|
}) {
|
|
1576
|
-
const
|
|
1577
|
-
!
|
|
1578
|
-
m(!1),
|
|
1576
|
+
const r = E(null), o = K.useId(), [l, m] = D(!1), d = () => {
|
|
1577
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
1578
|
+
m(!1), n();
|
|
1579
1579
|
}, Ns));
|
|
1580
1580
|
};
|
|
1581
1581
|
M(() => {
|
|
1582
|
-
const u = (
|
|
1583
|
-
|
|
1584
|
-
}, _ = (
|
|
1585
|
-
|
|
1582
|
+
const u = (b) => {
|
|
1583
|
+
b.key === "Escape" && d();
|
|
1584
|
+
}, _ = (b) => {
|
|
1585
|
+
r.current && !r.current.contains(b.target) && d();
|
|
1586
1586
|
};
|
|
1587
1587
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", _), () => {
|
|
1588
1588
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", _);
|
|
1589
1589
|
};
|
|
1590
|
-
}, [
|
|
1590
|
+
}, [n, l]);
|
|
1591
1591
|
const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Be), h = f.filter((u) => (u == null ? void 0 : u.type) !== Be);
|
|
1592
1592
|
return /* @__PURE__ */ e.jsx(
|
|
1593
1593
|
"div",
|
|
@@ -1599,14 +1599,14 @@ function gt({
|
|
|
1599
1599
|
{
|
|
1600
1600
|
className: ["ds-drawer", l && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1601
1601
|
"data-side": i,
|
|
1602
|
-
ref:
|
|
1602
|
+
ref: r,
|
|
1603
1603
|
role: "dialog",
|
|
1604
1604
|
"aria-modal": "true",
|
|
1605
1605
|
"aria-labelledby": t ? o : void 0,
|
|
1606
1606
|
children: [
|
|
1607
1607
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1608
1608
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
|
|
1609
|
-
|
|
1609
|
+
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 }) })
|
|
1610
1610
|
] }),
|
|
1611
1611
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1612
1612
|
p
|
|
@@ -1628,13 +1628,13 @@ const ws = {
|
|
|
1628
1628
|
function yt({
|
|
1629
1629
|
children: s,
|
|
1630
1630
|
variant: t = "info",
|
|
1631
|
-
action:
|
|
1631
|
+
action: n,
|
|
1632
1632
|
onAction: i,
|
|
1633
1633
|
onDismiss: a,
|
|
1634
|
-
role:
|
|
1634
|
+
role: r,
|
|
1635
1635
|
...o
|
|
1636
1636
|
}) {
|
|
1637
|
-
const l = ws[t], m =
|
|
1637
|
+
const l = ws[t], m = r || (t === "error" ? "alert" : "status");
|
|
1638
1638
|
return /* @__PURE__ */ e.jsxs(
|
|
1639
1639
|
"div",
|
|
1640
1640
|
{
|
|
@@ -1644,13 +1644,13 @@ function yt({
|
|
|
1644
1644
|
children: [
|
|
1645
1645
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
1646
1646
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1647
|
-
|
|
1647
|
+
n && /* @__PURE__ */ e.jsx(
|
|
1648
1648
|
"button",
|
|
1649
1649
|
{
|
|
1650
1650
|
type: "button",
|
|
1651
1651
|
className: "ds-banner-action",
|
|
1652
1652
|
onClick: i,
|
|
1653
|
-
children:
|
|
1653
|
+
children: n
|
|
1654
1654
|
}
|
|
1655
1655
|
),
|
|
1656
1656
|
a && /* @__PURE__ */ e.jsx(
|
|
@@ -1660,7 +1660,7 @@ function yt({
|
|
|
1660
1660
|
className: "ds-banner-dismiss",
|
|
1661
1661
|
onClick: a,
|
|
1662
1662
|
"aria-label": "Dismiss",
|
|
1663
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1663
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 })
|
|
1664
1664
|
}
|
|
1665
1665
|
)
|
|
1666
1666
|
]
|
|
@@ -1670,14 +1670,14 @@ function yt({
|
|
|
1670
1670
|
function kt({
|
|
1671
1671
|
trigger: s,
|
|
1672
1672
|
items: t = [],
|
|
1673
|
-
open:
|
|
1673
|
+
open: n,
|
|
1674
1674
|
onOpenChange: i,
|
|
1675
1675
|
align: a = "left",
|
|
1676
|
-
className:
|
|
1676
|
+
className: r = "",
|
|
1677
1677
|
style: o,
|
|
1678
1678
|
...l
|
|
1679
1679
|
}) {
|
|
1680
|
-
const [m, d] =
|
|
1680
|
+
const [m, d] = D(!1), [f, p] = D(!1), h = n !== void 0, u = h ? n : m, _ = E(null), b = E(null), S = E(null), R = E(null), [B, y] = D({}), $ = E(null), O = 150, A = () => {
|
|
1681
1681
|
if (h)
|
|
1682
1682
|
i == null || i(!1);
|
|
1683
1683
|
else {
|
|
@@ -1688,7 +1688,7 @@ function kt({
|
|
|
1688
1688
|
}
|
|
1689
1689
|
}, Y = () => {
|
|
1690
1690
|
const x = !u;
|
|
1691
|
-
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) :
|
|
1691
|
+
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) : A();
|
|
1692
1692
|
}, q = () => {
|
|
1693
1693
|
u || (h ? i == null || i(!0) : (clearTimeout($.current), p(!1), d(!0)));
|
|
1694
1694
|
};
|
|
@@ -1718,19 +1718,19 @@ function kt({
|
|
|
1718
1718
|
if (!u) return;
|
|
1719
1719
|
const x = (k) => {
|
|
1720
1720
|
var L, H;
|
|
1721
|
-
!((L = _.current) != null && L.contains(k.target)) && !((H =
|
|
1721
|
+
!((L = _.current) != null && L.contains(k.target)) && !((H = b.current) != null && H.contains(k.target)) && A();
|
|
1722
1722
|
}, v = (k) => {
|
|
1723
|
-
k.key === "Escape" && (
|
|
1723
|
+
k.key === "Escape" && (A(), P());
|
|
1724
1724
|
};
|
|
1725
1725
|
return document.addEventListener("mousedown", x), document.addEventListener("keydown", v), () => {
|
|
1726
1726
|
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", v);
|
|
1727
1727
|
};
|
|
1728
1728
|
}, [u]), M(() => {
|
|
1729
|
-
if (!u || !R.current || !
|
|
1729
|
+
if (!u || !R.current || !b.current) return;
|
|
1730
1730
|
const x = N(), v = R.current === "last" ? x[x.length - 1] : x[0];
|
|
1731
1731
|
v == null || v.focus(), R.current = null;
|
|
1732
1732
|
}, [u]);
|
|
1733
|
-
const N = () =>
|
|
1733
|
+
const N = () => b.current ? [...b.current.querySelectorAll(
|
|
1734
1734
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1735
1735
|
)] : [], C = (x) => {
|
|
1736
1736
|
var v, k;
|
|
@@ -1760,13 +1760,13 @@ function kt({
|
|
|
1760
1760
|
x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
|
|
1761
1761
|
break;
|
|
1762
1762
|
case "Tab":
|
|
1763
|
-
|
|
1763
|
+
A();
|
|
1764
1764
|
break;
|
|
1765
1765
|
}
|
|
1766
1766
|
}, U = u && /* @__PURE__ */ e.jsx(
|
|
1767
1767
|
"div",
|
|
1768
1768
|
{
|
|
1769
|
-
ref:
|
|
1769
|
+
ref: b,
|
|
1770
1770
|
role: "menu",
|
|
1771
1771
|
className: [
|
|
1772
1772
|
"ds-dropdown__menu",
|
|
@@ -1795,7 +1795,7 @@ function kt({
|
|
|
1795
1795
|
...H,
|
|
1796
1796
|
onClick: () => {
|
|
1797
1797
|
var G;
|
|
1798
|
-
(G = x.onClick) == null || G.call(x),
|
|
1798
|
+
(G = x.onClick) == null || G.call(x), A();
|
|
1799
1799
|
},
|
|
1800
1800
|
children: [
|
|
1801
1801
|
x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
@@ -1812,7 +1812,7 @@ function kt({
|
|
|
1812
1812
|
"div",
|
|
1813
1813
|
{
|
|
1814
1814
|
ref: _,
|
|
1815
|
-
className: ["ds-dropdown",
|
|
1815
|
+
className: ["ds-dropdown", r].filter(Boolean).join(" "),
|
|
1816
1816
|
style: o,
|
|
1817
1817
|
...l,
|
|
1818
1818
|
children: [
|
|
@@ -1834,19 +1834,19 @@ function kt({
|
|
|
1834
1834
|
function Et({
|
|
1835
1835
|
value: s = 0,
|
|
1836
1836
|
size: t = "m",
|
|
1837
|
-
variant:
|
|
1837
|
+
variant: n = "default",
|
|
1838
1838
|
showValue: i = !1,
|
|
1839
1839
|
min: a = 2,
|
|
1840
|
-
animate:
|
|
1840
|
+
animate: r = !0
|
|
1841
1841
|
}) {
|
|
1842
|
-
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m =
|
|
1842
|
+
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m = n === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : n;
|
|
1843
1843
|
return /* @__PURE__ */ e.jsxs(
|
|
1844
1844
|
"div",
|
|
1845
1845
|
{
|
|
1846
1846
|
className: [
|
|
1847
1847
|
"ds-progress",
|
|
1848
1848
|
`ds-progress--${t}`,
|
|
1849
|
-
!
|
|
1849
|
+
!r && "ds-progress--instant"
|
|
1850
1850
|
].filter(Boolean).join(" "),
|
|
1851
1851
|
role: "progressbar",
|
|
1852
1852
|
"aria-valuenow": o,
|
|
@@ -1870,7 +1870,7 @@ function Et({
|
|
|
1870
1870
|
}
|
|
1871
1871
|
const gs = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1872
1872
|
function ks(s, { duration: t = 600 } = {}) {
|
|
1873
|
-
const [
|
|
1873
|
+
const [n, i] = D(s), a = E(s), r = E(null);
|
|
1874
1874
|
return M(() => {
|
|
1875
1875
|
if (ys()) {
|
|
1876
1876
|
i(s), a.current = s;
|
|
@@ -1882,48 +1882,48 @@ function ks(s, { duration: t = 600 } = {}) {
|
|
|
1882
1882
|
const d = (f) => {
|
|
1883
1883
|
m || (m = f);
|
|
1884
1884
|
const p = Math.min((f - m) / t, 1);
|
|
1885
|
-
i(o + l * gs(p)), p < 1 ?
|
|
1885
|
+
i(o + l * gs(p)), p < 1 ? r.current = requestAnimationFrame(d) : a.current = s;
|
|
1886
1886
|
};
|
|
1887
|
-
return
|
|
1888
|
-
}, [s, t]),
|
|
1887
|
+
return r.current = requestAnimationFrame(d), () => cancelAnimationFrame(r.current);
|
|
1888
|
+
}, [s, t]), n;
|
|
1889
1889
|
}
|
|
1890
1890
|
function $t({
|
|
1891
1891
|
value: s,
|
|
1892
1892
|
duration: t = 600,
|
|
1893
|
-
decimals:
|
|
1893
|
+
decimals: n = 0,
|
|
1894
1894
|
prefix: i = "",
|
|
1895
1895
|
suffix: a = ""
|
|
1896
1896
|
}) {
|
|
1897
|
-
const o = ks(s, { duration: t }).toFixed(
|
|
1897
|
+
const o = ks(s, { duration: t }).toFixed(n);
|
|
1898
1898
|
return `${i}${o}${a}`;
|
|
1899
1899
|
}
|
|
1900
|
-
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once:
|
|
1901
|
-
const i = E(null), [a,
|
|
1900
|
+
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once: n = !1 } = {}) {
|
|
1901
|
+
const i = E(null), [a, r] = D(!1);
|
|
1902
1902
|
return M(() => {
|
|
1903
1903
|
const o = i.current;
|
|
1904
1904
|
if (!o) return;
|
|
1905
1905
|
const l = new IntersectionObserver(
|
|
1906
1906
|
([m]) => {
|
|
1907
|
-
m.isIntersecting ? (
|
|
1907
|
+
m.isIntersecting ? (r(!0), n && l.disconnect()) : n || r(!1);
|
|
1908
1908
|
},
|
|
1909
1909
|
{ threshold: s, rootMargin: t }
|
|
1910
1910
|
);
|
|
1911
1911
|
return l.observe(o), () => l.disconnect();
|
|
1912
|
-
}, [s, t,
|
|
1912
|
+
}, [s, t, n]), { ref: i, inView: a };
|
|
1913
1913
|
}
|
|
1914
1914
|
function Tt({
|
|
1915
1915
|
children: s,
|
|
1916
1916
|
as: t = "div",
|
|
1917
|
-
once:
|
|
1917
|
+
once: n = !1,
|
|
1918
1918
|
threshold: i = 0.1,
|
|
1919
1919
|
rootMargin: a = "0px",
|
|
1920
|
-
onEnter:
|
|
1920
|
+
onEnter: r,
|
|
1921
1921
|
onLeave: o,
|
|
1922
1922
|
...l
|
|
1923
1923
|
}) {
|
|
1924
|
-
const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once:
|
|
1924
|
+
const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once: n }), f = E(!1);
|
|
1925
1925
|
return M(() => {
|
|
1926
|
-
d && !f.current && (
|
|
1926
|
+
d && !f.current && (r == null || r()), !d && f.current && (o == null || o()), f.current = d;
|
|
1927
1927
|
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1928
1928
|
}
|
|
1929
1929
|
const Me = {
|
|
@@ -1933,9 +1933,9 @@ const Me = {
|
|
|
1933
1933
|
error: we
|
|
1934
1934
|
};
|
|
1935
1935
|
let de = [];
|
|
1936
|
-
const
|
|
1936
|
+
const be = /* @__PURE__ */ new Set();
|
|
1937
1937
|
function We() {
|
|
1938
|
-
|
|
1938
|
+
be.forEach((s) => s([...de]));
|
|
1939
1939
|
}
|
|
1940
1940
|
function $s(s) {
|
|
1941
1941
|
de = [...de, s], We();
|
|
@@ -1944,21 +1944,21 @@ function Ts(s) {
|
|
|
1944
1944
|
de = de.filter((t) => t.id !== s), We();
|
|
1945
1945
|
}
|
|
1946
1946
|
function Rt() {
|
|
1947
|
-
const s = (t,
|
|
1947
|
+
const s = (t, n = {}) => {
|
|
1948
1948
|
$s({
|
|
1949
1949
|
id: `${Date.now()}-${Math.random()}`,
|
|
1950
1950
|
message: t,
|
|
1951
1951
|
type: "default",
|
|
1952
1952
|
duration: 4e3,
|
|
1953
|
-
...
|
|
1953
|
+
...n
|
|
1954
1954
|
});
|
|
1955
1955
|
};
|
|
1956
|
-
return s.success = (t,
|
|
1956
|
+
return s.success = (t, n) => s(t, { ...n, type: "success" }), s.error = (t, n) => s(t, { ...n, type: "error" }), s.warning = (t, n) => s(t, { ...n, type: "warning" }), { toast: s };
|
|
1957
1957
|
}
|
|
1958
1958
|
function Rs({ data: s, onDismiss: t }) {
|
|
1959
|
-
const [
|
|
1960
|
-
M(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() =>
|
|
1961
|
-
function
|
|
1959
|
+
const [n, i] = D(!1), a = E(null);
|
|
1960
|
+
M(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() => r(), s.duration)), () => clearTimeout(a.current)), []);
|
|
1961
|
+
function r() {
|
|
1962
1962
|
i(!1), setTimeout(() => t(s.id), 250);
|
|
1963
1963
|
}
|
|
1964
1964
|
const o = Me[s.type] ?? Me.default;
|
|
@@ -1968,7 +1968,7 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1968
1968
|
className: [
|
|
1969
1969
|
"ds-toast",
|
|
1970
1970
|
`ds-toast--${s.type}`,
|
|
1971
|
-
|
|
1971
|
+
n && "ds-toast--visible"
|
|
1972
1972
|
].filter(Boolean).join(" "),
|
|
1973
1973
|
role: s.type === "error" ? "alert" : "status",
|
|
1974
1974
|
"aria-live": "polite",
|
|
@@ -1979,9 +1979,9 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1979
1979
|
"button",
|
|
1980
1980
|
{
|
|
1981
1981
|
className: "ds-toast__close",
|
|
1982
|
-
onClick:
|
|
1982
|
+
onClick: r,
|
|
1983
1983
|
"aria-label": "Закрыть",
|
|
1984
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1984
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[3], strokeWidth: 1.5 })
|
|
1985
1985
|
}
|
|
1986
1986
|
)
|
|
1987
1987
|
]
|
|
@@ -1989,8 +1989,8 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1989
1989
|
);
|
|
1990
1990
|
}
|
|
1991
1991
|
function St({ position: s = "bottom-right" }) {
|
|
1992
|
-
const [t,
|
|
1993
|
-
return M(() => (
|
|
1992
|
+
const [t, n] = D(() => [...de]);
|
|
1993
|
+
return M(() => (be.add(n), () => be.delete(n)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
1994
1994
|
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(Rs, { data: i, onDismiss: Ts }, i.id)) }),
|
|
1995
1995
|
document.body
|
|
1996
1996
|
);
|
|
@@ -2000,20 +2000,20 @@ const Ss = {
|
|
|
2000
2000
|
success: /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: "success", children: "Done" }),
|
|
2001
2001
|
error: /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: "error", children: "Error" })
|
|
2002
2002
|
};
|
|
2003
|
-
function
|
|
2003
|
+
function Dt({
|
|
2004
2004
|
label: s,
|
|
2005
2005
|
status: t = "idle",
|
|
2006
|
-
icon:
|
|
2006
|
+
icon: n,
|
|
2007
2007
|
badge: i,
|
|
2008
2008
|
defaultExpanded: a = !1,
|
|
2009
|
-
expanded:
|
|
2009
|
+
expanded: r,
|
|
2010
2010
|
onToggle: o,
|
|
2011
2011
|
children: l,
|
|
2012
2012
|
className: m = "",
|
|
2013
2013
|
...d
|
|
2014
2014
|
}) {
|
|
2015
2015
|
const f = t === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2016
|
-
|
|
2016
|
+
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2017
2017
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2018
2018
|
Ss[t],
|
|
2019
2019
|
i
|
|
@@ -2029,7 +2029,7 @@ function At({
|
|
|
2029
2029
|
title: p,
|
|
2030
2030
|
padding: "s",
|
|
2031
2031
|
defaultExpanded: a,
|
|
2032
|
-
expanded: f ? !1 :
|
|
2032
|
+
expanded: f ? !1 : r,
|
|
2033
2033
|
onToggle: f ? void 0 : o,
|
|
2034
2034
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2035
2035
|
}
|
|
@@ -2044,16 +2044,16 @@ function At({
|
|
|
2044
2044
|
}
|
|
2045
2045
|
);
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2047
|
+
function Ds({
|
|
2048
2048
|
text: s,
|
|
2049
2049
|
size: t = "xs",
|
|
2050
|
-
timeout:
|
|
2050
|
+
timeout: n = 800,
|
|
2051
2051
|
"aria-label": i = "Copy to clipboard",
|
|
2052
2052
|
...a
|
|
2053
2053
|
}) {
|
|
2054
|
-
const [
|
|
2054
|
+
const [r, o] = D(!1), l = (m) => {
|
|
2055
2055
|
m.currentTarget.blur(), navigator.clipboard.writeText(s).then(() => {
|
|
2056
|
-
o(!0), setTimeout(() => o(!1),
|
|
2056
|
+
o(!0), setTimeout(() => o(!1), n);
|
|
2057
2057
|
});
|
|
2058
2058
|
};
|
|
2059
2059
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -2061,7 +2061,7 @@ function As({
|
|
|
2061
2061
|
{
|
|
2062
2062
|
variant: "ghost",
|
|
2063
2063
|
size: t,
|
|
2064
|
-
state:
|
|
2064
|
+
state: r ? "success" : "idle",
|
|
2065
2065
|
icon: /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
|
|
2066
2066
|
"aria-label": i,
|
|
2067
2067
|
onClick: l,
|
|
@@ -2069,8 +2069,8 @@ function As({
|
|
|
2069
2069
|
}
|
|
2070
2070
|
);
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2073
|
-
const [i, a] =
|
|
2072
|
+
function At({ content: s, streaming: t = !1, ...n }) {
|
|
2073
|
+
const [i, a] = D(t);
|
|
2074
2074
|
return M(() => {
|
|
2075
2075
|
a(!!t);
|
|
2076
2076
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
@@ -2083,7 +2083,7 @@ function Dt({ content: s, streaming: t = !1, ...r }) {
|
|
|
2083
2083
|
/* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2084
2084
|
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2085
2085
|
] }),
|
|
2086
|
-
...
|
|
2086
|
+
...n,
|
|
2087
2087
|
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2088
2088
|
s,
|
|
2089
2089
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
@@ -2094,16 +2094,16 @@ function Dt({ content: s, streaming: t = !1, ...r }) {
|
|
|
2094
2094
|
function It({
|
|
2095
2095
|
count: s,
|
|
2096
2096
|
current: t = 0,
|
|
2097
|
-
done:
|
|
2097
|
+
done: n = [],
|
|
2098
2098
|
onChange: i,
|
|
2099
2099
|
showCounter: a = !0,
|
|
2100
|
-
className:
|
|
2100
|
+
className: r = "",
|
|
2101
2101
|
"aria-label": o = "Steps",
|
|
2102
2102
|
...l
|
|
2103
2103
|
}) {
|
|
2104
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2104
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", r].filter(Boolean).join(" "), ...l, children: [
|
|
2105
2105
|
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, d) => {
|
|
2106
|
-
const f = d === t, p =
|
|
2106
|
+
const f = d === t, p = n.includes(d) && !f, h = i && (d <= t || n.includes(d)), u = [
|
|
2107
2107
|
"ds-step-indicator__dot",
|
|
2108
2108
|
f && "ds-step-indicator__dot--active",
|
|
2109
2109
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2133,26 +2133,26 @@ function It({
|
|
|
2133
2133
|
function Bt({
|
|
2134
2134
|
content: s,
|
|
2135
2135
|
isStreaming: t = !1,
|
|
2136
|
-
cursor:
|
|
2136
|
+
cursor: n = "line",
|
|
2137
2137
|
onChunk: i,
|
|
2138
2138
|
className: a = "",
|
|
2139
|
-
...
|
|
2139
|
+
...r
|
|
2140
2140
|
}) {
|
|
2141
2141
|
const o = E(s);
|
|
2142
2142
|
return M(() => {
|
|
2143
2143
|
s !== o.current && (i == null || i(s), o.current = s);
|
|
2144
|
-
}, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...
|
|
2144
|
+
}, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...r, children: [
|
|
2145
2145
|
s,
|
|
2146
|
-
t &&
|
|
2146
|
+
t && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2147
2147
|
] });
|
|
2148
2148
|
}
|
|
2149
2149
|
function Mt({
|
|
2150
2150
|
role: s = "assistant",
|
|
2151
2151
|
header: t,
|
|
2152
|
-
footer:
|
|
2152
|
+
footer: n,
|
|
2153
2153
|
attachments: i,
|
|
2154
2154
|
isStreaming: a = !1,
|
|
2155
|
-
children:
|
|
2155
|
+
children: r,
|
|
2156
2156
|
className: o = "",
|
|
2157
2157
|
...l
|
|
2158
2158
|
}) {
|
|
@@ -2162,42 +2162,42 @@ function Mt({
|
|
|
2162
2162
|
a && "ds-chat-message--streaming",
|
|
2163
2163
|
o
|
|
2164
2164
|
].filter(Boolean).join(" ");
|
|
2165
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children:
|
|
2165
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: r }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2166
2166
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2167
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2168
|
-
|
|
2167
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: r }),
|
|
2168
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2169
2169
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2170
2170
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2171
2171
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2172
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2173
|
-
|
|
2172
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: r }),
|
|
2173
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2174
2174
|
] });
|
|
2175
2175
|
}
|
|
2176
|
-
function Pt(s, { containerRef: t, smartPause:
|
|
2176
|
+
function Pt(s, { containerRef: t, smartPause: n = !0 } = {}) {
|
|
2177
2177
|
const i = E(!1), a = E(0);
|
|
2178
2178
|
M(() => {
|
|
2179
|
-
const
|
|
2180
|
-
if (!
|
|
2179
|
+
const r = t == null ? void 0 : t.current;
|
|
2180
|
+
if (!r) return;
|
|
2181
2181
|
const o = () => {
|
|
2182
|
-
const l =
|
|
2183
|
-
!l &&
|
|
2182
|
+
const l = r.scrollHeight - r.scrollTop - r.clientHeight < 64;
|
|
2183
|
+
!l && r.scrollTop < a.current && (i.current = !0), l && (i.current = !1), a.current = r.scrollTop;
|
|
2184
2184
|
};
|
|
2185
|
-
return
|
|
2185
|
+
return r.addEventListener("scroll", o, { passive: !0 }), () => r.removeEventListener("scroll", o);
|
|
2186
2186
|
}, [t]), M(() => {
|
|
2187
|
-
const
|
|
2188
|
-
|
|
2187
|
+
const r = t == null ? void 0 : t.current;
|
|
2188
|
+
r && (n && i.current || (r.scrollTop = r.scrollHeight));
|
|
2189
2189
|
}, s);
|
|
2190
2190
|
}
|
|
2191
|
-
function
|
|
2191
|
+
function As({
|
|
2192
2192
|
prompts: s,
|
|
2193
2193
|
enabled: t,
|
|
2194
|
-
typingSpeed:
|
|
2194
|
+
typingSpeed: n = 38,
|
|
2195
2195
|
erasingSpeed: i = 18,
|
|
2196
2196
|
holdTime: a = 2200,
|
|
2197
|
-
betweenTime:
|
|
2197
|
+
betweenTime: r = 380,
|
|
2198
2198
|
manualPauseMs: o = 5e3
|
|
2199
2199
|
}) {
|
|
2200
|
-
const [l, m] =
|
|
2200
|
+
const [l, m] = D(0), [d, f] = D(""), p = E("typing"), h = E(0), u = E(0), _ = E(null), b = E(0);
|
|
2201
2201
|
M(() => {
|
|
2202
2202
|
u.current = l;
|
|
2203
2203
|
}, [l]), M(() => {
|
|
@@ -2207,21 +2207,21 @@ function Ds({
|
|
|
2207
2207
|
}
|
|
2208
2208
|
const $ = () => {
|
|
2209
2209
|
const O = Date.now();
|
|
2210
|
-
if (
|
|
2211
|
-
_.current = setTimeout($,
|
|
2210
|
+
if (b.current > O) {
|
|
2211
|
+
_.current = setTimeout($, b.current - O);
|
|
2212
2212
|
return;
|
|
2213
2213
|
}
|
|
2214
|
-
const
|
|
2215
|
-
p.current === "typing" ? (h.current += 1, f(
|
|
2214
|
+
const A = s[u.current % s.length] ?? "";
|
|
2215
|
+
p.current === "typing" ? (h.current += 1, f(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", _.current = setTimeout($, a)) : _.current = setTimeout($, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", _.current = setTimeout($, i)) : (h.current = Math.max(0, h.current - 1), f(A.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % s.length, m(u.current), _.current = setTimeout($, r)) : _.current = setTimeout($, i));
|
|
2216
2216
|
};
|
|
2217
2217
|
return _.current = setTimeout($, 260), () => {
|
|
2218
2218
|
_.current && clearTimeout(_.current);
|
|
2219
2219
|
};
|
|
2220
|
-
}, [t, s,
|
|
2220
|
+
}, [t, s, n, i, a, r]);
|
|
2221
2221
|
const S = ($) => {
|
|
2222
2222
|
if (s.length === 0) return;
|
|
2223
|
-
const O = ($ % s.length + s.length) % s.length,
|
|
2224
|
-
u.current = O, h.current =
|
|
2223
|
+
const O = ($ % s.length + s.length) % s.length, A = s[O];
|
|
2224
|
+
u.current = O, h.current = A.length, p.current = "holding", b.current = Date.now() + o, m(O), f(A);
|
|
2225
2225
|
}, R = () => S(u.current + 1), B = () => S(u.current - 1), y = s[l % s.length] ?? "";
|
|
2226
2226
|
return { displayed: d, currentPrompt: y, index: l, next: R, prev: B };
|
|
2227
2227
|
}
|
|
@@ -2229,10 +2229,10 @@ let Is = 0;
|
|
|
2229
2229
|
function Lt({
|
|
2230
2230
|
value: s = "",
|
|
2231
2231
|
onChange: t,
|
|
2232
|
-
onSubmit:
|
|
2232
|
+
onSubmit: n,
|
|
2233
2233
|
onStop: i,
|
|
2234
2234
|
onKeyDown: a,
|
|
2235
|
-
loading:
|
|
2235
|
+
loading: r = !1,
|
|
2236
2236
|
disabled: o = !1,
|
|
2237
2237
|
placeholder: l = "Let's get things done...",
|
|
2238
2238
|
animatedPlaceholders: m,
|
|
@@ -2242,57 +2242,57 @@ function Lt({
|
|
|
2242
2242
|
onAttachImages: h,
|
|
2243
2243
|
onRemoveAttachment: u,
|
|
2244
2244
|
onRemoveImage: _,
|
|
2245
|
-
acceptImage:
|
|
2245
|
+
acceptImage: b,
|
|
2246
2246
|
acceptFile: S,
|
|
2247
2247
|
maxImages: R,
|
|
2248
2248
|
maxImageSize: B,
|
|
2249
2249
|
leftSlot: y,
|
|
2250
2250
|
rightSlot: $,
|
|
2251
2251
|
className: O = "",
|
|
2252
|
-
...
|
|
2252
|
+
...A
|
|
2253
2253
|
}) {
|
|
2254
|
-
const Y = E(null), q = E(null), P = E(0), [N, C] =
|
|
2254
|
+
const Y = E(null), q = E(null), P = E(0), [N, C] = D(!1), [X, U] = D([]), x = (j) => {
|
|
2255
2255
|
const T = ++Is;
|
|
2256
|
-
U((V) => [...V, { id: T, msg:
|
|
2257
|
-
}, v = (
|
|
2256
|
+
U((V) => [...V, { id: T, msg: j }]), setTimeout(() => U((V) => V.filter((J) => J.id !== T)), 6e3);
|
|
2257
|
+
}, v = (j) => U((T) => T.filter((V) => V.id !== j)), k = (j) => j.type.startsWith("image/"), L = () => !0, H = b ?? k, G = S ?? L, g = (j) => {
|
|
2258
2258
|
const T = [], V = [], J = [], Z = [];
|
|
2259
2259
|
let ee = 0, oe = R != null ? R - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
|
|
2260
|
-
for (const se of
|
|
2260
|
+
for (const se of j)
|
|
2261
2261
|
H(se) ? B && se.size > B ? J.push(se.name) : oe > 0 ? (T.push(se), oe--) : ee++ : G(se) ? V.push(se) : Z.push(se.name);
|
|
2262
2262
|
return { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2263
|
-
}, c = (
|
|
2264
|
-
const { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(
|
|
2263
|
+
}, c = (j) => {
|
|
2264
|
+
const { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(j);
|
|
2265
2265
|
J.length && x(`File${J.length > 1 ? "s" : ""} too large${B ? ` (max ${B / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${R} images per message`), h && T.length && h(T);
|
|
2266
2266
|
const oe = V.concat(h ? [] : T);
|
|
2267
2267
|
p && oe.length && p(oe);
|
|
2268
2268
|
};
|
|
2269
2269
|
M(() => {
|
|
2270
|
-
const
|
|
2271
|
-
|
|
2270
|
+
const j = q.current;
|
|
2271
|
+
j && (j.style.height = "auto", j.style.height = `${Math.min(j.scrollHeight, 200)}px`);
|
|
2272
2272
|
}, [s]), M(() => {
|
|
2273
|
-
const
|
|
2273
|
+
const j = (T) => {
|
|
2274
2274
|
var J, Z, ee;
|
|
2275
|
-
if (
|
|
2275
|
+
if (r || o) return;
|
|
2276
2276
|
const V = (J = T.target) == null ? void 0 : J.tagName;
|
|
2277
2277
|
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (Z = T.target) != null && Z.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (ee = q.current) == null || ee.focus();
|
|
2278
2278
|
};
|
|
2279
|
-
return document.addEventListener("keydown",
|
|
2280
|
-
}, [
|
|
2281
|
-
const w = (
|
|
2282
|
-
|
|
2283
|
-
}, z = (
|
|
2284
|
-
|
|
2285
|
-
}, F = (
|
|
2286
|
-
|
|
2287
|
-
const T = Array.from(
|
|
2279
|
+
return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
|
|
2280
|
+
}, [r, o]);
|
|
2281
|
+
const w = (j) => {
|
|
2282
|
+
j.preventDefault(), P.current++, j.dataTransfer.types.includes("Files") && C(!0);
|
|
2283
|
+
}, z = (j) => {
|
|
2284
|
+
j.preventDefault(), P.current--, P.current === 0 && C(!1);
|
|
2285
|
+
}, F = (j) => j.preventDefault(), te = (j) => {
|
|
2286
|
+
j.preventDefault(), P.current = 0, C(!1);
|
|
2287
|
+
const T = Array.from(j.dataTransfer.files);
|
|
2288
2288
|
T.length && c(T);
|
|
2289
|
-
}, ae = (
|
|
2290
|
-
const T = Array.from(
|
|
2289
|
+
}, ae = (j) => {
|
|
2290
|
+
const T = Array.from(j.target.files || []);
|
|
2291
2291
|
Y.current && (Y.current.value = ""), T.length && c(T);
|
|
2292
|
-
}, W = (
|
|
2292
|
+
}, W = (j) => {
|
|
2293
2293
|
var se;
|
|
2294
2294
|
if (!h) return;
|
|
2295
|
-
const T = (se =
|
|
2295
|
+
const T = (se = j.clipboardData) == null ? void 0 : se.items;
|
|
2296
2296
|
if (!T) return;
|
|
2297
2297
|
const V = [];
|
|
2298
2298
|
for (const Ue of T) {
|
|
@@ -2301,28 +2301,28 @@ function Lt({
|
|
|
2301
2301
|
}
|
|
2302
2302
|
if (V.length === 0) return;
|
|
2303
2303
|
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: oe } = g(V);
|
|
2304
|
-
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), oe && x(`Max ${R} images per message`), J.length && (
|
|
2305
|
-
}, Q = !
|
|
2304
|
+
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), oe && x(`Max ${R} images per message`), J.length && (j.preventDefault(), h(J));
|
|
2305
|
+
}, Q = !r && !o && !!(m != null && m.length) && s.length === 0, ie = As({
|
|
2306
2306
|
prompts: m ?? [],
|
|
2307
2307
|
enabled: Q
|
|
2308
|
-
}), xe = (
|
|
2308
|
+
}), xe = (j) => {
|
|
2309
2309
|
if (Q) {
|
|
2310
|
-
if (
|
|
2311
|
-
|
|
2310
|
+
if (j.key === "ArrowDown" || j.key === "ArrowRight") {
|
|
2311
|
+
j.preventDefault(), ie.next();
|
|
2312
2312
|
return;
|
|
2313
2313
|
}
|
|
2314
|
-
if (
|
|
2315
|
-
|
|
2314
|
+
if (j.key === "ArrowUp" || j.key === "ArrowLeft") {
|
|
2315
|
+
j.preventDefault(), ie.prev();
|
|
2316
2316
|
return;
|
|
2317
2317
|
}
|
|
2318
|
-
if (
|
|
2319
|
-
|
|
2318
|
+
if (j.key === "Tab" && !j.shiftKey) {
|
|
2319
|
+
j.preventDefault(), t == null || t(ie.currentPrompt);
|
|
2320
2320
|
return;
|
|
2321
2321
|
}
|
|
2322
2322
|
}
|
|
2323
|
-
a == null || a(
|
|
2323
|
+
a == null || a(j);
|
|
2324
2324
|
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (d == null ? void 0 : d.length) > 0) && !o, $e = p || h;
|
|
2325
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...
|
|
2325
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...A, children: [
|
|
2326
2326
|
$e && /* @__PURE__ */ e.jsx(
|
|
2327
2327
|
"input",
|
|
2328
2328
|
{
|
|
@@ -2349,11 +2349,11 @@ function Lt({
|
|
|
2349
2349
|
{
|
|
2350
2350
|
ref: q,
|
|
2351
2351
|
value: s,
|
|
2352
|
-
onChange: (
|
|
2352
|
+
onChange: (j) => t == null ? void 0 : t(j.target.value),
|
|
2353
2353
|
onKeyDown: xe,
|
|
2354
2354
|
onPaste: W,
|
|
2355
2355
|
placeholder: Q ? "" : l,
|
|
2356
|
-
disabled:
|
|
2356
|
+
disabled: r || o,
|
|
2357
2357
|
rows: 1,
|
|
2358
2358
|
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2359
2359
|
}
|
|
@@ -2362,8 +2362,8 @@ function Lt({
|
|
|
2362
2362
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
|
|
2363
2363
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2364
2364
|
] }),
|
|
2365
|
-
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((
|
|
2366
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2365
|
+
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((j, T) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2366
|
+
/* @__PURE__ */ e.jsx("img", { src: j.preview, alt: "" }),
|
|
2367
2367
|
/* @__PURE__ */ e.jsx(
|
|
2368
2368
|
"button",
|
|
2369
2369
|
{
|
|
@@ -2371,33 +2371,33 @@ function Lt({
|
|
|
2371
2371
|
onClick: () => _ == null ? void 0 : _(T),
|
|
2372
2372
|
"aria-label": "Remove image",
|
|
2373
2373
|
type: "button",
|
|
2374
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2374
|
+
children: /* @__PURE__ */ e.jsx(re, { size: 12, strokeWidth: 2 })
|
|
2375
2375
|
}
|
|
2376
2376
|
)
|
|
2377
2377
|
] }, T)) }),
|
|
2378
|
-
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((
|
|
2379
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2378
|
+
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((j) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2379
|
+
/* @__PURE__ */ e.jsx("span", { children: j.msg }),
|
|
2380
2380
|
/* @__PURE__ */ e.jsx(
|
|
2381
2381
|
"button",
|
|
2382
2382
|
{
|
|
2383
2383
|
type: "button",
|
|
2384
2384
|
className: "ds-prompt-input__warning-close",
|
|
2385
|
-
onClick: () => v(
|
|
2385
|
+
onClick: () => v(j.id),
|
|
2386
2386
|
"aria-label": "Dismiss",
|
|
2387
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2387
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[1], strokeWidth: 1.5 })
|
|
2388
2388
|
}
|
|
2389
2389
|
)
|
|
2390
|
-
] },
|
|
2391
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2390
|
+
] }, j.id)) }),
|
|
2391
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((j, T) => /* @__PURE__ */ e.jsx(ce, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2392
|
+
j.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: I[1], strokeWidth: 1.5 }),
|
|
2393
|
+
j.filename,
|
|
2394
|
+
j.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2395
2395
|
"button",
|
|
2396
2396
|
{
|
|
2397
2397
|
type: "button",
|
|
2398
2398
|
className: "ds-prompt-input__remove-btn",
|
|
2399
2399
|
onClick: () => u == null ? void 0 : u(T),
|
|
2400
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2400
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[1], strokeWidth: 1.5 })
|
|
2401
2401
|
}
|
|
2402
2402
|
)
|
|
2403
2403
|
] }) }, T)) }),
|
|
@@ -2410,15 +2410,15 @@ function Lt({
|
|
|
2410
2410
|
icon: /* @__PURE__ */ e.jsx(Re, { size: I[2], strokeWidth: 1.5 }),
|
|
2411
2411
|
"aria-label": "Attach files",
|
|
2412
2412
|
onClick: () => {
|
|
2413
|
-
var
|
|
2414
|
-
return (
|
|
2413
|
+
var j;
|
|
2414
|
+
return (j = Y.current) == null ? void 0 : j.click();
|
|
2415
2415
|
}
|
|
2416
2416
|
}
|
|
2417
2417
|
),
|
|
2418
2418
|
y,
|
|
2419
2419
|
$,
|
|
2420
2420
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2421
|
-
|
|
2421
|
+
r ? /* @__PURE__ */ e.jsx(
|
|
2422
2422
|
me,
|
|
2423
2423
|
{
|
|
2424
2424
|
variant: "primary",
|
|
@@ -2433,7 +2433,7 @@ function Lt({
|
|
|
2433
2433
|
variant: "primary",
|
|
2434
2434
|
size: "xs",
|
|
2435
2435
|
icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
|
|
2436
|
-
onClick:
|
|
2436
|
+
onClick: n,
|
|
2437
2437
|
disabled: !Ce,
|
|
2438
2438
|
"aria-label": "Send"
|
|
2439
2439
|
}
|
|
@@ -2448,15 +2448,15 @@ const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard
|
|
|
2448
2448
|
function zt({
|
|
2449
2449
|
models: s = [],
|
|
2450
2450
|
value: t,
|
|
2451
|
-
onChange:
|
|
2451
|
+
onChange: n,
|
|
2452
2452
|
size: i = "xs",
|
|
2453
2453
|
minTier: a,
|
|
2454
|
-
showAutoOption:
|
|
2454
|
+
showAutoOption: r = !1,
|
|
2455
2455
|
groupByTier: o = !0,
|
|
2456
2456
|
className: l = "",
|
|
2457
2457
|
...m
|
|
2458
2458
|
}) {
|
|
2459
|
-
const [d, f] =
|
|
2459
|
+
const [d, f] = D(!1), p = E(null), h = E(null), u = E(null), [_, b] = D({}), S = s.filter((N) => !a || N.name === "auto" ? !0 : (Pe[N.tier] ?? 1) >= (Pe[a] ?? 1)), R = S.find((N) => N.name === "auto"), B = S.filter((N) => N.name !== "auto"), y = s.find((N) => N.name === t), O = new Set(B.map((N) => N.tier).filter(Boolean)).size > 1;
|
|
2460
2460
|
M(() => {
|
|
2461
2461
|
if (!d) return;
|
|
2462
2462
|
const N = 320, C = () => {
|
|
@@ -2464,7 +2464,7 @@ function zt({
|
|
|
2464
2464
|
const x = (L = h.current) == null ? void 0 : L.getBoundingClientRect();
|
|
2465
2465
|
if (!x) return;
|
|
2466
2466
|
const v = window.innerHeight - x.bottom, k = v < N + 8 && x.top > v;
|
|
2467
|
-
|
|
2467
|
+
b({
|
|
2468
2468
|
position: "fixed",
|
|
2469
2469
|
zIndex: "var(--z-dropdown, 500)",
|
|
2470
2470
|
left: x.left,
|
|
@@ -2482,8 +2482,8 @@ function zt({
|
|
|
2482
2482
|
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", X), document.removeEventListener("keydown", U);
|
|
2483
2483
|
};
|
|
2484
2484
|
}, [d]);
|
|
2485
|
-
const
|
|
2486
|
-
|
|
2485
|
+
const A = (N) => {
|
|
2486
|
+
n == null || n(N), f(!1);
|
|
2487
2487
|
}, Y = (N) => /* @__PURE__ */ e.jsxs(
|
|
2488
2488
|
"button",
|
|
2489
2489
|
{
|
|
@@ -2492,7 +2492,7 @@ function zt({
|
|
|
2492
2492
|
"ds-model-picker__item",
|
|
2493
2493
|
N.name === t && "ds-model-picker__item--active"
|
|
2494
2494
|
].filter(Boolean).join(" "),
|
|
2495
|
-
onClick: () =>
|
|
2495
|
+
onClick: () => A(N.name),
|
|
2496
2496
|
children: [
|
|
2497
2497
|
N.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: N.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2498
2498
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: N.displayName || N.name }),
|
|
@@ -2507,7 +2507,7 @@ function zt({
|
|
|
2507
2507
|
...C.map(Y)
|
|
2508
2508
|
] : [];
|
|
2509
2509
|
}), P = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu", style: _, children: [
|
|
2510
|
-
|
|
2510
|
+
r && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2511
2511
|
/* @__PURE__ */ e.jsxs(
|
|
2512
2512
|
"button",
|
|
2513
2513
|
{
|
|
@@ -2517,7 +2517,7 @@ function zt({
|
|
|
2517
2517
|
"ds-model-picker__item--auto",
|
|
2518
2518
|
t === "auto" && "ds-model-picker__item--active"
|
|
2519
2519
|
].filter(Boolean).join(" "),
|
|
2520
|
-
onClick: () =>
|
|
2520
|
+
onClick: () => A("auto"),
|
|
2521
2521
|
children: [
|
|
2522
2522
|
/* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2523
2523
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
@@ -2565,28 +2565,28 @@ function ve(s) {
|
|
|
2565
2565
|
}
|
|
2566
2566
|
function Ms(s) {
|
|
2567
2567
|
const t = /* @__PURE__ */ new Map();
|
|
2568
|
-
for (const
|
|
2569
|
-
t.has(
|
|
2568
|
+
for (const n of s)
|
|
2569
|
+
t.has(n.filename) || t.set(n.filename, { filename: n.filename, url: n.url, items: [] }), t.get(n.filename).items.push(n);
|
|
2570
2570
|
return [...t.values()];
|
|
2571
2571
|
}
|
|
2572
2572
|
function Ot({
|
|
2573
2573
|
sources: s = [],
|
|
2574
2574
|
layout: t = "list",
|
|
2575
|
-
title:
|
|
2575
|
+
title: n = "Sources",
|
|
2576
2576
|
maxVisible: i = 5,
|
|
2577
2577
|
onSourceClick: a
|
|
2578
2578
|
}) {
|
|
2579
|
-
const [
|
|
2579
|
+
const [r, o] = D(!1), l = Ms(s), m = l.length > i, d = r ? l : l.slice(0, i), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2580
2580
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2581
2581
|
d.map((h) => {
|
|
2582
|
-
const u = h.items.map((
|
|
2582
|
+
const u = h.items.map((b) => b.page).filter(Boolean), _ = !!a;
|
|
2583
2583
|
return /* @__PURE__ */ e.jsxs(
|
|
2584
2584
|
"div",
|
|
2585
2585
|
{
|
|
2586
2586
|
className: `ds-sources-panel__compact-row${_ ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2587
2587
|
onClick: _ ? () => a(h.items[0]) : void 0,
|
|
2588
2588
|
children: [
|
|
2589
|
-
/* @__PURE__ */ e.jsx(
|
|
2589
|
+
/* @__PURE__ */ e.jsx(ns, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2590
2590
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2591
2591
|
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(u) })
|
|
2592
2592
|
]
|
|
@@ -2594,26 +2594,26 @@ function Ot({
|
|
|
2594
2594
|
h.filename
|
|
2595
2595
|
);
|
|
2596
2596
|
}),
|
|
2597
|
-
m && !
|
|
2597
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2598
2598
|
"+",
|
|
2599
2599
|
l.length - i,
|
|
2600
2600
|
" more sources"
|
|
2601
2601
|
] })
|
|
2602
2602
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2603
|
-
|
|
2603
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2604
2604
|
d.map((h) => {
|
|
2605
|
-
const u = h.items.map((
|
|
2605
|
+
const u = h.items.map((b) => b.page).filter(Boolean), _ = !!a;
|
|
2606
2606
|
return f ? /* @__PURE__ */ e.jsx(
|
|
2607
2607
|
Ee,
|
|
2608
2608
|
{
|
|
2609
2609
|
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: u }),
|
|
2610
2610
|
padding: "s",
|
|
2611
|
-
children: h.items.map((
|
|
2611
|
+
children: h.items.map((b, S) => /* @__PURE__ */ e.jsx(
|
|
2612
2612
|
"div",
|
|
2613
2613
|
{
|
|
2614
2614
|
className: `ds-sources-panel__snippet${_ ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2615
|
-
onClick: _ ? () => a(
|
|
2616
|
-
children:
|
|
2615
|
+
onClick: _ ? () => a(b) : void 0,
|
|
2616
|
+
children: b.snippet ?? `p. ${b.page}`
|
|
2617
2617
|
},
|
|
2618
2618
|
S
|
|
2619
2619
|
))
|
|
@@ -2632,7 +2632,7 @@ function Ot({
|
|
|
2632
2632
|
h.filename
|
|
2633
2633
|
);
|
|
2634
2634
|
}),
|
|
2635
|
-
m && !
|
|
2635
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2636
2636
|
"+",
|
|
2637
2637
|
l.length - i,
|
|
2638
2638
|
" more sources"
|
|
@@ -2645,17 +2645,17 @@ function ze(s) {
|
|
|
2645
2645
|
function Ft({
|
|
2646
2646
|
used: s,
|
|
2647
2647
|
limit: t,
|
|
2648
|
-
size:
|
|
2648
|
+
size: n = "s",
|
|
2649
2649
|
showCount: i = !0,
|
|
2650
2650
|
showPercent: a = !1,
|
|
2651
|
-
warningThreshold:
|
|
2651
|
+
warningThreshold: r = 0.8,
|
|
2652
2652
|
errorThreshold: o = 1
|
|
2653
2653
|
}) {
|
|
2654
|
-
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >=
|
|
2654
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >= r ? "warning" : "normal";
|
|
2655
2655
|
return /* @__PURE__ */ e.jsxs(
|
|
2656
2656
|
"div",
|
|
2657
2657
|
{
|
|
2658
|
-
className: `ds-token-counter ds-token-counter--${
|
|
2658
|
+
className: `ds-token-counter ds-token-counter--${n}`,
|
|
2659
2659
|
role: "meter",
|
|
2660
2660
|
"aria-valuenow": s,
|
|
2661
2661
|
"aria-valuemax": t,
|
|
@@ -2690,10 +2690,10 @@ function Ps(s) {
|
|
|
2690
2690
|
function Wt({
|
|
2691
2691
|
value: s = 0,
|
|
2692
2692
|
size: t = "xs",
|
|
2693
|
-
showLabel:
|
|
2693
|
+
showLabel: n = "none",
|
|
2694
2694
|
layout: i = "inline"
|
|
2695
2695
|
}) {
|
|
2696
|
-
const a = Math.max(0, Math.min(1, s)),
|
|
2696
|
+
const a = Math.max(0, Math.min(1, s)), r = Math.round(a * Oe), o = Ps(a);
|
|
2697
2697
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2698
2698
|
"ds-confidence-bar",
|
|
2699
2699
|
`ds-confidence-bar--${t}`,
|
|
@@ -2703,11 +2703,11 @@ function Wt({
|
|
|
2703
2703
|
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, m) => /* @__PURE__ */ e.jsx(
|
|
2704
2704
|
"div",
|
|
2705
2705
|
{
|
|
2706
|
-
className: `ds-confidence-bar__seg${m <
|
|
2706
|
+
className: `ds-confidence-bar__seg${m < r ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2707
2707
|
},
|
|
2708
2708
|
m
|
|
2709
2709
|
)) }),
|
|
2710
|
-
|
|
2710
|
+
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
|
|
2711
2711
|
] });
|
|
2712
2712
|
}
|
|
2713
2713
|
const Ls = { add: "+", remove: "-", context: " " };
|
|
@@ -2721,20 +2721,20 @@ function _e({ line: s, lineNumbers: t }) {
|
|
|
2721
2721
|
function Ct({
|
|
2722
2722
|
lines: s = [],
|
|
2723
2723
|
layout: t = "inline",
|
|
2724
|
-
wordWrap:
|
|
2724
|
+
wordWrap: n = !1,
|
|
2725
2725
|
lineNumbers: i = !0,
|
|
2726
2726
|
maxHeight: a,
|
|
2727
|
-
title:
|
|
2727
|
+
title: r
|
|
2728
2728
|
}) {
|
|
2729
2729
|
const o = [
|
|
2730
2730
|
"ds-diff-view",
|
|
2731
2731
|
`ds-diff-view--${t}`,
|
|
2732
|
-
|
|
2732
|
+
n && "ds-diff-view--wrap"
|
|
2733
2733
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2734
2734
|
if (t === "split") {
|
|
2735
2735
|
const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2736
2736
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2737
|
-
|
|
2737
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2738
2738
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2739
2739
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) }),
|
|
2740
2740
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) })
|
|
@@ -2742,29 +2742,29 @@ function Ct({
|
|
|
2742
2742
|
] });
|
|
2743
2743
|
}
|
|
2744
2744
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2745
|
-
|
|
2745
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2746
2746
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(_e, { line: m, lineNumbers: i }, d)) })
|
|
2747
2747
|
] });
|
|
2748
2748
|
}
|
|
2749
2749
|
function zs({
|
|
2750
2750
|
value: s = "idle",
|
|
2751
2751
|
onLike: t,
|
|
2752
|
-
onDislike:
|
|
2752
|
+
onDislike: n,
|
|
2753
2753
|
className: i = "",
|
|
2754
2754
|
...a
|
|
2755
2755
|
}) {
|
|
2756
|
-
const
|
|
2756
|
+
const r = s !== "idle";
|
|
2757
2757
|
return /* @__PURE__ */ e.jsxs(
|
|
2758
2758
|
"div",
|
|
2759
2759
|
{
|
|
2760
2760
|
className: [
|
|
2761
2761
|
"ds-message-feedback",
|
|
2762
|
-
|
|
2762
|
+
r && "ds-message-feedback--voted",
|
|
2763
2763
|
i
|
|
2764
2764
|
].filter(Boolean).join(" "),
|
|
2765
2765
|
...a,
|
|
2766
2766
|
children: [
|
|
2767
|
-
(!
|
|
2767
|
+
(!r || s === "liked") && /* @__PURE__ */ e.jsx(
|
|
2768
2768
|
"button",
|
|
2769
2769
|
{
|
|
2770
2770
|
className: [
|
|
@@ -2772,11 +2772,11 @@ function zs({
|
|
|
2772
2772
|
s === "liked" && "ds-message-feedback__btn--liked"
|
|
2773
2773
|
].filter(Boolean).join(" "),
|
|
2774
2774
|
onClick: t,
|
|
2775
|
-
disabled:
|
|
2775
|
+
disabled: r,
|
|
2776
2776
|
"aria-label": "Like",
|
|
2777
2777
|
"aria-pressed": s === "liked",
|
|
2778
2778
|
children: /* @__PURE__ */ e.jsx(
|
|
2779
|
-
|
|
2779
|
+
rs,
|
|
2780
2780
|
{
|
|
2781
2781
|
size: I[1],
|
|
2782
2782
|
strokeWidth: 1.5,
|
|
@@ -2785,15 +2785,15 @@ function zs({
|
|
|
2785
2785
|
)
|
|
2786
2786
|
}
|
|
2787
2787
|
),
|
|
2788
|
-
(!
|
|
2788
|
+
(!r || s === "disliked") && /* @__PURE__ */ e.jsx(
|
|
2789
2789
|
"button",
|
|
2790
2790
|
{
|
|
2791
2791
|
className: [
|
|
2792
2792
|
"ds-message-feedback__btn",
|
|
2793
2793
|
s === "disliked" && "ds-message-feedback__btn--disliked"
|
|
2794
2794
|
].filter(Boolean).join(" "),
|
|
2795
|
-
onClick:
|
|
2796
|
-
disabled:
|
|
2795
|
+
onClick: n,
|
|
2796
|
+
disabled: r,
|
|
2797
2797
|
"aria-label": "Dislike",
|
|
2798
2798
|
"aria-pressed": s === "disliked",
|
|
2799
2799
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -2813,23 +2813,23 @@ function zs({
|
|
|
2813
2813
|
function Os(s) {
|
|
2814
2814
|
const t = s instanceof Date ? s : new Date(s);
|
|
2815
2815
|
if (isNaN(t)) return null;
|
|
2816
|
-
const
|
|
2816
|
+
const n = /* @__PURE__ */ new Date(), i = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(n.getFullYear(), n.getMonth(), n.getDate()), r = new Date(a - 864e5);
|
|
2817
2817
|
if (t >= a) return i;
|
|
2818
|
-
if (t >=
|
|
2818
|
+
if (t >= r) return `Yesterday ${i}`;
|
|
2819
2819
|
const o = t.getDate(), l = t.toLocaleString([], { month: "short" });
|
|
2820
2820
|
return `${o} ${l} ${i}`;
|
|
2821
2821
|
}
|
|
2822
2822
|
function Ut({
|
|
2823
2823
|
role: s = "assistant",
|
|
2824
2824
|
text: t,
|
|
2825
|
-
timestamp:
|
|
2825
|
+
timestamp: n,
|
|
2826
2826
|
feedbackValue: i = "idle",
|
|
2827
2827
|
onLike: a,
|
|
2828
|
-
onDislike:
|
|
2828
|
+
onDislike: r,
|
|
2829
2829
|
className: o = "",
|
|
2830
2830
|
...l
|
|
2831
2831
|
}) {
|
|
2832
|
-
const m = s === "assistant" && (a ||
|
|
2832
|
+
const m = s === "assistant" && (a || r), d = !!t, f = n ? Os(n) : null;
|
|
2833
2833
|
return !m && !d && !f ? null : /* @__PURE__ */ e.jsxs(
|
|
2834
2834
|
"div",
|
|
2835
2835
|
{
|
|
@@ -2837,13 +2837,19 @@ function Ut({
|
|
|
2837
2837
|
...l,
|
|
2838
2838
|
children: [
|
|
2839
2839
|
s === "user" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f }),
|
|
2840
|
-
m && /* @__PURE__ */ e.jsx(zs, { className: "ds-message-action", value: i, onLike: a, onDislike:
|
|
2841
|
-
d && /* @__PURE__ */ e.jsx(
|
|
2840
|
+
m && /* @__PURE__ */ e.jsx(zs, { className: "ds-message-action", value: i, onLike: a, onDislike: r }),
|
|
2841
|
+
d && /* @__PURE__ */ e.jsx(Ds, { className: "ds-message-action", text: t }),
|
|
2842
2842
|
s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f })
|
|
2843
2843
|
]
|
|
2844
2844
|
}
|
|
2845
2845
|
);
|
|
2846
2846
|
}
|
|
2847
|
+
function Vt({ label: s, className: t = "", ...n }) {
|
|
2848
|
+
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...n, children: [
|
|
2849
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
2850
|
+
s && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: s })
|
|
2851
|
+
] });
|
|
2852
|
+
}
|
|
2847
2853
|
export {
|
|
2848
2854
|
Ee as Accordion,
|
|
2849
2855
|
Qs as Alert,
|
|
@@ -2859,13 +2865,13 @@ export {
|
|
|
2859
2865
|
st as Code,
|
|
2860
2866
|
ms as CodeAccordion,
|
|
2861
2867
|
Wt as ConfidenceBar,
|
|
2862
|
-
|
|
2868
|
+
Ds as CopyButton,
|
|
2863
2869
|
Ct as DiffView,
|
|
2864
2870
|
gt as Drawer,
|
|
2865
2871
|
Be as DrawerFooter,
|
|
2866
2872
|
kt as Dropdown,
|
|
2867
|
-
|
|
2868
|
-
|
|
2873
|
+
jt as EmptyState,
|
|
2874
|
+
bt as FormField,
|
|
2869
2875
|
Ks as H1,
|
|
2870
2876
|
Xs as H2,
|
|
2871
2877
|
Gs as H3,
|
|
@@ -2885,7 +2891,7 @@ export {
|
|
|
2885
2891
|
Et as ProgressBar,
|
|
2886
2892
|
Lt as PromptInput,
|
|
2887
2893
|
ct as Radio,
|
|
2888
|
-
|
|
2894
|
+
At as ReasoningBlock,
|
|
2889
2895
|
at as SegmentedControl,
|
|
2890
2896
|
Ys as Select,
|
|
2891
2897
|
xs as Skeleton,
|
|
@@ -2895,25 +2901,26 @@ export {
|
|
|
2895
2901
|
It as StepIndicator,
|
|
2896
2902
|
Hs as Stepper,
|
|
2897
2903
|
Bt as StreamingText,
|
|
2898
|
-
|
|
2904
|
+
rt as Tab,
|
|
2899
2905
|
ut as Table,
|
|
2900
2906
|
mt as TableBody,
|
|
2901
2907
|
ft as TableHead,
|
|
2902
2908
|
pt as TableRow,
|
|
2903
2909
|
ht as TableSubheaderRow,
|
|
2904
|
-
|
|
2910
|
+
nt as Tabs,
|
|
2905
2911
|
_t as Td,
|
|
2906
2912
|
Vs as Textarea,
|
|
2907
2913
|
xt as Th,
|
|
2914
|
+
Vt as ThinkingDot,
|
|
2908
2915
|
St as ToastContainer,
|
|
2909
2916
|
ot as Toggle,
|
|
2910
2917
|
Ft as TokenCounter,
|
|
2911
|
-
|
|
2912
|
-
|
|
2918
|
+
Dt as ToolCallBubble,
|
|
2919
|
+
Dt as ToolCallCard,
|
|
2913
2920
|
it as Tooltip,
|
|
2914
2921
|
I as iconSizes,
|
|
2915
2922
|
ks as useAnimatedNumber,
|
|
2916
|
-
|
|
2923
|
+
As as useAnimatedPlaceholder,
|
|
2917
2924
|
Es as useInView,
|
|
2918
2925
|
Pt as useStreamScroll,
|
|
2919
2926
|
Rt as useToast
|