@donkit-ai/design-system 1.4.47 → 1.4.49
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 +2 -2
- package/dist/index.es.js +422 -419
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import U, { useState as D, useRef as k, useEffect as B, useLayoutEffect as Ve } from "react";
|
|
2
|
-
import { Check as we, X as te, ChevronDown as xe, Minus as Ye, Plus as qe, XCircle as ge, AlertTriangle as ye, CheckCircle as ke, Info as Ee, ChevronUp as He, ChevronsUpDown as Ke, ChevronLeft as Xe, ChevronRight as Ge, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Se, Square as es, ArrowUp as ss, Zap as ts, Cpu as De, FileText as
|
|
2
|
+
import { Check as we, X as te, ChevronDown as xe, Minus as Ye, Plus as qe, XCircle as ge, AlertTriangle as ye, CheckCircle as ke, Info as Ee, ChevronUp as He, ChevronsUpDown as Ke, ChevronLeft as Xe, ChevronRight as Ge, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Se, Square as es, ArrowUp as ss, Zap as ts, Cpu as De, FileText as rs, ThumbsUp as ns, ThumbsDown as as } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const I = {
|
|
5
5
|
1: 16,
|
|
@@ -23,22 +23,22 @@ function os() {
|
|
|
23
23
|
if (Ie) return fe;
|
|
24
24
|
Ie = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
26
|
-
function
|
|
26
|
+
function r(o, a, n) {
|
|
27
27
|
var i = null;
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (n !== void 0 && (i = "" + n), a.key !== void 0 && (i = "" + a.key), "key" in a) {
|
|
29
|
+
n = {};
|
|
30
30
|
for (var l in a)
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return a =
|
|
31
|
+
l !== "key" && (n[l] = a[l]);
|
|
32
|
+
} else n = a;
|
|
33
|
+
return a = n.ref, {
|
|
34
34
|
$$typeof: s,
|
|
35
35
|
type: o,
|
|
36
36
|
key: i,
|
|
37
37
|
ref: a !== void 0 ? a : null,
|
|
38
|
-
props:
|
|
38
|
+
props: n
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return fe.Fragment = t, fe.jsx =
|
|
41
|
+
return fe.Fragment = t, fe.jsx = r, fe.jsxs = r, fe;
|
|
42
42
|
}
|
|
43
43
|
var me = {};
|
|
44
44
|
/**
|
|
@@ -63,7 +63,7 @@ function is() {
|
|
|
63
63
|
return "Fragment";
|
|
64
64
|
case L:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case E:
|
|
67
67
|
return "StrictMode";
|
|
68
68
|
case A:
|
|
69
69
|
return "Suspense";
|
|
@@ -99,7 +99,7 @@ function is() {
|
|
|
99
99
|
function t(c) {
|
|
100
100
|
return "" + c;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function r(c) {
|
|
103
103
|
try {
|
|
104
104
|
t(c);
|
|
105
105
|
var w = !1;
|
|
@@ -131,7 +131,7 @@ function is() {
|
|
|
131
131
|
var c = X.A;
|
|
132
132
|
return c === null ? null : c.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function n() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(c) {
|
|
@@ -143,7 +143,7 @@ function is() {
|
|
|
143
143
|
}
|
|
144
144
|
function l(c, w) {
|
|
145
145
|
function P() {
|
|
146
|
-
|
|
146
|
+
$ || ($ = !0, console.error(
|
|
147
147
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
148
148
|
w
|
|
149
149
|
));
|
|
@@ -159,7 +159,7 @@ function is() {
|
|
|
159
159
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
160
160
|
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
161
161
|
}
|
|
162
|
-
function d(c, w, P, O,
|
|
162
|
+
function d(c, w, P, O, re, ae) {
|
|
163
163
|
var W = P.ref;
|
|
164
164
|
return c = {
|
|
165
165
|
$$typeof: b,
|
|
@@ -184,7 +184,7 @@ function is() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: re
|
|
188
188
|
}), Object.defineProperty(c, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
@@ -192,7 +192,7 @@ function is() {
|
|
|
192
192
|
value: ae
|
|
193
193
|
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
194
194
|
}
|
|
195
|
-
function f(c, w, P, O,
|
|
195
|
+
function f(c, w, P, O, re, ae) {
|
|
196
196
|
var W = w.children;
|
|
197
197
|
if (W !== void 0)
|
|
198
198
|
if (O)
|
|
@@ -223,7 +223,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
W
|
|
224
224
|
), g[W + O] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (W = null, P !== void 0 && (
|
|
226
|
+
if (W = null, P !== void 0 && (r(P), W = "" + P), i(w) && (r(w.key), W = "" + w.key), "key" in w) {
|
|
227
227
|
P = {};
|
|
228
228
|
for (var oe in w)
|
|
229
229
|
oe !== "key" && (P[oe] = w[oe]);
|
|
@@ -236,7 +236,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
236
|
W,
|
|
237
237
|
P,
|
|
238
238
|
a(),
|
|
239
|
-
|
|
239
|
+
re,
|
|
240
240
|
ae
|
|
241
241
|
);
|
|
242
242
|
}
|
|
@@ -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 === b;
|
|
248
248
|
}
|
|
249
|
-
var u = U, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), R = Symbol.for("react.fragment"),
|
|
249
|
+
var u = U, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), T = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), q = Symbol.for("react.suspense_list"), H = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), v = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), X = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, x = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
u = {
|
|
@@ -254,10 +254,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
254
254
|
return c();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
257
|
+
var $, M = {}, K = u.react_stack_bottom_frame.bind(
|
|
258
258
|
u,
|
|
259
|
-
|
|
260
|
-
)(), G = N(o(
|
|
259
|
+
n
|
|
260
|
+
)(), G = N(o(n)), g = {};
|
|
261
261
|
me.Fragment = R, me.jsx = function(c, w, P) {
|
|
262
262
|
var O = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return f(
|
|
@@ -283,11 +283,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
283
283
|
}
|
|
284
284
|
process.env.NODE_ENV === "production" ? _e.exports = os() : _e.exports = is();
|
|
285
285
|
var e = _e.exports;
|
|
286
|
-
function ls({ size: s = "m", color: t = "default", className:
|
|
286
|
+
function ls({ size: s = "m", color: t = "default", className: r = "", ...o }) {
|
|
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}`, r].filter(Boolean).join(" "),
|
|
291
291
|
role: "status",
|
|
292
292
|
"aria-label": "Loading",
|
|
293
293
|
...o
|
|
@@ -298,10 +298,10 @@ const cs = { xs: 12, s: 14, m: 16, l: 20 };
|
|
|
298
298
|
function ce({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
301
|
-
size:
|
|
301
|
+
size: r = "m",
|
|
302
302
|
fullWidth: o = !1,
|
|
303
303
|
icon: a,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: n = !1,
|
|
305
305
|
state: i = "idle",
|
|
306
306
|
onClick: l,
|
|
307
307
|
type: m = "button",
|
|
@@ -310,20 +310,20 @@ function ce({
|
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const u = a && !s, b = i === "loading", j = i === "success", R = i === "error",
|
|
313
|
+
const u = a && !s, b = i === "loading", j = i === "success", R = i === "error", E = b || j || R, L = r === "xs" ? "s" : "m", y = t === "danger" ? "on-accent" : "default", T = cs[r] ?? 16, z = b ? /* @__PURE__ */ e.jsx(ls, { size: L, color: y }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(we, { size: T, strokeWidth: 2.5 }) }) : R ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(te, { size: T, strokeWidth: 2.5 }) }) : null, A = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
|
-
`ds-button--${
|
|
316
|
+
`ds-button--${r}`,
|
|
317
317
|
o && "ds-button--full",
|
|
318
318
|
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
320
|
].filter(Boolean).join(" "), q = i !== "idle" ? i : void 0, H = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
|
-
|
|
321
|
+
E ? z : 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 F = (v) => {
|
|
326
|
-
if (
|
|
326
|
+
if (n || b) {
|
|
327
327
|
v.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
@@ -333,10 +333,10 @@ function ce({
|
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: A,
|
|
336
|
-
href:
|
|
336
|
+
href: n || b ? void 0 : d,
|
|
337
337
|
onClick: F,
|
|
338
338
|
"aria-label": f,
|
|
339
|
-
"aria-disabled":
|
|
339
|
+
"aria-disabled": n || b ? "true" : void 0,
|
|
340
340
|
"aria-busy": b ? "true" : void 0,
|
|
341
341
|
"data-state": q,
|
|
342
342
|
...h,
|
|
@@ -349,7 +349,7 @@ function ce({
|
|
|
349
349
|
{
|
|
350
350
|
type: m,
|
|
351
351
|
className: A,
|
|
352
|
-
disabled:
|
|
352
|
+
disabled: n,
|
|
353
353
|
onClick: b ? void 0 : l,
|
|
354
354
|
"aria-label": f,
|
|
355
355
|
"aria-busy": b ? "true" : void 0,
|
|
@@ -362,17 +362,17 @@ function ce({
|
|
|
362
362
|
function Vs({
|
|
363
363
|
label: s,
|
|
364
364
|
error: t,
|
|
365
|
-
hint:
|
|
365
|
+
hint: r,
|
|
366
366
|
fullWidth: o = !0,
|
|
367
367
|
icon: a,
|
|
368
|
-
iconRight:
|
|
368
|
+
iconRight: n,
|
|
369
369
|
onIconRightClick: i,
|
|
370
370
|
size: l = "m",
|
|
371
371
|
disabled: m,
|
|
372
372
|
id: d,
|
|
373
373
|
...f
|
|
374
374
|
}) {
|
|
375
|
-
const p = d || `input-${U.useId()}`, h =
|
|
375
|
+
const p = d || `input-${U.useId()}`, h = r ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, b = u || h;
|
|
376
376
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${o ? "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 Vs({
|
|
|
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" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
385
385
|
disabled: m,
|
|
386
386
|
"aria-invalid": t ? "true" : "false",
|
|
387
387
|
"aria-describedby": b,
|
|
388
388
|
...f
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
|
|
391
|
+
n && /* @__PURE__ */ e.jsx(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
@@ -396,59 +396,59 @@ function Vs({
|
|
|
396
396
|
onClick: i,
|
|
397
397
|
tabIndex: -1,
|
|
398
398
|
"aria-label": "Toggle visibility",
|
|
399
|
-
children:
|
|
399
|
+
children: n
|
|
400
400
|
}
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
403
|
-
|
|
403
|
+
r && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: r }),
|
|
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 Ys({
|
|
408
408
|
label: s,
|
|
409
409
|
error: t,
|
|
410
|
-
hint:
|
|
410
|
+
hint: r,
|
|
411
411
|
fullWidth: o = !0,
|
|
412
412
|
size: a = "m",
|
|
413
|
-
disabled:
|
|
413
|
+
disabled: n,
|
|
414
414
|
id: i,
|
|
415
415
|
resize: l = !0,
|
|
416
416
|
rows: m = 3,
|
|
417
417
|
...d
|
|
418
418
|
}) {
|
|
419
|
-
const f = i || `textarea-${U.useId()}`, p =
|
|
420
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${o ? "ds-textarea-wrapper--full" : ""} ${
|
|
419
|
+
const f = i || `textarea-${U.useId()}`, p = r ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, u = h || p;
|
|
420
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${o ? "ds-textarea-wrapper--full" : ""} ${n ? "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: n,
|
|
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
|
+
r && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: r }),
|
|
435
435
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
438
|
function qs({
|
|
439
439
|
label: s,
|
|
440
440
|
value: t,
|
|
441
|
-
onChange:
|
|
441
|
+
onChange: r,
|
|
442
442
|
options: o = [],
|
|
443
443
|
placeholder: a = "Select option",
|
|
444
|
-
error:
|
|
444
|
+
error: n,
|
|
445
445
|
fullWidth: i = !0,
|
|
446
446
|
size: l = "m",
|
|
447
447
|
disabled: m = !1,
|
|
448
448
|
id: d,
|
|
449
449
|
...f
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = D(!1), [u, b] = D(!1), [j, R] = D({}), [
|
|
451
|
+
const [p, h] = D(!1), [u, b] = D(!1), [j, R] = D({}), [E, L] = D("down"), [y, T] = D(-1), z = k(null), A = k(null), q = k(null), H = k(null), F = d || `select-${U.useId()}`, v = `${F}-label`, C = n ? `${F}-error` : void 0, X = 150, V = (g = !1) => {
|
|
452
452
|
u || (b(!0), T(-1), H.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
454
|
h(!1), b(!1), g && ((c = q.current) == null || c.focus());
|
|
@@ -463,9 +463,9 @@ function qs({
|
|
|
463
463
|
var ae;
|
|
464
464
|
const g = (ae = z.current) == null ? void 0 : ae.getBoundingClientRect();
|
|
465
465
|
if (!g) return;
|
|
466
|
-
const c = window.innerHeight, w = c - g.bottom, P = g.top,
|
|
467
|
-
L(
|
|
468
|
-
|
|
466
|
+
const c = window.innerHeight, w = c - g.bottom, P = g.top, re = w < 300 && P > w;
|
|
467
|
+
L(re ? "up" : "down"), R(
|
|
468
|
+
re ? { bottom: c - g.top + 4, left: g.left, width: g.width } : { top: g.bottom + 4, left: g.left, width: g.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
471
471
|
B(() => {
|
|
@@ -483,7 +483,7 @@ function qs({
|
|
|
483
483
|
if (!p || y < 0 || !A.current) return;
|
|
484
484
|
(c = A.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [y, p]);
|
|
486
|
-
const
|
|
486
|
+
const $ = (g) => {
|
|
487
487
|
switch (g.key) {
|
|
488
488
|
case "ArrowDown":
|
|
489
489
|
g.preventDefault(), p ? T((c) => Math.min(c + 1, o.length - 1)) : x();
|
|
@@ -499,7 +499,7 @@ function qs({
|
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
g.preventDefault(), p ? y >= 0 && (
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (r == null || r(o[y].value), V(!0)) : x();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
505
|
p && (g.preventDefault(), V(!0));
|
|
@@ -512,13 +512,14 @@ function qs({
|
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
514
|
ref: A,
|
|
515
|
+
"data-ds-portal": "",
|
|
515
516
|
role: "listbox",
|
|
516
517
|
"aria-labelledby": s ? v : void 0,
|
|
517
518
|
tabIndex: -1,
|
|
518
519
|
className: [
|
|
519
520
|
"ds-select-dropdown ds-scrollable",
|
|
520
521
|
`ds-select-dropdown--${l}`,
|
|
521
|
-
`ds-select-dropdown--${
|
|
522
|
+
`ds-select-dropdown--${E}`,
|
|
522
523
|
u && "ds-select-dropdown--closing"
|
|
523
524
|
].filter(Boolean).join(" "),
|
|
524
525
|
style: j,
|
|
@@ -537,7 +538,7 @@ function qs({
|
|
|
537
538
|
c === y && "ds-select-option--active"
|
|
538
539
|
].filter(Boolean).join(" "),
|
|
539
540
|
onClick: () => {
|
|
540
|
-
|
|
541
|
+
r == null || r(g.value), V(!0);
|
|
541
542
|
},
|
|
542
543
|
children: g.label
|
|
543
544
|
},
|
|
@@ -558,13 +559,13 @@ function qs({
|
|
|
558
559
|
"aria-expanded": p,
|
|
559
560
|
"aria-activedescendant": p && y >= 0 ? `${F}-opt-${y}` : void 0,
|
|
560
561
|
"aria-labelledby": s ? v : void 0,
|
|
561
|
-
"aria-invalid":
|
|
562
|
+
"aria-invalid": n ? "true" : "false",
|
|
562
563
|
"aria-describedby": C,
|
|
563
|
-
className: `ds-select-trigger ds-select-trigger--${l} ${
|
|
564
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${n ? "ds-select-trigger--error" : ""}`,
|
|
564
565
|
onClick: () => {
|
|
565
566
|
m || (p ? V() : x());
|
|
566
567
|
},
|
|
567
|
-
onKeyDown:
|
|
568
|
+
onKeyDown: $,
|
|
568
569
|
disabled: m,
|
|
569
570
|
...f,
|
|
570
571
|
children: [
|
|
@@ -574,24 +575,24 @@ function qs({
|
|
|
574
575
|
{
|
|
575
576
|
size: K,
|
|
576
577
|
strokeWidth: 1.5,
|
|
577
|
-
className: `ds-select-icon ${p &&
|
|
578
|
+
className: `ds-select-icon ${p && E === "down" ? "ds-select-icon--open" : ""} ${p && E === "up" ? "ds-select-icon--up" : ""}`,
|
|
578
579
|
"aria-hidden": "true"
|
|
579
580
|
}
|
|
580
581
|
)
|
|
581
582
|
]
|
|
582
583
|
}
|
|
583
584
|
) }),
|
|
584
|
-
|
|
585
|
+
n && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: n }),
|
|
585
586
|
typeof document < "u" && pe.createPortal(G, document.body)
|
|
586
587
|
] });
|
|
587
588
|
}
|
|
588
589
|
function Hs({
|
|
589
590
|
label: s,
|
|
590
591
|
value: t = 0,
|
|
591
|
-
onChange:
|
|
592
|
+
onChange: r,
|
|
592
593
|
min: o = 0,
|
|
593
594
|
max: a = 100,
|
|
594
|
-
step:
|
|
595
|
+
step: n = 1,
|
|
595
596
|
size: i = "m",
|
|
596
597
|
disabled: l = !1,
|
|
597
598
|
hint: m,
|
|
@@ -600,23 +601,23 @@ function Hs({
|
|
|
600
601
|
}) {
|
|
601
602
|
const p = () => {
|
|
602
603
|
if (l) return;
|
|
603
|
-
const
|
|
604
|
-
|
|
604
|
+
const E = Math.min(Number(t) + n, a);
|
|
605
|
+
r == null || r(E);
|
|
605
606
|
}, h = () => {
|
|
606
607
|
if (l) return;
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
}, u = (
|
|
608
|
+
const E = Math.max(Number(t) - n, o);
|
|
609
|
+
r == null || r(E);
|
|
610
|
+
}, u = (E) => {
|
|
610
611
|
if (l) return;
|
|
611
|
-
const L =
|
|
612
|
+
const L = E.target.value;
|
|
612
613
|
if (L === "") {
|
|
613
|
-
|
|
614
|
+
r == null || r(o);
|
|
614
615
|
return;
|
|
615
616
|
}
|
|
616
617
|
const y = Number(L);
|
|
617
618
|
if (!isNaN(y)) {
|
|
618
619
|
const T = Math.min(Math.max(y, o), a);
|
|
619
|
-
|
|
620
|
+
r == null || r(T);
|
|
620
621
|
}
|
|
621
622
|
}, b = [
|
|
622
623
|
"ds-stepper-wrapper",
|
|
@@ -650,7 +651,7 @@ function Hs({
|
|
|
650
651
|
onChange: u,
|
|
651
652
|
min: o,
|
|
652
653
|
max: a,
|
|
653
|
-
step:
|
|
654
|
+
step: n,
|
|
654
655
|
disabled: l,
|
|
655
656
|
...f
|
|
656
657
|
}
|
|
@@ -674,20 +675,20 @@ function Hs({
|
|
|
674
675
|
function Ks({
|
|
675
676
|
children: s,
|
|
676
677
|
padding: t = "m",
|
|
677
|
-
variant:
|
|
678
|
+
variant: r = "info",
|
|
678
679
|
hover: o = !1,
|
|
679
680
|
// deprecated, use variant="interactive"
|
|
680
681
|
onClick: a,
|
|
681
|
-
href:
|
|
682
|
+
href: n,
|
|
682
683
|
disabled: i = !1,
|
|
683
684
|
...l
|
|
684
685
|
}) {
|
|
685
|
-
const d = (o ? "interactive" :
|
|
686
|
+
const d = (o ? "interactive" : r) === "interactive" || a || n, f = [
|
|
686
687
|
"ds-card",
|
|
687
688
|
`ds-card--${t}`,
|
|
688
689
|
d && "ds-card--interactive"
|
|
689
690
|
].filter(Boolean).join(" ");
|
|
690
|
-
if (
|
|
691
|
+
if (n) {
|
|
691
692
|
const u = (b) => {
|
|
692
693
|
if (i) {
|
|
693
694
|
b.preventDefault();
|
|
@@ -699,7 +700,7 @@ function Ks({
|
|
|
699
700
|
"a",
|
|
700
701
|
{
|
|
701
702
|
className: f,
|
|
702
|
-
href: i ? void 0 :
|
|
703
|
+
href: i ? void 0 : n,
|
|
703
704
|
onClick: u,
|
|
704
705
|
"aria-disabled": i ? "true" : void 0,
|
|
705
706
|
...l,
|
|
@@ -735,28 +736,28 @@ function Js({ children: s, ...t }) {
|
|
|
735
736
|
function Zs({ children: s, ...t }) {
|
|
736
737
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
737
738
|
}
|
|
738
|
-
function Qs({ children: s, secondary: t = !1, ...
|
|
739
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...
|
|
739
|
+
function Qs({ children: s, secondary: t = !1, ...r }) {
|
|
740
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...r, children: s });
|
|
740
741
|
}
|
|
741
|
-
function ds({ children: s, secondary: t = !1, ...
|
|
742
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...
|
|
742
|
+
function ds({ children: s, secondary: t = !1, ...r }) {
|
|
743
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...r, children: s });
|
|
743
744
|
}
|
|
744
|
-
function Fe({ children: s, secondary: t = !1, ...
|
|
745
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...
|
|
745
|
+
function Fe({ children: s, secondary: t = !1, ...r }) {
|
|
746
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...r, children: s });
|
|
746
747
|
}
|
|
747
748
|
function de({
|
|
748
749
|
children: s,
|
|
749
750
|
variant: t = "default",
|
|
750
|
-
size:
|
|
751
|
+
size: r = "m",
|
|
751
752
|
role: o,
|
|
752
753
|
...a
|
|
753
754
|
}) {
|
|
754
|
-
const
|
|
755
|
+
const n = [
|
|
755
756
|
"ds-badge",
|
|
756
757
|
`ds-badge--${t}`,
|
|
757
|
-
`ds-badge--${
|
|
758
|
+
`ds-badge--${r}`
|
|
758
759
|
].filter(Boolean).join(" "), i = o || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
759
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
760
|
+
return /* @__PURE__ */ e.jsx("span", { className: n, role: i, ...a, children: s });
|
|
760
761
|
}
|
|
761
762
|
const us = {
|
|
762
763
|
info: Ee,
|
|
@@ -767,16 +768,16 @@ const us = {
|
|
|
767
768
|
function et({
|
|
768
769
|
children: s,
|
|
769
770
|
variant: t = "info",
|
|
770
|
-
title:
|
|
771
|
+
title: r,
|
|
771
772
|
onClose: o,
|
|
772
773
|
role: a,
|
|
773
|
-
...
|
|
774
|
+
...n
|
|
774
775
|
}) {
|
|
775
776
|
const i = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${
|
|
777
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${r ? "" : "ds-alert--no-title"}`, role: l, ...n, children: [
|
|
777
778
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(i, { size: I[3], strokeWidth: 1.5 }) }),
|
|
778
779
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
|
-
|
|
780
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
780
781
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
781
782
|
] }),
|
|
782
783
|
o && /* @__PURE__ */ e.jsx(
|
|
@@ -795,27 +796,27 @@ const fs = 200;
|
|
|
795
796
|
function st({
|
|
796
797
|
children: s,
|
|
797
798
|
title: t,
|
|
798
|
-
onClose:
|
|
799
|
+
onClose: r,
|
|
799
800
|
size: o = "m",
|
|
800
801
|
scrollable: a = !1,
|
|
801
|
-
subHeader:
|
|
802
|
+
subHeader: n,
|
|
802
803
|
...i
|
|
803
804
|
}) {
|
|
804
805
|
const l = k(null), m = U.useId(), [d, f] = D(!1), p = () => {
|
|
805
|
-
!
|
|
806
|
-
f(!1),
|
|
806
|
+
!r || d || (f(!0), setTimeout(() => {
|
|
807
|
+
f(!1), r();
|
|
807
808
|
}, fs));
|
|
808
809
|
};
|
|
809
810
|
B(() => {
|
|
810
|
-
const j = (
|
|
811
|
-
|
|
812
|
-
}, R = (
|
|
813
|
-
l.current && !l.current.contains(
|
|
811
|
+
const j = (E) => {
|
|
812
|
+
E.key === "Escape" && p();
|
|
813
|
+
}, R = (E) => {
|
|
814
|
+
l.current && !l.current.contains(E.target) && !E.target.closest("[data-ds-portal]") && p();
|
|
814
815
|
};
|
|
815
816
|
return document.addEventListener("keydown", j), document.addEventListener("mousedown", R), () => {
|
|
816
817
|
document.removeEventListener("keydown", j), document.removeEventListener("mousedown", R);
|
|
817
818
|
};
|
|
818
|
-
}, [
|
|
819
|
+
}, [r, d]);
|
|
819
820
|
const h = U.Children.toArray(s), u = h.find((j) => (j == null ? void 0 : j.type) === he), b = h.filter((j) => (j == null ? void 0 : j.type) !== he);
|
|
820
821
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
|
|
821
822
|
"div",
|
|
@@ -826,10 +827,10 @@ function st({
|
|
|
826
827
|
"aria-modal": "true",
|
|
827
828
|
"aria-labelledby": t ? m : void 0,
|
|
828
829
|
children: [
|
|
829
|
-
(t ||
|
|
830
|
-
(t ||
|
|
830
|
+
(t || r || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
831
|
+
(t || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header-row", children: [
|
|
831
832
|
t && /* @__PURE__ */ e.jsx("h3", { id: m, className: "ds-modal__title", children: t }),
|
|
832
|
-
|
|
833
|
+
r && /* @__PURE__ */ e.jsx(
|
|
833
834
|
ce,
|
|
834
835
|
{
|
|
835
836
|
variant: "ghost",
|
|
@@ -840,7 +841,7 @@ function st({
|
|
|
840
841
|
}
|
|
841
842
|
)
|
|
842
843
|
] }),
|
|
843
|
-
|
|
844
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: n })
|
|
844
845
|
] }),
|
|
845
846
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: b }),
|
|
846
847
|
u
|
|
@@ -855,25 +856,25 @@ const ms = 320;
|
|
|
855
856
|
function tt({
|
|
856
857
|
children: s,
|
|
857
858
|
title: t,
|
|
858
|
-
onClose:
|
|
859
|
+
onClose: r,
|
|
859
860
|
subHeader: o,
|
|
860
861
|
...a
|
|
861
862
|
}) {
|
|
862
|
-
const
|
|
863
|
-
!
|
|
864
|
-
m(!1),
|
|
863
|
+
const n = k(null), i = U.useId(), [l, m] = D(!1), d = () => {
|
|
864
|
+
!r || l || (m(!0), setTimeout(() => {
|
|
865
|
+
m(!1), r();
|
|
865
866
|
}, ms));
|
|
866
867
|
};
|
|
867
868
|
B(() => {
|
|
868
869
|
const u = (j) => {
|
|
869
870
|
j.key === "Escape" && d();
|
|
870
871
|
}, b = (j) => {
|
|
871
|
-
|
|
872
|
+
n.current && !n.current.contains(j.target) && !j.target.closest("[data-ds-portal]") && d();
|
|
872
873
|
};
|
|
873
874
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
874
875
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
875
876
|
};
|
|
876
|
-
}, [
|
|
877
|
+
}, [r, l]);
|
|
877
878
|
const f = U.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === he), h = f.filter((u) => (u == null ? void 0 : u.type) !== he);
|
|
878
879
|
return /* @__PURE__ */ e.jsx(
|
|
879
880
|
"div",
|
|
@@ -883,17 +884,17 @@ function tt({
|
|
|
883
884
|
children: /* @__PURE__ */ e.jsxs(
|
|
884
885
|
"div",
|
|
885
886
|
{
|
|
886
|
-
ref:
|
|
887
|
+
ref: n,
|
|
887
888
|
className: ["ds-bottom-sheet", l && "ds-bottom-sheet--closing"].filter(Boolean).join(" "),
|
|
888
889
|
role: "dialog",
|
|
889
890
|
"aria-modal": "true",
|
|
890
891
|
"aria-labelledby": t ? i : void 0,
|
|
891
892
|
children: [
|
|
892
893
|
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__handle", "aria-hidden": "true" }),
|
|
893
|
-
(t ||
|
|
894
|
-
(t ||
|
|
894
|
+
(t || r || o) && /* @__PURE__ */ e.jsxs("div", { className: "ds-bottom-sheet__header", children: [
|
|
895
|
+
(t || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-bottom-sheet__header-row", children: [
|
|
895
896
|
t && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-bottom-sheet__title", children: t }),
|
|
896
|
-
|
|
897
|
+
r && /* @__PURE__ */ e.jsx(
|
|
897
898
|
ce,
|
|
898
899
|
{
|
|
899
900
|
variant: "ghost",
|
|
@@ -917,18 +918,18 @@ function tt({
|
|
|
917
918
|
function ps({
|
|
918
919
|
children: s,
|
|
919
920
|
title: t = "Code",
|
|
920
|
-
defaultExpanded:
|
|
921
|
+
defaultExpanded: r = !1,
|
|
921
922
|
expanded: o,
|
|
922
923
|
onToggle: a,
|
|
923
|
-
padding:
|
|
924
|
+
padding: n = "s",
|
|
924
925
|
className: i = "",
|
|
925
926
|
...l
|
|
926
927
|
}) {
|
|
927
|
-
const [m, d] = D(
|
|
928
|
+
const [m, d] = D(r), f = o !== void 0, p = f ? o : m, h = () => {
|
|
928
929
|
f ? a == null || a(!o) : d((b) => !b);
|
|
929
930
|
}, u = [
|
|
930
931
|
"ds-code-accordion",
|
|
931
|
-
`ds-code-accordion--${
|
|
932
|
+
`ds-code-accordion--${n}`,
|
|
932
933
|
p && "ds-code-accordion--expanded",
|
|
933
934
|
i
|
|
934
935
|
].filter(Boolean).join(" ");
|
|
@@ -956,28 +957,28 @@ function ps({
|
|
|
956
957
|
/* @__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 ds-scrollable", children: /* @__PURE__ */ e.jsx("code", { children: s }) }) }) })
|
|
957
958
|
] });
|
|
958
959
|
}
|
|
959
|
-
function
|
|
960
|
-
return t ?
|
|
960
|
+
function rt({ children: s, block: t = !1, collapsible: r = !1, title: o = "Code", defaultExpanded: a = !1, ...n }) {
|
|
961
|
+
return t ? r ? /* @__PURE__ */ e.jsx(ps, { title: o, defaultExpanded: a, ...n, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...n, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...n, children: s });
|
|
961
962
|
}
|
|
962
|
-
function
|
|
963
|
+
function nt({ href: s, children: t, onClick: r, target: o, rel: a, ...n }) {
|
|
963
964
|
const l = o === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
964
965
|
return /* @__PURE__ */ e.jsx(
|
|
965
966
|
"a",
|
|
966
967
|
{
|
|
967
968
|
href: s,
|
|
968
969
|
className: "ds-link",
|
|
969
|
-
onClick:
|
|
970
|
+
onClick: r,
|
|
970
971
|
target: o,
|
|
971
972
|
rel: l,
|
|
972
|
-
...
|
|
973
|
+
...n,
|
|
973
974
|
children: t
|
|
974
975
|
}
|
|
975
976
|
);
|
|
976
977
|
}
|
|
977
|
-
function at({ children: s, size: t = "m", variant:
|
|
978
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...o, children: U.Children.map(s, (a) => U.isValidElement(a) ? U.cloneElement(a, { size: t, variant:
|
|
978
|
+
function at({ children: s, size: t = "m", variant: r = "ghost", ...o }) {
|
|
979
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...o, children: U.Children.map(s, (a) => U.isValidElement(a) ? U.cloneElement(a, { size: t, variant: r }) : a) });
|
|
979
980
|
}
|
|
980
|
-
function ot({ children: s, selected: t = !1, onClick:
|
|
981
|
+
function ot({ children: s, selected: t = !1, onClick: r, size: o = "m", variant: a = "ghost", disabled: n = !1, icon: i, href: l, ...m }) {
|
|
981
982
|
const d = i && !s, f = [
|
|
982
983
|
"ds-tab",
|
|
983
984
|
`ds-tab--${o}`,
|
|
@@ -990,20 +991,20 @@ function ot({ children: s, selected: t = !1, onClick: n, size: o = "m", variant:
|
|
|
990
991
|
] });
|
|
991
992
|
if (l) {
|
|
992
993
|
const h = (u) => {
|
|
993
|
-
if (
|
|
994
|
+
if (n) {
|
|
994
995
|
u.preventDefault();
|
|
995
996
|
return;
|
|
996
997
|
}
|
|
997
|
-
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(),
|
|
998
|
+
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), r == null || r(u));
|
|
998
999
|
};
|
|
999
1000
|
return /* @__PURE__ */ e.jsx(
|
|
1000
1001
|
"a",
|
|
1001
1002
|
{
|
|
1002
1003
|
role: "tab",
|
|
1003
1004
|
"aria-current": t ? "page" : void 0,
|
|
1004
|
-
"aria-disabled":
|
|
1005
|
+
"aria-disabled": n ? "true" : void 0,
|
|
1005
1006
|
className: f,
|
|
1006
|
-
href:
|
|
1007
|
+
href: n ? void 0 : l,
|
|
1007
1008
|
onClick: h,
|
|
1008
1009
|
...m,
|
|
1009
1010
|
children: p
|
|
@@ -1016,24 +1017,24 @@ function ot({ children: s, selected: t = !1, onClick: n, size: o = "m", variant:
|
|
|
1016
1017
|
role: "tab",
|
|
1017
1018
|
"aria-selected": t,
|
|
1018
1019
|
className: f,
|
|
1019
|
-
onClick:
|
|
1020
|
-
disabled:
|
|
1020
|
+
onClick: r,
|
|
1021
|
+
disabled: n,
|
|
1021
1022
|
...m,
|
|
1022
1023
|
children: p
|
|
1023
1024
|
}
|
|
1024
1025
|
);
|
|
1025
1026
|
}
|
|
1026
|
-
function it({ options: s, value: t, onChange:
|
|
1027
|
-
const
|
|
1028
|
-
if (!
|
|
1029
|
-
const u =
|
|
1027
|
+
function it({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1 }) {
|
|
1028
|
+
const n = k(null), i = k(null), [l, m] = D(!1), d = k(!1), f = k(null), p = k(null), h = () => {
|
|
1029
|
+
if (!n.current) return;
|
|
1030
|
+
const u = n.current.querySelector(`[data-value="${t}"]`);
|
|
1030
1031
|
if (!u) return;
|
|
1031
|
-
const b =
|
|
1032
|
-
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = R + "px", i.current.style.width =
|
|
1033
|
-
if (!i.current || !
|
|
1034
|
-
const L =
|
|
1032
|
+
const b = n.current.getBoundingClientRect(), j = u.getBoundingClientRect(), R = j.left - b.left, E = j.width;
|
|
1033
|
+
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = R + "px", i.current.style.width = E + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
1034
|
+
if (!i.current || !n.current) return;
|
|
1035
|
+
const L = n.current.querySelector(`[data-value="${t}"]`);
|
|
1035
1036
|
if (!L) return;
|
|
1036
|
-
const y =
|
|
1037
|
+
const y = n.current.getBoundingClientRect(), T = L.getBoundingClientRect();
|
|
1037
1038
|
i.current.style.transition = "none", i.current.style.left = T.left - y.left + "px", i.current.style.width = T.width + "px";
|
|
1038
1039
|
}));
|
|
1039
1040
|
};
|
|
@@ -1041,11 +1042,11 @@ function it({ options: s, value: t, onChange: n, size: o = "m", disabled: a = !1
|
|
|
1041
1042
|
const u = f.current !== t;
|
|
1042
1043
|
f.current = t, d.current = l && u, h();
|
|
1043
1044
|
}), B(() => {
|
|
1044
|
-
if (!
|
|
1045
|
+
if (!n.current) return;
|
|
1045
1046
|
const u = new ResizeObserver(() => {
|
|
1046
1047
|
d.current = !1, p.current();
|
|
1047
1048
|
});
|
|
1048
|
-
return u.observe(
|
|
1049
|
+
return u.observe(n.current), () => u.disconnect();
|
|
1049
1050
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
1050
1051
|
"div",
|
|
1051
1052
|
{
|
|
@@ -1054,7 +1055,7 @@ function it({ options: s, value: t, onChange: n, size: o = "m", disabled: a = !1
|
|
|
1054
1055
|
`ds-seg--${o}`,
|
|
1055
1056
|
a && "ds-seg--disabled"
|
|
1056
1057
|
].filter(Boolean).join(" "),
|
|
1057
|
-
ref:
|
|
1058
|
+
ref: n,
|
|
1058
1059
|
role: "group",
|
|
1059
1060
|
children: [
|
|
1060
1061
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -1071,7 +1072,7 @@ function it({ options: s, value: t, onChange: n, size: o = "m", disabled: a = !1
|
|
|
1071
1072
|
type: "button",
|
|
1072
1073
|
"data-value": u.value,
|
|
1073
1074
|
className: ["ds-seg__btn", t === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1074
|
-
onClick: () => !a &&
|
|
1075
|
+
onClick: () => !a && r(u.value),
|
|
1075
1076
|
"aria-pressed": t === u.value,
|
|
1076
1077
|
disabled: a,
|
|
1077
1078
|
children: [
|
|
@@ -1088,17 +1089,17 @@ function it({ options: s, value: t, onChange: n, size: o = "m", disabled: a = !1
|
|
|
1088
1089
|
function $e({
|
|
1089
1090
|
children: s,
|
|
1090
1091
|
title: t,
|
|
1091
|
-
defaultExpanded:
|
|
1092
|
+
defaultExpanded: r = !1,
|
|
1092
1093
|
expanded: o,
|
|
1093
1094
|
onToggle: a,
|
|
1094
|
-
padding:
|
|
1095
|
+
padding: n = "m",
|
|
1095
1096
|
...i
|
|
1096
1097
|
}) {
|
|
1097
|
-
const [l, m] = D(
|
|
1098
|
+
const [l, m] = D(r), d = o !== void 0, f = d ? o : l, p = () => {
|
|
1098
1099
|
d ? a == null || a(!o) : m((u) => !u);
|
|
1099
1100
|
}, h = [
|
|
1100
1101
|
"ds-accordion",
|
|
1101
|
-
`ds-accordion--${
|
|
1102
|
+
`ds-accordion--${n}`,
|
|
1102
1103
|
f && "ds-accordion--expanded"
|
|
1103
1104
|
].filter(Boolean).join(" ");
|
|
1104
1105
|
return /* @__PURE__ */ e.jsxs("div", { className: h, ...i, children: [
|
|
@@ -1125,43 +1126,43 @@ function $e({
|
|
|
1125
1126
|
/* @__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 }) }) })
|
|
1126
1127
|
] });
|
|
1127
1128
|
}
|
|
1128
|
-
const
|
|
1129
|
-
function hs(s, t,
|
|
1129
|
+
const ne = 8, le = 8;
|
|
1130
|
+
function hs(s, t, r) {
|
|
1130
1131
|
const o = window.innerWidth;
|
|
1131
|
-
let a,
|
|
1132
|
+
let a, n;
|
|
1132
1133
|
switch (s) {
|
|
1133
1134
|
case "top":
|
|
1134
|
-
a = t.top -
|
|
1135
|
+
a = t.top - r.height - ne, n = t.left + t.width / 2 - r.width / 2;
|
|
1135
1136
|
break;
|
|
1136
1137
|
case "bottom":
|
|
1137
|
-
a = t.bottom +
|
|
1138
|
+
a = t.bottom + ne, n = t.left + t.width / 2 - r.width / 2;
|
|
1138
1139
|
break;
|
|
1139
1140
|
case "left":
|
|
1140
|
-
a = t.top + t.height / 2 -
|
|
1141
|
+
a = t.top + t.height / 2 - r.height / 2, n = t.left - r.width - ne;
|
|
1141
1142
|
break;
|
|
1142
1143
|
case "right":
|
|
1143
|
-
a = t.top + t.height / 2 -
|
|
1144
|
+
a = t.top + t.height / 2 - r.height / 2, n = t.right + ne;
|
|
1144
1145
|
break;
|
|
1145
1146
|
default:
|
|
1146
|
-
a = t.bottom +
|
|
1147
|
+
a = t.bottom + ne, n = t.left;
|
|
1147
1148
|
}
|
|
1148
|
-
const i = Math.max(le, Math.min(o -
|
|
1149
|
+
const i = Math.max(le, Math.min(o - r.width - le, n)), l = n - i;
|
|
1149
1150
|
return { top: a, left: i, arrowOffset: l };
|
|
1150
1151
|
}
|
|
1151
|
-
function xs(s, t,
|
|
1152
|
+
function xs(s, t, r) {
|
|
1152
1153
|
const o = window.innerWidth, a = window.innerHeight;
|
|
1153
|
-
if (s.top >= t +
|
|
1154
|
-
if (a - s.bottom >= t +
|
|
1155
|
-
if (o - s.right >=
|
|
1156
|
-
if (s.left >=
|
|
1157
|
-
const
|
|
1158
|
-
return
|
|
1159
|
-
}
|
|
1160
|
-
function lt({ children: s, content: t, position:
|
|
1161
|
-
const [a,
|
|
1154
|
+
if (s.top >= t + ne + le) return "top";
|
|
1155
|
+
if (a - s.bottom >= t + ne + le) return "bottom";
|
|
1156
|
+
if (o - s.right >= r + ne + le) return "right";
|
|
1157
|
+
if (s.left >= r + ne + le) return "left";
|
|
1158
|
+
const n = Math.max(s.top, a - s.bottom, s.left, o - s.right);
|
|
1159
|
+
return n === s.top ? "top" : n === a - s.bottom ? "bottom" : n === o - s.right ? "right" : "left";
|
|
1160
|
+
}
|
|
1161
|
+
function lt({ children: s, content: t, position: r, ...o }) {
|
|
1162
|
+
const [a, n] = D(!1), [i, l] = D({ visibility: "hidden" }), [m, d] = D(r || "top"), f = k(null), p = k(null), h = k(!1), u = () => {
|
|
1162
1163
|
if (!f.current || !p.current) return;
|
|
1163
|
-
const j = f.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(),
|
|
1164
|
-
d(
|
|
1164
|
+
const j = f.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), E = r || xs(j, R.height, R.width), { top: L, left: y, arrowOffset: T } = hs(E, j, R);
|
|
1165
|
+
d(E), l({
|
|
1165
1166
|
position: "fixed",
|
|
1166
1167
|
top: L,
|
|
1167
1168
|
left: y,
|
|
@@ -1176,10 +1177,10 @@ function lt({ children: s, content: t, position: n, ...o }) {
|
|
|
1176
1177
|
return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1177
1178
|
cancelAnimationFrame(j), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1178
1179
|
};
|
|
1179
|
-
}, [a,
|
|
1180
|
+
}, [a, r]), B(() => {
|
|
1180
1181
|
if (!a) return;
|
|
1181
1182
|
const j = (R) => {
|
|
1182
|
-
f.current && !f.current.contains(R.target) &&
|
|
1183
|
+
f.current && !f.current.contains(R.target) && n(!1);
|
|
1183
1184
|
};
|
|
1184
1185
|
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1185
1186
|
}, [a]), !t) return s;
|
|
@@ -1187,6 +1188,7 @@ function lt({ children: s, content: t, position: n, ...o }) {
|
|
|
1187
1188
|
"div",
|
|
1188
1189
|
{
|
|
1189
1190
|
ref: p,
|
|
1191
|
+
"data-ds-portal": "",
|
|
1190
1192
|
className: `ds-tooltip ds-tooltip--${m}`,
|
|
1191
1193
|
role: "tooltip",
|
|
1192
1194
|
style: i,
|
|
@@ -1199,13 +1201,13 @@ function lt({ children: s, content: t, position: n, ...o }) {
|
|
|
1199
1201
|
ref: f,
|
|
1200
1202
|
className: "ds-tooltip-wrapper",
|
|
1201
1203
|
onMouseEnter: () => {
|
|
1202
|
-
h.current ||
|
|
1204
|
+
h.current || n(!0);
|
|
1203
1205
|
},
|
|
1204
1206
|
onMouseLeave: () => {
|
|
1205
|
-
h.current ||
|
|
1207
|
+
h.current || n(!1);
|
|
1206
1208
|
},
|
|
1207
1209
|
onTouchStart: () => {
|
|
1208
|
-
h.current = !0,
|
|
1210
|
+
h.current = !0, n((j) => !j);
|
|
1209
1211
|
},
|
|
1210
1212
|
...o,
|
|
1211
1213
|
children: [
|
|
@@ -1218,15 +1220,15 @@ function lt({ children: s, content: t, position: n, ...o }) {
|
|
|
1218
1220
|
function ct({
|
|
1219
1221
|
checked: s = !1,
|
|
1220
1222
|
onChange: t,
|
|
1221
|
-
size:
|
|
1223
|
+
size: r = "m",
|
|
1222
1224
|
disabled: o = !1,
|
|
1223
1225
|
label: a,
|
|
1224
|
-
id:
|
|
1226
|
+
id: n,
|
|
1225
1227
|
...i
|
|
1226
1228
|
}) {
|
|
1227
|
-
const l =
|
|
1229
|
+
const l = n || `toggle-${U.useId()}`, m = [
|
|
1228
1230
|
"ds-toggle",
|
|
1229
|
-
`ds-toggle--${
|
|
1231
|
+
`ds-toggle--${r}`,
|
|
1230
1232
|
o && "ds-toggle--disabled"
|
|
1231
1233
|
].filter(Boolean).join(" ");
|
|
1232
1234
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
@@ -1249,17 +1251,17 @@ function ct({
|
|
|
1249
1251
|
function dt({
|
|
1250
1252
|
checked: s = !1,
|
|
1251
1253
|
onChange: t,
|
|
1252
|
-
size:
|
|
1254
|
+
size: r = "m",
|
|
1253
1255
|
disabled: o = !1,
|
|
1254
1256
|
label: a,
|
|
1255
|
-
id:
|
|
1257
|
+
id: n,
|
|
1256
1258
|
...i
|
|
1257
1259
|
}) {
|
|
1258
|
-
const l =
|
|
1260
|
+
const l = n || `checkbox-${U.useId()}`, m = [
|
|
1259
1261
|
"ds-checkbox",
|
|
1260
|
-
`ds-checkbox--${
|
|
1262
|
+
`ds-checkbox--${r}`,
|
|
1261
1263
|
o && "ds-checkbox--disabled"
|
|
1262
|
-
].filter(Boolean).join(" "), d =
|
|
1264
|
+
].filter(Boolean).join(" "), d = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1263
1265
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1264
1266
|
/* @__PURE__ */ e.jsx(
|
|
1265
1267
|
"input",
|
|
@@ -1287,17 +1289,17 @@ function dt({
|
|
|
1287
1289
|
function ut({
|
|
1288
1290
|
checked: s = !1,
|
|
1289
1291
|
onChange: t,
|
|
1290
|
-
size:
|
|
1292
|
+
size: r = "m",
|
|
1291
1293
|
disabled: o = !1,
|
|
1292
1294
|
label: a,
|
|
1293
|
-
name:
|
|
1295
|
+
name: n,
|
|
1294
1296
|
value: i,
|
|
1295
1297
|
id: l,
|
|
1296
1298
|
...m
|
|
1297
1299
|
}) {
|
|
1298
1300
|
const d = l || `radio-${U.useId()}`, f = [
|
|
1299
1301
|
"ds-radio",
|
|
1300
|
-
`ds-radio--${
|
|
1302
|
+
`ds-radio--${r}`,
|
|
1301
1303
|
o && "ds-radio--disabled"
|
|
1302
1304
|
].filter(Boolean).join(" ");
|
|
1303
1305
|
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: d, children: [
|
|
@@ -1310,7 +1312,7 @@ function ut({
|
|
|
1310
1312
|
checked: s,
|
|
1311
1313
|
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1312
1314
|
disabled: o,
|
|
1313
|
-
name:
|
|
1315
|
+
name: n,
|
|
1314
1316
|
value: i,
|
|
1315
1317
|
...m
|
|
1316
1318
|
}
|
|
@@ -1319,25 +1321,25 @@ function ut({
|
|
|
1319
1321
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1320
1322
|
] });
|
|
1321
1323
|
}
|
|
1322
|
-
function bs({ width: s, height: t, shape:
|
|
1324
|
+
function bs({ width: s, height: t, shape: r = "rect", aspectRatio: o, className: a = "", style: n = {}, ...i }) {
|
|
1323
1325
|
return /* @__PURE__ */ e.jsx(
|
|
1324
1326
|
"span",
|
|
1325
1327
|
{
|
|
1326
|
-
className: ["ds-skeleton", `ds-skeleton--${
|
|
1327
|
-
style: { width: s, height: t, aspectRatio: o, ...
|
|
1328
|
+
className: ["ds-skeleton", `ds-skeleton--${r}`, a].filter(Boolean).join(" "),
|
|
1329
|
+
style: { width: s, height: t, aspectRatio: o, ...n },
|
|
1328
1330
|
"aria-hidden": "true",
|
|
1329
1331
|
...i
|
|
1330
1332
|
}
|
|
1331
1333
|
);
|
|
1332
1334
|
}
|
|
1333
|
-
function js({ lines: s = 1, lastLineWidth: t = "70%", gap:
|
|
1335
|
+
function js({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: o = "", style: a = {}, ...n }) {
|
|
1334
1336
|
return /* @__PURE__ */ e.jsx(
|
|
1335
1337
|
"span",
|
|
1336
1338
|
{
|
|
1337
1339
|
className: ["ds-skeleton-text", o].filter(Boolean).join(" "),
|
|
1338
|
-
style: { gap:
|
|
1340
|
+
style: { gap: r, ...a },
|
|
1339
1341
|
"aria-hidden": "true",
|
|
1340
|
-
...
|
|
1342
|
+
...n,
|
|
1341
1343
|
children: Array.from({ length: s }, (i, l) => /* @__PURE__ */ e.jsx(
|
|
1342
1344
|
"span",
|
|
1343
1345
|
{
|
|
@@ -1352,8 +1354,8 @@ function js({ lines: s = 1, lastLineWidth: t = "70%", gap: n, className: o = "",
|
|
|
1352
1354
|
bs.Text = js;
|
|
1353
1355
|
function _s(s) {
|
|
1354
1356
|
let t = 2166136261;
|
|
1355
|
-
for (let
|
|
1356
|
-
t ^= s.charCodeAt(
|
|
1357
|
+
for (let r = 0; r < s.length; r++)
|
|
1358
|
+
t ^= s.charCodeAt(r), t = Math.imul(t, 16777619) >>> 0;
|
|
1357
1359
|
return t % 360;
|
|
1358
1360
|
}
|
|
1359
1361
|
function vs(s) {
|
|
@@ -1361,32 +1363,32 @@ function vs(s) {
|
|
|
1361
1363
|
const t = s.trim().split(/\s+/);
|
|
1362
1364
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1363
1365
|
}
|
|
1364
|
-
function ft({ seed: s, icon: t, src:
|
|
1366
|
+
function ft({ seed: s, icon: t, src: r, size: o = 32, className: a = "", style: n = {}, ...i }) {
|
|
1365
1367
|
const l = _s(s ?? ""), [m, d] = D(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: vs(s) });
|
|
1366
1368
|
return /* @__PURE__ */ e.jsx(
|
|
1367
1369
|
"div",
|
|
1368
1370
|
{
|
|
1369
1371
|
className: ["ds-avatar", a].filter(Boolean).join(" "),
|
|
1370
|
-
style: { width: o, height: o, "--ds-avatar-h": l, ...
|
|
1372
|
+
style: { width: o, height: o, "--ds-avatar-h": l, ...n },
|
|
1371
1373
|
"aria-hidden": "true",
|
|
1372
1374
|
...i,
|
|
1373
|
-
children:
|
|
1375
|
+
children: r && !m ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () => d(!0) }) : f
|
|
1374
1376
|
}
|
|
1375
1377
|
);
|
|
1376
1378
|
}
|
|
1377
1379
|
function mt({
|
|
1378
1380
|
children: s,
|
|
1379
1381
|
size: t = "compact",
|
|
1380
|
-
stickyTop:
|
|
1382
|
+
stickyTop: r,
|
|
1381
1383
|
maxHeight: o,
|
|
1382
1384
|
className: a = "",
|
|
1383
|
-
style:
|
|
1385
|
+
style: n = {},
|
|
1384
1386
|
...i
|
|
1385
1387
|
}) {
|
|
1386
1388
|
const l = {
|
|
1387
1389
|
...o ? { maxHeight: o } : {},
|
|
1388
|
-
...
|
|
1389
|
-
...
|
|
1390
|
+
...r !== void 0 ? { "--ds-table-sticky-top": typeof r == "number" ? `${r}px` : r } : {},
|
|
1391
|
+
...n
|
|
1390
1392
|
};
|
|
1391
1393
|
return /* @__PURE__ */ e.jsx(
|
|
1392
1394
|
"div",
|
|
@@ -1410,17 +1412,17 @@ function pt({ children: s, ...t }) {
|
|
|
1410
1412
|
function ht({ children: s, ...t }) {
|
|
1411
1413
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1412
1414
|
}
|
|
1413
|
-
function xt({ children: s, interactive: t, selected:
|
|
1415
|
+
function xt({ children: s, interactive: t, selected: r, subheader: o, exiting: a, updated: n, className: i = "", onClick: l, ...m }) {
|
|
1414
1416
|
return /* @__PURE__ */ e.jsx(
|
|
1415
1417
|
"tr",
|
|
1416
1418
|
{
|
|
1417
1419
|
className: [
|
|
1418
1420
|
"ds-table-row",
|
|
1419
1421
|
t || l ? "ds-table-row--interactive" : "",
|
|
1420
|
-
|
|
1422
|
+
r ? "ds-table-row--selected" : "",
|
|
1421
1423
|
o ? "ds-table-row--subheader" : "",
|
|
1422
1424
|
a ? "ds-table-row--exiting" : "",
|
|
1423
|
-
|
|
1425
|
+
n ? "ds-table-row--updated" : "",
|
|
1424
1426
|
i
|
|
1425
1427
|
].filter(Boolean).join(" "),
|
|
1426
1428
|
onClick: l,
|
|
@@ -1429,20 +1431,20 @@ function xt({ children: s, interactive: t, selected: n, subheader: o, exiting: a
|
|
|
1429
1431
|
}
|
|
1430
1432
|
);
|
|
1431
1433
|
}
|
|
1432
|
-
function bt({ children: s, colSpan: t = 999, ...
|
|
1433
|
-
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...
|
|
1434
|
+
function bt({ children: s, colSpan: t = 999, ...r }) {
|
|
1435
|
+
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1434
1436
|
}
|
|
1435
|
-
function jt({ children: s, align: t = "left", sortDir:
|
|
1436
|
-
const m = !!o ||
|
|
1437
|
+
function jt({ children: s, align: t = "left", sortDir: r, onSort: o, width: a, className: n = "", style: i = {}, ...l }) {
|
|
1438
|
+
const m = !!o || r !== void 0, d = r === "asc" ? He : r === "desc" ? xe : Ke;
|
|
1437
1439
|
return /* @__PURE__ */ e.jsx(
|
|
1438
1440
|
"th",
|
|
1439
1441
|
{
|
|
1440
1442
|
className: [
|
|
1441
1443
|
"ds-th",
|
|
1442
1444
|
m ? "ds-th--sortable" : "",
|
|
1443
|
-
|
|
1445
|
+
r ? "ds-th--sorted" : "",
|
|
1444
1446
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1445
|
-
|
|
1447
|
+
n
|
|
1446
1448
|
].filter(Boolean).join(" "),
|
|
1447
1449
|
onClick: o,
|
|
1448
1450
|
style: { width: a, ...i },
|
|
@@ -1454,17 +1456,17 @@ function jt({ children: s, align: t = "left", sortDir: n, onSort: o, width: a, c
|
|
|
1454
1456
|
}
|
|
1455
1457
|
);
|
|
1456
1458
|
}
|
|
1457
|
-
function _t({ children: s, align: t = "left", secondary:
|
|
1459
|
+
function _t({ children: s, align: t = "left", secondary: r, muted: o, truncate: a, nowrap: n, className: i = "", ...l }) {
|
|
1458
1460
|
return /* @__PURE__ */ e.jsx(
|
|
1459
1461
|
"td",
|
|
1460
1462
|
{
|
|
1461
1463
|
className: [
|
|
1462
1464
|
"ds-td",
|
|
1463
1465
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1464
|
-
|
|
1466
|
+
r ? "ds-table-cell--secondary" : "",
|
|
1465
1467
|
o ? "ds-table-cell--muted" : "",
|
|
1466
1468
|
a ? "ds-table-cell--truncate" : "",
|
|
1467
|
-
|
|
1469
|
+
n ? "ds-table-cell--nowrap" : "",
|
|
1468
1470
|
i
|
|
1469
1471
|
].filter(Boolean).join(" "),
|
|
1470
1472
|
...l,
|
|
@@ -1475,21 +1477,21 @@ function _t({ children: s, align: t = "left", secondary: n, muted: o, truncate:
|
|
|
1475
1477
|
function vt({
|
|
1476
1478
|
icon: s,
|
|
1477
1479
|
title: t,
|
|
1478
|
-
description:
|
|
1480
|
+
description: r,
|
|
1479
1481
|
action: o,
|
|
1480
1482
|
size: a = "m",
|
|
1481
|
-
className:
|
|
1483
|
+
className: n = "",
|
|
1482
1484
|
...i
|
|
1483
1485
|
}) {
|
|
1484
1486
|
return /* @__PURE__ */ e.jsxs(
|
|
1485
1487
|
"div",
|
|
1486
1488
|
{
|
|
1487
|
-
className: ["ds-empty-state", `ds-empty-state--${a}`,
|
|
1489
|
+
className: ["ds-empty-state", `ds-empty-state--${a}`, n].filter(Boolean).join(" "),
|
|
1488
1490
|
...i,
|
|
1489
1491
|
children: [
|
|
1490
1492
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1491
1493
|
/* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__title", children: t }),
|
|
1492
|
-
|
|
1494
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__description", children: r }),
|
|
1493
1495
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__action", children: o })
|
|
1494
1496
|
]
|
|
1495
1497
|
}
|
|
@@ -1498,21 +1500,21 @@ function vt({
|
|
|
1498
1500
|
function Nt({
|
|
1499
1501
|
label: s,
|
|
1500
1502
|
hint: t,
|
|
1501
|
-
error:
|
|
1503
|
+
error: r,
|
|
1502
1504
|
required: o = !1,
|
|
1503
1505
|
disabled: a = !1,
|
|
1504
|
-
htmlFor:
|
|
1506
|
+
htmlFor: n,
|
|
1505
1507
|
children: i,
|
|
1506
1508
|
className: l = "",
|
|
1507
1509
|
style: m,
|
|
1508
1510
|
...d
|
|
1509
1511
|
}) {
|
|
1510
|
-
const f = U.useId(), p =
|
|
1512
|
+
const f = U.useId(), p = n ?? f, h = `${p}-hint`, u = `${p}-error`;
|
|
1511
1513
|
return /* @__PURE__ */ e.jsxs(
|
|
1512
1514
|
"div",
|
|
1513
1515
|
{
|
|
1514
1516
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1515
|
-
"data-state":
|
|
1517
|
+
"data-state": r ? "error" : void 0,
|
|
1516
1518
|
"data-required": o ? "" : void 0,
|
|
1517
1519
|
"data-disabled": a ? "" : void 0,
|
|
1518
1520
|
style: m,
|
|
@@ -1520,14 +1522,14 @@ function Nt({
|
|
|
1520
1522
|
children: [
|
|
1521
1523
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1522
1524
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
|
|
1523
|
-
t && !
|
|
1524
|
-
|
|
1525
|
+
t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1526
|
+
r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: r })
|
|
1525
1527
|
]
|
|
1526
1528
|
}
|
|
1527
1529
|
);
|
|
1528
1530
|
}
|
|
1529
|
-
function wt({ label: s, value: t, delta:
|
|
1530
|
-
const m =
|
|
1531
|
+
function wt({ label: s, value: t, delta: r, size: o = "m", inline: a = !1, className: n = "", style: i, ...l }) {
|
|
1532
|
+
const m = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
|
|
1531
1533
|
return /* @__PURE__ */ e.jsxs(
|
|
1532
1534
|
"div",
|
|
1533
1535
|
{
|
|
@@ -1535,14 +1537,14 @@ function wt({ label: s, value: t, delta: n, size: o = "m", inline: a = !1, class
|
|
|
1535
1537
|
"ds-stat",
|
|
1536
1538
|
`ds-stat--${o}`,
|
|
1537
1539
|
a && "ds-stat--inline",
|
|
1538
|
-
|
|
1540
|
+
n
|
|
1539
1541
|
].filter(Boolean).join(" "),
|
|
1540
1542
|
style: i,
|
|
1541
1543
|
...l,
|
|
1542
1544
|
children: [
|
|
1543
1545
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1544
1546
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1545
|
-
|
|
1547
|
+
r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: r })
|
|
1546
1548
|
]
|
|
1547
1549
|
}
|
|
1548
1550
|
);
|
|
@@ -1550,19 +1552,19 @@ function wt({ label: s, value: t, delta: n, size: o = "m", inline: a = !1, class
|
|
|
1550
1552
|
function gt({
|
|
1551
1553
|
children: s,
|
|
1552
1554
|
separator: t = "/",
|
|
1553
|
-
"aria-label":
|
|
1555
|
+
"aria-label": r = "Breadcrumb",
|
|
1554
1556
|
className: o = "",
|
|
1555
1557
|
style: a,
|
|
1556
|
-
...
|
|
1558
|
+
...n
|
|
1557
1559
|
}) {
|
|
1558
1560
|
const i = U.Children.toArray(s).filter(Boolean);
|
|
1559
1561
|
return /* @__PURE__ */ e.jsx(
|
|
1560
1562
|
"nav",
|
|
1561
1563
|
{
|
|
1562
1564
|
className: `ds-breadcrumb${o ? ` ${o}` : ""}`,
|
|
1563
|
-
"aria-label":
|
|
1565
|
+
"aria-label": r,
|
|
1564
1566
|
style: a,
|
|
1565
|
-
...
|
|
1567
|
+
...n,
|
|
1566
1568
|
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1567
1569
|
l,
|
|
1568
1570
|
m < i.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
@@ -1573,10 +1575,10 @@ function gt({
|
|
|
1573
1575
|
function yt({
|
|
1574
1576
|
page: s,
|
|
1575
1577
|
total: t,
|
|
1576
|
-
onChange:
|
|
1578
|
+
onChange: r,
|
|
1577
1579
|
siblings: o = 1,
|
|
1578
1580
|
"aria-label": a = "Pagination",
|
|
1579
|
-
className:
|
|
1581
|
+
className: n = "",
|
|
1580
1582
|
style: i,
|
|
1581
1583
|
...l
|
|
1582
1584
|
}) {
|
|
@@ -1584,7 +1586,7 @@ function yt({
|
|
|
1584
1586
|
return /* @__PURE__ */ e.jsxs(
|
|
1585
1587
|
"nav",
|
|
1586
1588
|
{
|
|
1587
|
-
className: `ds-pagination${
|
|
1589
|
+
className: `ds-pagination${n ? ` ${n}` : ""}`,
|
|
1588
1590
|
"aria-label": a,
|
|
1589
1591
|
style: i,
|
|
1590
1592
|
...l,
|
|
@@ -1593,7 +1595,7 @@ function yt({
|
|
|
1593
1595
|
"button",
|
|
1594
1596
|
{
|
|
1595
1597
|
className: "ds-pagination-arrow",
|
|
1596
|
-
onClick: () =>
|
|
1598
|
+
onClick: () => r == null ? void 0 : r(s - 1),
|
|
1597
1599
|
disabled: s <= 1,
|
|
1598
1600
|
"aria-label": "Previous page",
|
|
1599
1601
|
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
@@ -1604,7 +1606,7 @@ function yt({
|
|
|
1604
1606
|
"button",
|
|
1605
1607
|
{
|
|
1606
1608
|
className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
|
|
1607
|
-
onClick: () => d !== s && (
|
|
1609
|
+
onClick: () => d !== s && (r == null ? void 0 : r(d)),
|
|
1608
1610
|
"aria-current": d === s ? "page" : void 0,
|
|
1609
1611
|
"aria-label": `Page ${d}`,
|
|
1610
1612
|
children: d
|
|
@@ -1616,7 +1618,7 @@ function yt({
|
|
|
1616
1618
|
"button",
|
|
1617
1619
|
{
|
|
1618
1620
|
className: "ds-pagination-arrow",
|
|
1619
|
-
onClick: () =>
|
|
1621
|
+
onClick: () => r == null ? void 0 : r(s + 1),
|
|
1620
1622
|
disabled: s >= t,
|
|
1621
1623
|
"aria-label": "Next page",
|
|
1622
1624
|
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
@@ -1626,36 +1628,36 @@ function yt({
|
|
|
1626
1628
|
}
|
|
1627
1629
|
);
|
|
1628
1630
|
}
|
|
1629
|
-
function Ns(s, t,
|
|
1631
|
+
function Ns(s, t, r) {
|
|
1630
1632
|
if (t <= 7) return Array.from({ length: t }, (i, l) => l + 1);
|
|
1631
|
-
const o = Math.max(2, s -
|
|
1632
|
-
o > 2 &&
|
|
1633
|
-
for (let i = o; i <= a; i++)
|
|
1634
|
-
return a < t - 1 &&
|
|
1633
|
+
const o = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
|
|
1634
|
+
o > 2 && n.push("…");
|
|
1635
|
+
for (let i = o; i <= a; i++) n.push(i);
|
|
1636
|
+
return a < t - 1 && n.push("…"), n.push(t), n;
|
|
1635
1637
|
}
|
|
1636
1638
|
const ws = 200;
|
|
1637
1639
|
function kt({
|
|
1638
1640
|
children: s,
|
|
1639
1641
|
title: t,
|
|
1640
|
-
onClose:
|
|
1642
|
+
onClose: r,
|
|
1641
1643
|
side: o = "right",
|
|
1642
1644
|
...a
|
|
1643
1645
|
}) {
|
|
1644
|
-
const
|
|
1645
|
-
!
|
|
1646
|
-
m(!1),
|
|
1646
|
+
const n = k(null), i = U.useId(), [l, m] = D(!1), d = () => {
|
|
1647
|
+
!r || l || (m(!0), setTimeout(() => {
|
|
1648
|
+
m(!1), r();
|
|
1647
1649
|
}, ws));
|
|
1648
1650
|
};
|
|
1649
1651
|
B(() => {
|
|
1650
1652
|
const u = (j) => {
|
|
1651
1653
|
j.key === "Escape" && d();
|
|
1652
1654
|
}, b = (j) => {
|
|
1653
|
-
|
|
1655
|
+
n.current && !n.current.contains(j.target) && !j.target.closest("[data-ds-portal]") && d();
|
|
1654
1656
|
};
|
|
1655
1657
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
1656
1658
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
1657
1659
|
};
|
|
1658
|
-
}, [
|
|
1660
|
+
}, [r, l]);
|
|
1659
1661
|
const f = U.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);
|
|
1660
1662
|
return /* @__PURE__ */ e.jsx(
|
|
1661
1663
|
"div",
|
|
@@ -1667,14 +1669,14 @@ function kt({
|
|
|
1667
1669
|
{
|
|
1668
1670
|
className: ["ds-drawer", l && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1669
1671
|
"data-side": o,
|
|
1670
|
-
ref:
|
|
1672
|
+
ref: n,
|
|
1671
1673
|
role: "dialog",
|
|
1672
1674
|
"aria-modal": "true",
|
|
1673
1675
|
"aria-labelledby": t ? i : void 0,
|
|
1674
1676
|
children: [
|
|
1675
1677
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1676
1678
|
t && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-drawer-title", children: t }),
|
|
1677
|
-
|
|
1679
|
+
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(te, { size: I[2], strokeWidth: 1.5 }) })
|
|
1678
1680
|
] }),
|
|
1679
1681
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children: h }),
|
|
1680
1682
|
p
|
|
@@ -1696,13 +1698,13 @@ const gs = {
|
|
|
1696
1698
|
function Et({
|
|
1697
1699
|
children: s,
|
|
1698
1700
|
variant: t = "info",
|
|
1699
|
-
action:
|
|
1701
|
+
action: r,
|
|
1700
1702
|
onAction: o,
|
|
1701
1703
|
onDismiss: a,
|
|
1702
|
-
role:
|
|
1704
|
+
role: n,
|
|
1703
1705
|
...i
|
|
1704
1706
|
}) {
|
|
1705
|
-
const l = gs[t], m =
|
|
1707
|
+
const l = gs[t], m = n || (t === "error" ? "alert" : "status");
|
|
1706
1708
|
return /* @__PURE__ */ e.jsxs(
|
|
1707
1709
|
"div",
|
|
1708
1710
|
{
|
|
@@ -1712,13 +1714,13 @@ function Et({
|
|
|
1712
1714
|
children: [
|
|
1713
1715
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
1714
1716
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1715
|
-
|
|
1717
|
+
r && /* @__PURE__ */ e.jsx(
|
|
1716
1718
|
"button",
|
|
1717
1719
|
{
|
|
1718
1720
|
type: "button",
|
|
1719
1721
|
className: "ds-banner-action",
|
|
1720
1722
|
onClick: o,
|
|
1721
|
-
children:
|
|
1723
|
+
children: r
|
|
1722
1724
|
}
|
|
1723
1725
|
),
|
|
1724
1726
|
a && /* @__PURE__ */ e.jsx(
|
|
@@ -1738,14 +1740,14 @@ function Et({
|
|
|
1738
1740
|
function $t({
|
|
1739
1741
|
trigger: s,
|
|
1740
1742
|
items: t = [],
|
|
1741
|
-
open:
|
|
1743
|
+
open: r,
|
|
1742
1744
|
onOpenChange: o,
|
|
1743
1745
|
align: a = "left",
|
|
1744
|
-
className:
|
|
1746
|
+
className: n = "",
|
|
1745
1747
|
style: i,
|
|
1746
1748
|
...l
|
|
1747
1749
|
}) {
|
|
1748
|
-
const [m, d] = D(!1), [f, p] = D(!1), h =
|
|
1750
|
+
const [m, d] = D(!1), [f, p] = D(!1), h = r !== void 0, u = h ? r : m, b = k(null), j = k(null), R = k(null), E = k(null), [L, y] = D({}), T = k(null), z = 150, A = () => {
|
|
1749
1751
|
if (h)
|
|
1750
1752
|
o == null || o(!1);
|
|
1751
1753
|
else {
|
|
@@ -1764,11 +1766,11 @@ function $t({
|
|
|
1764
1766
|
if (!u) return;
|
|
1765
1767
|
const x = 300, N = () => {
|
|
1766
1768
|
var G;
|
|
1767
|
-
const
|
|
1768
|
-
if (
|
|
1769
|
-
const M = window.innerHeight -
|
|
1769
|
+
const $ = (G = b.current) == null ? void 0 : G.getBoundingClientRect();
|
|
1770
|
+
if (!$) return;
|
|
1771
|
+
const M = window.innerHeight - $.bottom, K = M < x + 8 && $.top > M;
|
|
1770
1772
|
y(
|
|
1771
|
-
a === "right" ? K ? { bottom: window.innerHeight -
|
|
1773
|
+
a === "right" ? K ? { bottom: window.innerHeight - $.top + 4, top: "auto", right: window.innerWidth - $.right } : { top: $.bottom + 4, bottom: "auto", right: window.innerWidth - $.right } : K ? { bottom: window.innerHeight - $.top + 4, top: "auto", left: $.left } : { top: $.bottom + 4, bottom: "auto", left: $.left }
|
|
1772
1774
|
);
|
|
1773
1775
|
};
|
|
1774
1776
|
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
@@ -1784,42 +1786,42 @@ function $t({
|
|
|
1784
1786
|
};
|
|
1785
1787
|
B(() => {
|
|
1786
1788
|
if (!u) return;
|
|
1787
|
-
const x = (
|
|
1789
|
+
const x = ($) => {
|
|
1788
1790
|
var M, K;
|
|
1789
|
-
!((M = b.current) != null && M.contains(
|
|
1790
|
-
}, N = (
|
|
1791
|
-
|
|
1791
|
+
!((M = b.current) != null && M.contains($.target)) && !((K = j.current) != null && K.contains($.target)) && A();
|
|
1792
|
+
}, N = ($) => {
|
|
1793
|
+
$.key === "Escape" && (A(), F());
|
|
1792
1794
|
};
|
|
1793
1795
|
return document.addEventListener("mousedown", x), document.addEventListener("keydown", N), () => {
|
|
1794
1796
|
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", N);
|
|
1795
1797
|
};
|
|
1796
1798
|
}, [u]), B(() => {
|
|
1797
|
-
if (!u ||
|
|
1798
|
-
const x = v(), N =
|
|
1799
|
-
N == null || N.focus(),
|
|
1799
|
+
if (!u || !E.current || !j.current) return;
|
|
1800
|
+
const x = v(), N = E.current === "last" ? x[x.length - 1] : x[0];
|
|
1801
|
+
N == null || N.focus(), E.current = null;
|
|
1800
1802
|
}, [u]);
|
|
1801
1803
|
const v = () => j.current ? [...j.current.querySelectorAll(
|
|
1802
1804
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1803
1805
|
)] : [], C = (x) => {
|
|
1804
|
-
var N,
|
|
1806
|
+
var N, $;
|
|
1805
1807
|
if (x.key === "ArrowDown")
|
|
1806
|
-
x.preventDefault(), u ? (N = v()[0]) == null || N.focus() : (
|
|
1808
|
+
x.preventDefault(), u ? (N = v()[0]) == null || N.focus() : (E.current = "first", H());
|
|
1807
1809
|
else if (x.key === "ArrowUp")
|
|
1808
1810
|
if (x.preventDefault(), !u)
|
|
1809
|
-
|
|
1811
|
+
E.current = "last", H();
|
|
1810
1812
|
else {
|
|
1811
1813
|
const M = v();
|
|
1812
|
-
(
|
|
1814
|
+
($ = M[M.length - 1]) == null || $.focus();
|
|
1813
1815
|
}
|
|
1814
1816
|
}, X = (x) => {
|
|
1815
1817
|
var M, K, G, g;
|
|
1816
|
-
const N = v(),
|
|
1818
|
+
const N = v(), $ = N.findIndex((c) => c === document.activeElement);
|
|
1817
1819
|
switch (x.key) {
|
|
1818
1820
|
case "ArrowDown":
|
|
1819
|
-
x.preventDefault(), (M = N[Math.min(
|
|
1821
|
+
x.preventDefault(), (M = N[Math.min($ + 1, N.length - 1)]) == null || M.focus();
|
|
1820
1822
|
break;
|
|
1821
1823
|
case "ArrowUp":
|
|
1822
|
-
x.preventDefault(),
|
|
1824
|
+
x.preventDefault(), $ <= 0 ? F() : (K = N[$ - 1]) == null || K.focus();
|
|
1823
1825
|
break;
|
|
1824
1826
|
case "Home":
|
|
1825
1827
|
x.preventDefault(), (G = N[0]) == null || G.focus();
|
|
@@ -1836,6 +1838,7 @@ function $t({
|
|
|
1836
1838
|
{
|
|
1837
1839
|
ref: j,
|
|
1838
1840
|
role: "menu",
|
|
1841
|
+
"data-ds-portal": "",
|
|
1839
1842
|
className: [
|
|
1840
1843
|
"ds-dropdown__menu",
|
|
1841
1844
|
`ds-dropdown__menu--${a}`,
|
|
@@ -1851,7 +1854,7 @@ function $t({
|
|
|
1851
1854
|
x.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
|
|
1852
1855
|
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
|
|
1853
1856
|
] }, N);
|
|
1854
|
-
const
|
|
1857
|
+
const $ = !!x.href, M = $ ? "a" : "button", K = $ ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
|
|
1855
1858
|
return /* @__PURE__ */ e.jsxs(
|
|
1856
1859
|
M,
|
|
1857
1860
|
{
|
|
@@ -1880,7 +1883,7 @@ function $t({
|
|
|
1880
1883
|
"div",
|
|
1881
1884
|
{
|
|
1882
1885
|
ref: b,
|
|
1883
|
-
className: ["ds-dropdown",
|
|
1886
|
+
className: ["ds-dropdown", n].filter(Boolean).join(" "),
|
|
1884
1887
|
style: i,
|
|
1885
1888
|
...l,
|
|
1886
1889
|
children: [
|
|
@@ -1902,19 +1905,19 @@ function $t({
|
|
|
1902
1905
|
function Tt({
|
|
1903
1906
|
value: s = 0,
|
|
1904
1907
|
size: t = "m",
|
|
1905
|
-
variant:
|
|
1908
|
+
variant: r = "default",
|
|
1906
1909
|
showValue: o = !1,
|
|
1907
1910
|
min: a = 2,
|
|
1908
|
-
animate:
|
|
1911
|
+
animate: n = !0
|
|
1909
1912
|
}) {
|
|
1910
|
-
const i = Math.min(100, Math.max(0, s)), l = Math.max(a, i), m =
|
|
1913
|
+
const i = Math.min(100, Math.max(0, s)), l = Math.max(a, i), m = r === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : r;
|
|
1911
1914
|
return /* @__PURE__ */ e.jsxs(
|
|
1912
1915
|
"div",
|
|
1913
1916
|
{
|
|
1914
1917
|
className: [
|
|
1915
1918
|
"ds-progress",
|
|
1916
1919
|
`ds-progress--${t}`,
|
|
1917
|
-
!
|
|
1920
|
+
!n && "ds-progress--instant"
|
|
1918
1921
|
].filter(Boolean).join(" "),
|
|
1919
1922
|
role: "progressbar",
|
|
1920
1923
|
"aria-valuenow": i,
|
|
@@ -1938,7 +1941,7 @@ function Tt({
|
|
|
1938
1941
|
}
|
|
1939
1942
|
const ys = (s) => 1 - Math.pow(1 - s, 3), ks = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1940
1943
|
function Es(s, { duration: t = 600 } = {}) {
|
|
1941
|
-
const [
|
|
1944
|
+
const [r, o] = D(s), a = k(s), n = k(null);
|
|
1942
1945
|
return B(() => {
|
|
1943
1946
|
if (ks()) {
|
|
1944
1947
|
o(s), a.current = s;
|
|
@@ -1950,48 +1953,48 @@ function Es(s, { duration: t = 600 } = {}) {
|
|
|
1950
1953
|
const d = (f) => {
|
|
1951
1954
|
m || (m = f);
|
|
1952
1955
|
const p = Math.min((f - m) / t, 1);
|
|
1953
|
-
o(i + l * ys(p)), p < 1 ?
|
|
1956
|
+
o(i + l * ys(p)), p < 1 ? n.current = requestAnimationFrame(d) : a.current = s;
|
|
1954
1957
|
};
|
|
1955
|
-
return
|
|
1956
|
-
}, [s, t]),
|
|
1958
|
+
return n.current = requestAnimationFrame(d), () => cancelAnimationFrame(n.current);
|
|
1959
|
+
}, [s, t]), r;
|
|
1957
1960
|
}
|
|
1958
1961
|
function Rt({
|
|
1959
1962
|
value: s,
|
|
1960
1963
|
duration: t = 600,
|
|
1961
|
-
decimals:
|
|
1964
|
+
decimals: r = 0,
|
|
1962
1965
|
prefix: o = "",
|
|
1963
1966
|
suffix: a = ""
|
|
1964
1967
|
}) {
|
|
1965
|
-
const i = Es(s, { duration: t }).toFixed(
|
|
1968
|
+
const i = Es(s, { duration: t }).toFixed(r);
|
|
1966
1969
|
return `${o}${i}${a}`;
|
|
1967
1970
|
}
|
|
1968
|
-
function $s({ threshold: s = 0.1, rootMargin: t = "0px", once:
|
|
1969
|
-
const o = k(null), [a,
|
|
1971
|
+
function $s({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
1972
|
+
const o = k(null), [a, n] = D(!1);
|
|
1970
1973
|
return B(() => {
|
|
1971
1974
|
const i = o.current;
|
|
1972
1975
|
if (!i) return;
|
|
1973
1976
|
const l = new IntersectionObserver(
|
|
1974
1977
|
([m]) => {
|
|
1975
|
-
m.isIntersecting ? (
|
|
1978
|
+
m.isIntersecting ? (n(!0), r && l.disconnect()) : r || n(!1);
|
|
1976
1979
|
},
|
|
1977
1980
|
{ threshold: s, rootMargin: t }
|
|
1978
1981
|
);
|
|
1979
1982
|
return l.observe(i), () => l.disconnect();
|
|
1980
|
-
}, [s, t,
|
|
1983
|
+
}, [s, t, r]), { ref: o, inView: a };
|
|
1981
1984
|
}
|
|
1982
1985
|
function St({
|
|
1983
1986
|
children: s,
|
|
1984
1987
|
as: t = "div",
|
|
1985
|
-
once:
|
|
1988
|
+
once: r = !1,
|
|
1986
1989
|
threshold: o = 0.1,
|
|
1987
1990
|
rootMargin: a = "0px",
|
|
1988
|
-
onEnter:
|
|
1991
|
+
onEnter: n,
|
|
1989
1992
|
onLeave: i,
|
|
1990
1993
|
...l
|
|
1991
1994
|
}) {
|
|
1992
|
-
const { ref: m, inView: d } = $s({ threshold: o, rootMargin: a, once:
|
|
1995
|
+
const { ref: m, inView: d } = $s({ threshold: o, rootMargin: a, once: r }), f = k(!1);
|
|
1993
1996
|
return B(() => {
|
|
1994
|
-
d && !f.current && (
|
|
1997
|
+
d && !f.current && (n == null || n()), !d && f.current && (i == null || i()), f.current = d;
|
|
1995
1998
|
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1996
1999
|
}
|
|
1997
2000
|
const Le = {
|
|
@@ -2012,21 +2015,21 @@ function Rs(s) {
|
|
|
2012
2015
|
ue = ue.filter((t) => t.id !== s), We();
|
|
2013
2016
|
}
|
|
2014
2017
|
function Dt() {
|
|
2015
|
-
const s = (t,
|
|
2018
|
+
const s = (t, r = {}) => {
|
|
2016
2019
|
Ts({
|
|
2017
2020
|
id: `${Date.now()}-${Math.random()}`,
|
|
2018
2021
|
message: t,
|
|
2019
2022
|
type: "default",
|
|
2020
2023
|
duration: 4e3,
|
|
2021
|
-
...
|
|
2024
|
+
...r
|
|
2022
2025
|
});
|
|
2023
2026
|
};
|
|
2024
|
-
return s.success = (t,
|
|
2027
|
+
return s.success = (t, r) => s(t, { ...r, type: "success" }), s.error = (t, r) => s(t, { ...r, type: "error" }), s.warning = (t, r) => s(t, { ...r, type: "warning" }), { toast: s };
|
|
2025
2028
|
}
|
|
2026
2029
|
function Ss({ data: s, onDismiss: t }) {
|
|
2027
|
-
const [
|
|
2028
|
-
B(() => (requestAnimationFrame(() => o(!0)), s.duration > 0 && (a.current = setTimeout(() =>
|
|
2029
|
-
function
|
|
2030
|
+
const [r, o] = D(!1), a = k(null);
|
|
2031
|
+
B(() => (requestAnimationFrame(() => o(!0)), s.duration > 0 && (a.current = setTimeout(() => n(), s.duration)), () => clearTimeout(a.current)), []);
|
|
2032
|
+
function n() {
|
|
2030
2033
|
o(!1), setTimeout(() => t(s.id), 250);
|
|
2031
2034
|
}
|
|
2032
2035
|
const i = Le[s.type] ?? Le.default;
|
|
@@ -2036,7 +2039,7 @@ function Ss({ data: s, onDismiss: t }) {
|
|
|
2036
2039
|
className: [
|
|
2037
2040
|
"ds-toast",
|
|
2038
2041
|
`ds-toast--${s.type}`,
|
|
2039
|
-
|
|
2042
|
+
r && "ds-toast--visible"
|
|
2040
2043
|
].filter(Boolean).join(" "),
|
|
2041
2044
|
role: s.type === "error" ? "alert" : "status",
|
|
2042
2045
|
"aria-live": "polite",
|
|
@@ -2047,7 +2050,7 @@ function Ss({ data: s, onDismiss: t }) {
|
|
|
2047
2050
|
"button",
|
|
2048
2051
|
{
|
|
2049
2052
|
className: "ds-toast__close",
|
|
2050
|
-
onClick:
|
|
2053
|
+
onClick: n,
|
|
2051
2054
|
"aria-label": "Закрыть",
|
|
2052
2055
|
children: /* @__PURE__ */ e.jsx(te, { size: I[3], strokeWidth: 1.5 })
|
|
2053
2056
|
}
|
|
@@ -2057,9 +2060,9 @@ function Ss({ data: s, onDismiss: t }) {
|
|
|
2057
2060
|
);
|
|
2058
2061
|
}
|
|
2059
2062
|
function It({ position: s = "bottom-right" }) {
|
|
2060
|
-
const [t,
|
|
2061
|
-
return B(() => (ve.add(
|
|
2062
|
-
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(Ss, { data: o, onDismiss: Rs }, o.id)) }),
|
|
2063
|
+
const [t, r] = D(() => [...ue]);
|
|
2064
|
+
return B(() => (ve.add(r), () => ve.delete(r)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
2065
|
+
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(Ss, { data: o, onDismiss: Rs }, o.id)) }),
|
|
2063
2066
|
document.body
|
|
2064
2067
|
);
|
|
2065
2068
|
}
|
|
@@ -2071,17 +2074,17 @@ const Ds = {
|
|
|
2071
2074
|
function At({
|
|
2072
2075
|
label: s,
|
|
2073
2076
|
status: t = "idle",
|
|
2074
|
-
icon:
|
|
2077
|
+
icon: r,
|
|
2075
2078
|
badge: o,
|
|
2076
2079
|
defaultExpanded: a = !1,
|
|
2077
|
-
expanded:
|
|
2080
|
+
expanded: n,
|
|
2078
2081
|
onToggle: i,
|
|
2079
2082
|
children: l,
|
|
2080
2083
|
className: m = "",
|
|
2081
2084
|
...d
|
|
2082
2085
|
}) {
|
|
2083
2086
|
const f = t === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2084
|
-
|
|
2087
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
|
|
2085
2088
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2086
2089
|
Ds[t],
|
|
2087
2090
|
o
|
|
@@ -2097,7 +2100,7 @@ function At({
|
|
|
2097
2100
|
title: p,
|
|
2098
2101
|
padding: "s",
|
|
2099
2102
|
defaultExpanded: a,
|
|
2100
|
-
expanded: f ? !1 :
|
|
2103
|
+
expanded: f ? !1 : n,
|
|
2101
2104
|
onToggle: f ? void 0 : i,
|
|
2102
2105
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2103
2106
|
}
|
|
@@ -2115,13 +2118,13 @@ function At({
|
|
|
2115
2118
|
function Is({
|
|
2116
2119
|
text: s,
|
|
2117
2120
|
size: t = "xs",
|
|
2118
|
-
timeout:
|
|
2121
|
+
timeout: r = 800,
|
|
2119
2122
|
"aria-label": o = "Copy to clipboard",
|
|
2120
2123
|
...a
|
|
2121
2124
|
}) {
|
|
2122
|
-
const [
|
|
2125
|
+
const [n, i] = D(!1), l = (m) => {
|
|
2123
2126
|
m.currentTarget.blur(), navigator.clipboard.writeText(s).then(() => {
|
|
2124
|
-
i(!0), setTimeout(() => i(!1),
|
|
2127
|
+
i(!0), setTimeout(() => i(!1), r);
|
|
2125
2128
|
});
|
|
2126
2129
|
};
|
|
2127
2130
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -2129,7 +2132,7 @@ function Is({
|
|
|
2129
2132
|
{
|
|
2130
2133
|
variant: "ghost",
|
|
2131
2134
|
size: t,
|
|
2132
|
-
state:
|
|
2135
|
+
state: n ? "success" : "idle",
|
|
2133
2136
|
icon: /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
|
|
2134
2137
|
"aria-label": o,
|
|
2135
2138
|
onClick: l,
|
|
@@ -2137,7 +2140,7 @@ function Is({
|
|
|
2137
2140
|
}
|
|
2138
2141
|
);
|
|
2139
2142
|
}
|
|
2140
|
-
function Bt({ content: s, streaming: t = !1, ...
|
|
2143
|
+
function Bt({ content: s, streaming: t = !1, ...r }) {
|
|
2141
2144
|
const [o, a] = D(t);
|
|
2142
2145
|
return B(() => {
|
|
2143
2146
|
a(!!t);
|
|
@@ -2151,7 +2154,7 @@ function Bt({ content: s, streaming: t = !1, ...n }) {
|
|
|
2151
2154
|
/* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2152
2155
|
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2153
2156
|
] }),
|
|
2154
|
-
...
|
|
2157
|
+
...r,
|
|
2155
2158
|
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2156
2159
|
s,
|
|
2157
2160
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
@@ -2162,16 +2165,16 @@ function Bt({ content: s, streaming: t = !1, ...n }) {
|
|
|
2162
2165
|
function Lt({
|
|
2163
2166
|
count: s,
|
|
2164
2167
|
current: t = 0,
|
|
2165
|
-
done:
|
|
2168
|
+
done: r = [],
|
|
2166
2169
|
onChange: o,
|
|
2167
2170
|
showCounter: a = !0,
|
|
2168
|
-
className:
|
|
2171
|
+
className: n = "",
|
|
2169
2172
|
"aria-label": i = "Steps",
|
|
2170
2173
|
...l
|
|
2171
2174
|
}) {
|
|
2172
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2175
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
|
|
2173
2176
|
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: s }, (m, d) => {
|
|
2174
|
-
const f = d === t, p =
|
|
2177
|
+
const f = d === t, p = r.includes(d) && !f, h = o && (d <= t || r.includes(d)), u = [
|
|
2175
2178
|
"ds-step-indicator__dot",
|
|
2176
2179
|
f && "ds-step-indicator__dot--active",
|
|
2177
2180
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2201,26 +2204,26 @@ function Lt({
|
|
|
2201
2204
|
function Mt({
|
|
2202
2205
|
content: s,
|
|
2203
2206
|
isStreaming: t = !1,
|
|
2204
|
-
cursor:
|
|
2207
|
+
cursor: r = "line",
|
|
2205
2208
|
onChunk: o,
|
|
2206
2209
|
className: a = "",
|
|
2207
|
-
...
|
|
2210
|
+
...n
|
|
2208
2211
|
}) {
|
|
2209
2212
|
const i = k(s);
|
|
2210
2213
|
return B(() => {
|
|
2211
2214
|
s !== i.current && (o == null || o(s), i.current = s);
|
|
2212
|
-
}, [s, o]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...
|
|
2215
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...n, children: [
|
|
2213
2216
|
s,
|
|
2214
|
-
t &&
|
|
2217
|
+
t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
|
|
2215
2218
|
] });
|
|
2216
2219
|
}
|
|
2217
2220
|
function Pt({
|
|
2218
2221
|
role: s = "assistant",
|
|
2219
2222
|
header: t,
|
|
2220
|
-
footer:
|
|
2223
|
+
footer: r,
|
|
2221
2224
|
attachments: o,
|
|
2222
2225
|
isStreaming: a = !1,
|
|
2223
|
-
children:
|
|
2226
|
+
children: n,
|
|
2224
2227
|
className: i = "",
|
|
2225
2228
|
...l
|
|
2226
2229
|
}) {
|
|
@@ -2230,39 +2233,39 @@ function Pt({
|
|
|
2230
2233
|
a && "ds-chat-message--streaming",
|
|
2231
2234
|
i
|
|
2232
2235
|
].filter(Boolean).join(" ");
|
|
2233
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children:
|
|
2236
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: n }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2234
2237
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: o }),
|
|
2235
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2236
|
-
|
|
2238
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: n }),
|
|
2239
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2237
2240
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2238
2241
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2239
2242
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: o }),
|
|
2240
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2241
|
-
|
|
2243
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: n }),
|
|
2244
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2242
2245
|
] });
|
|
2243
2246
|
}
|
|
2244
|
-
function zt(s, { containerRef: t, smartPause:
|
|
2247
|
+
function zt(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
2245
2248
|
const o = k(!1), a = k(0);
|
|
2246
2249
|
B(() => {
|
|
2247
|
-
const
|
|
2248
|
-
if (!
|
|
2250
|
+
const n = t == null ? void 0 : t.current;
|
|
2251
|
+
if (!n) return;
|
|
2249
2252
|
const i = () => {
|
|
2250
|
-
const l =
|
|
2251
|
-
!l &&
|
|
2253
|
+
const l = n.scrollHeight - n.scrollTop - n.clientHeight < 64;
|
|
2254
|
+
!l && n.scrollTop < a.current && (o.current = !0), l && (o.current = !1), a.current = n.scrollTop;
|
|
2252
2255
|
};
|
|
2253
|
-
return
|
|
2256
|
+
return n.addEventListener("scroll", i, { passive: !0 }), () => n.removeEventListener("scroll", i);
|
|
2254
2257
|
}, [t]), B(() => {
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2258
|
+
const n = t == null ? void 0 : t.current;
|
|
2259
|
+
n && (r && o.current || (n.scrollTop = n.scrollHeight));
|
|
2257
2260
|
}, s);
|
|
2258
2261
|
}
|
|
2259
2262
|
function As({
|
|
2260
2263
|
prompts: s,
|
|
2261
2264
|
enabled: t,
|
|
2262
|
-
typingSpeed:
|
|
2265
|
+
typingSpeed: r = 38,
|
|
2263
2266
|
erasingSpeed: o = 18,
|
|
2264
2267
|
holdTime: a = 2200,
|
|
2265
|
-
betweenTime:
|
|
2268
|
+
betweenTime: n = 380,
|
|
2266
2269
|
manualPauseMs: i = 5e3
|
|
2267
2270
|
}) {
|
|
2268
2271
|
const [l, m] = D(0), [d, f] = D(""), p = k("typing"), h = k(0), u = k(0), b = k(null), j = k(0);
|
|
@@ -2280,27 +2283,27 @@ function As({
|
|
|
2280
2283
|
return;
|
|
2281
2284
|
}
|
|
2282
2285
|
const A = s[u.current % s.length] ?? "";
|
|
2283
|
-
p.current === "typing" ? (h.current += 1, f(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", b.current = setTimeout(T, a)) : b.current = setTimeout(T,
|
|
2286
|
+
p.current === "typing" ? (h.current += 1, f(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", b.current = setTimeout(T, a)) : b.current = setTimeout(T, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", b.current = setTimeout(T, o)) : (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), b.current = setTimeout(T, n)) : b.current = setTimeout(T, o));
|
|
2284
2287
|
};
|
|
2285
2288
|
return b.current = setTimeout(T, 260), () => {
|
|
2286
2289
|
b.current && clearTimeout(b.current);
|
|
2287
2290
|
};
|
|
2288
|
-
}, [t, s,
|
|
2291
|
+
}, [t, s, r, o, a, n]);
|
|
2289
2292
|
const R = (T) => {
|
|
2290
2293
|
if (s.length === 0) return;
|
|
2291
2294
|
const z = (T % s.length + s.length) % s.length, A = s[z];
|
|
2292
2295
|
u.current = z, h.current = A.length, p.current = "holding", j.current = Date.now() + i, m(z), f(A);
|
|
2293
|
-
},
|
|
2294
|
-
return { displayed: d, currentPrompt: y, index: l, next:
|
|
2296
|
+
}, E = () => R(u.current + 1), L = () => R(u.current - 1), y = s[l % s.length] ?? "";
|
|
2297
|
+
return { displayed: d, currentPrompt: y, index: l, next: E, prev: L };
|
|
2295
2298
|
}
|
|
2296
2299
|
let Bs = 0;
|
|
2297
2300
|
function Ot({
|
|
2298
2301
|
value: s = "",
|
|
2299
2302
|
onChange: t,
|
|
2300
|
-
onSubmit:
|
|
2303
|
+
onSubmit: r,
|
|
2301
2304
|
onStop: o,
|
|
2302
2305
|
onKeyDown: a,
|
|
2303
|
-
loading:
|
|
2306
|
+
loading: n = !1,
|
|
2304
2307
|
disabled: i = !1,
|
|
2305
2308
|
placeholder: l = "Let's get things done...",
|
|
2306
2309
|
animatedPlaceholders: m,
|
|
@@ -2312,7 +2315,7 @@ function Ot({
|
|
|
2312
2315
|
onRemoveImage: b,
|
|
2313
2316
|
acceptImage: j,
|
|
2314
2317
|
acceptFile: R,
|
|
2315
|
-
maxImages:
|
|
2318
|
+
maxImages: E,
|
|
2316
2319
|
maxImageSize: L,
|
|
2317
2320
|
leftSlot: y,
|
|
2318
2321
|
rightSlot: T,
|
|
@@ -2322,15 +2325,15 @@ function Ot({
|
|
|
2322
2325
|
const q = k(null), H = k(null), F = k(0), [v, C] = D(!1), [X, V] = D([]), x = (_) => {
|
|
2323
2326
|
const S = ++Bs;
|
|
2324
2327
|
V((Y) => [...Y, { id: S, msg: _ }]), setTimeout(() => V((Y) => Y.filter((J) => J.id !== S)), 6e3);
|
|
2325
|
-
}, N = (_) => V((S) => S.filter((Y) => Y.id !== _)),
|
|
2328
|
+
}, N = (_) => V((S) => S.filter((Y) => Y.id !== _)), $ = (_) => _.type.startsWith("image/"), M = () => !0, K = j ?? $, G = R ?? M, g = (_) => {
|
|
2326
2329
|
const S = [], Y = [], J = [], Z = [];
|
|
2327
|
-
let ee = 0, ie =
|
|
2330
|
+
let ee = 0, ie = E != null ? E - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
|
|
2328
2331
|
for (const se of _)
|
|
2329
2332
|
K(se) ? L && se.size > L ? J.push(se.name) : ie > 0 ? (S.push(se), ie--) : ee++ : G(se) ? Y.push(se) : Z.push(se.name);
|
|
2330
2333
|
return { imageFiles: S, docFiles: Y, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2331
2334
|
}, c = (_) => {
|
|
2332
2335
|
const { imageFiles: S, docFiles: Y, tooLarge: J, skipped: Z, limitExceeded: ee } = g(_);
|
|
2333
|
-
J.length && x(`File${J.length > 1 ? "s" : ""} too large${L ? ` (max ${L / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${
|
|
2336
|
+
J.length && x(`File${J.length > 1 ? "s" : ""} too large${L ? ` (max ${L / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${E} images per message`), h && S.length && h(S);
|
|
2334
2337
|
const ie = Y.concat(h ? [] : S);
|
|
2335
2338
|
p && ie.length && p(ie);
|
|
2336
2339
|
};
|
|
@@ -2340,17 +2343,17 @@ function Ot({
|
|
|
2340
2343
|
}, [s]), B(() => {
|
|
2341
2344
|
const _ = (S) => {
|
|
2342
2345
|
var J, Z, ee;
|
|
2343
|
-
if (
|
|
2346
|
+
if (n || i) return;
|
|
2344
2347
|
const Y = (J = S.target) == null ? void 0 : J.tagName;
|
|
2345
2348
|
Y === "INPUT" || Y === "TEXTAREA" || Y === "SELECT" || (Z = S.target) != null && Z.isContentEditable || S.ctrlKey || S.metaKey || S.altKey || S.key.length !== 1 && S.key !== "Backspace" && S.key !== "Delete" || (ee = H.current) == null || ee.focus();
|
|
2346
2349
|
};
|
|
2347
2350
|
return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
|
|
2348
|
-
}, [
|
|
2351
|
+
}, [n, i]);
|
|
2349
2352
|
const w = (_) => {
|
|
2350
2353
|
_.preventDefault(), F.current++, _.dataTransfer.types.includes("Files") && C(!0);
|
|
2351
2354
|
}, P = (_) => {
|
|
2352
2355
|
_.preventDefault(), F.current--, F.current === 0 && C(!1);
|
|
2353
|
-
}, O = (_) => _.preventDefault(),
|
|
2356
|
+
}, O = (_) => _.preventDefault(), re = (_) => {
|
|
2354
2357
|
_.preventDefault(), F.current = 0, C(!1);
|
|
2355
2358
|
const S = Array.from(_.dataTransfer.files);
|
|
2356
2359
|
S.length && c(S);
|
|
@@ -2369,8 +2372,8 @@ function Ot({
|
|
|
2369
2372
|
}
|
|
2370
2373
|
if (Y.length === 0) return;
|
|
2371
2374
|
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: ie } = g(Y);
|
|
2372
|
-
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), ie && x(`Max ${
|
|
2373
|
-
}, Q = !
|
|
2375
|
+
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), ie && x(`Max ${E} images per message`), J.length && (_.preventDefault(), h(J));
|
|
2376
|
+
}, Q = !n && !i && !!(m != null && m.length) && s.length === 0, oe = As({
|
|
2374
2377
|
prompts: m ?? [],
|
|
2375
2378
|
enabled: Q
|
|
2376
2379
|
}), be = (_) => {
|
|
@@ -2409,7 +2412,7 @@ function Ot({
|
|
|
2409
2412
|
onDragEnter: w,
|
|
2410
2413
|
onDragLeave: P,
|
|
2411
2414
|
onDragOver: O,
|
|
2412
|
-
onDrop:
|
|
2415
|
+
onDrop: re,
|
|
2413
2416
|
children: [
|
|
2414
2417
|
v && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2415
2418
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2421,7 +2424,7 @@ function Ot({
|
|
|
2421
2424
|
onKeyDown: be,
|
|
2422
2425
|
onPaste: W,
|
|
2423
2426
|
placeholder: Q ? "" : l,
|
|
2424
|
-
disabled:
|
|
2427
|
+
disabled: n || i,
|
|
2425
2428
|
rows: 1,
|
|
2426
2429
|
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2427
2430
|
}
|
|
@@ -2486,7 +2489,7 @@ function Ot({
|
|
|
2486
2489
|
y,
|
|
2487
2490
|
T,
|
|
2488
2491
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2489
|
-
|
|
2492
|
+
n ? /* @__PURE__ */ e.jsx(
|
|
2490
2493
|
ce,
|
|
2491
2494
|
{
|
|
2492
2495
|
variant: "primary",
|
|
@@ -2501,7 +2504,7 @@ function Ot({
|
|
|
2501
2504
|
variant: "primary",
|
|
2502
2505
|
size: "xs",
|
|
2503
2506
|
icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
|
|
2504
|
-
onClick:
|
|
2507
|
+
onClick: r,
|
|
2505
2508
|
disabled: !Ce,
|
|
2506
2509
|
"aria-label": "Send"
|
|
2507
2510
|
}
|
|
@@ -2516,33 +2519,33 @@ const Me = { fast: 0, standard: 1, premium: 2 }, Pe = { fast: "data-5", standard
|
|
|
2516
2519
|
function Ft({
|
|
2517
2520
|
models: s = [],
|
|
2518
2521
|
value: t,
|
|
2519
|
-
onChange:
|
|
2522
|
+
onChange: r,
|
|
2520
2523
|
size: o = "xs",
|
|
2521
2524
|
minTier: a,
|
|
2522
|
-
showAutoOption:
|
|
2525
|
+
showAutoOption: n = !1,
|
|
2523
2526
|
groupByTier: i = !0,
|
|
2524
2527
|
className: l = "",
|
|
2525
2528
|
...m
|
|
2526
2529
|
}) {
|
|
2527
|
-
const [d, f] = D(!1), p = k(null), h = k(null), u = k(null), [b, j] = D({}), R = s.filter((v) => !a || v.name === "auto" ? !0 : (Me[v.tier] ?? 1) >= (Me[a] ?? 1)),
|
|
2530
|
+
const [d, f] = D(!1), p = k(null), h = k(null), u = k(null), [b, j] = D({}), R = s.filter((v) => !a || v.name === "auto" ? !0 : (Me[v.tier] ?? 1) >= (Me[a] ?? 1)), E = R.find((v) => v.name === "auto"), L = R.filter((v) => v.name !== "auto"), y = s.find((v) => v.name === t), z = new Set(L.map((v) => v.tier).filter(Boolean)).size > 1;
|
|
2528
2531
|
B(() => {
|
|
2529
2532
|
if (!d) return;
|
|
2530
2533
|
const v = 320, C = () => {
|
|
2531
2534
|
var M;
|
|
2532
2535
|
const x = (M = h.current) == null ? void 0 : M.getBoundingClientRect();
|
|
2533
2536
|
if (!x) return;
|
|
2534
|
-
const N = window.innerHeight - x.bottom,
|
|
2537
|
+
const N = window.innerHeight - x.bottom, $ = N < v + 8 && x.top > N;
|
|
2535
2538
|
j({
|
|
2536
2539
|
position: "fixed",
|
|
2537
2540
|
zIndex: "var(--z-dropdown, 500)",
|
|
2538
2541
|
left: x.left,
|
|
2539
|
-
|
|
2542
|
+
...$ ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
|
|
2540
2543
|
});
|
|
2541
2544
|
};
|
|
2542
2545
|
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
2543
2546
|
const X = (x) => {
|
|
2544
|
-
var N,
|
|
2545
|
-
!((N = p.current) != null && N.contains(x.target)) && !((
|
|
2547
|
+
var N, $;
|
|
2548
|
+
!((N = p.current) != null && N.contains(x.target)) && !(($ = u.current) != null && $.contains(x.target)) && f(!1);
|
|
2546
2549
|
}, V = (x) => {
|
|
2547
2550
|
x.key === "Escape" && f(!1);
|
|
2548
2551
|
};
|
|
@@ -2551,7 +2554,7 @@ function Ft({
|
|
|
2551
2554
|
};
|
|
2552
2555
|
}, [d]);
|
|
2553
2556
|
const A = (v) => {
|
|
2554
|
-
|
|
2557
|
+
r == null || r(v), f(!1);
|
|
2555
2558
|
}, q = (v) => /* @__PURE__ */ e.jsxs(
|
|
2556
2559
|
"button",
|
|
2557
2560
|
{
|
|
@@ -2574,8 +2577,8 @@ function Ft({
|
|
|
2574
2577
|
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": v, children: v.charAt(0).toUpperCase() + v.slice(1) }, `lbl-${v}`),
|
|
2575
2578
|
...C.map(q)
|
|
2576
2579
|
] : [];
|
|
2577
|
-
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu ds-scrollable", style: b, children: [
|
|
2578
|
-
|
|
2580
|
+
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: b, children: [
|
|
2581
|
+
n && E && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2579
2582
|
/* @__PURE__ */ e.jsxs(
|
|
2580
2583
|
"button",
|
|
2581
2584
|
{
|
|
@@ -2633,18 +2636,18 @@ function Ne(s) {
|
|
|
2633
2636
|
}
|
|
2634
2637
|
function Ms(s) {
|
|
2635
2638
|
const t = /* @__PURE__ */ new Map();
|
|
2636
|
-
for (const
|
|
2637
|
-
t.has(
|
|
2639
|
+
for (const r of s)
|
|
2640
|
+
t.has(r.filename) || t.set(r.filename, { filename: r.filename, url: r.url, items: [] }), t.get(r.filename).items.push(r);
|
|
2638
2641
|
return [...t.values()];
|
|
2639
2642
|
}
|
|
2640
2643
|
function Wt({
|
|
2641
2644
|
sources: s = [],
|
|
2642
2645
|
layout: t = "list",
|
|
2643
|
-
title:
|
|
2646
|
+
title: r = "Sources",
|
|
2644
2647
|
maxVisible: o = 5,
|
|
2645
2648
|
onSourceClick: a
|
|
2646
2649
|
}) {
|
|
2647
|
-
const [
|
|
2650
|
+
const [n, i] = D(!1), l = Ms(s), m = l.length > o, d = n ? l : l.slice(0, o), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2648
2651
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2649
2652
|
d.map((h) => {
|
|
2650
2653
|
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
@@ -2654,7 +2657,7 @@ function Wt({
|
|
|
2654
2657
|
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2655
2658
|
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2656
2659
|
children: [
|
|
2657
|
-
/* @__PURE__ */ e.jsx(
|
|
2660
|
+
/* @__PURE__ */ e.jsx(rs, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2658
2661
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2659
2662
|
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2660
2663
|
]
|
|
@@ -2662,13 +2665,13 @@ function Wt({
|
|
|
2662
2665
|
h.filename
|
|
2663
2666
|
);
|
|
2664
2667
|
}),
|
|
2665
|
-
m && !
|
|
2668
|
+
m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2666
2669
|
"+",
|
|
2667
2670
|
l.length - o,
|
|
2668
2671
|
" more sources"
|
|
2669
2672
|
] })
|
|
2670
2673
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2671
|
-
|
|
2674
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
|
|
2672
2675
|
d.map((h) => {
|
|
2673
2676
|
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2674
2677
|
return f ? /* @__PURE__ */ e.jsx(
|
|
@@ -2700,7 +2703,7 @@ function Wt({
|
|
|
2700
2703
|
h.filename
|
|
2701
2704
|
);
|
|
2702
2705
|
}),
|
|
2703
|
-
m && !
|
|
2706
|
+
m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2704
2707
|
"+",
|
|
2705
2708
|
l.length - o,
|
|
2706
2709
|
" more sources"
|
|
@@ -2713,17 +2716,17 @@ function ze(s) {
|
|
|
2713
2716
|
function Ct({
|
|
2714
2717
|
used: s,
|
|
2715
2718
|
limit: t,
|
|
2716
|
-
size:
|
|
2719
|
+
size: r = "s",
|
|
2717
2720
|
showCount: o = !0,
|
|
2718
2721
|
showPercent: a = !1,
|
|
2719
|
-
warningThreshold:
|
|
2722
|
+
warningThreshold: n = 0.8,
|
|
2720
2723
|
errorThreshold: i = 1
|
|
2721
2724
|
}) {
|
|
2722
|
-
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= i ? "error" : l >=
|
|
2725
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= i ? "error" : l >= n ? "warning" : "normal";
|
|
2723
2726
|
return /* @__PURE__ */ e.jsxs(
|
|
2724
2727
|
"div",
|
|
2725
2728
|
{
|
|
2726
|
-
className: `ds-token-counter ds-token-counter--${
|
|
2729
|
+
className: `ds-token-counter ds-token-counter--${r}`,
|
|
2727
2730
|
role: "meter",
|
|
2728
2731
|
"aria-valuenow": s,
|
|
2729
2732
|
"aria-valuemax": t,
|
|
@@ -2758,10 +2761,10 @@ function Ps(s) {
|
|
|
2758
2761
|
function Ut({
|
|
2759
2762
|
value: s = 0,
|
|
2760
2763
|
size: t = "xs",
|
|
2761
|
-
showLabel:
|
|
2764
|
+
showLabel: r = "none",
|
|
2762
2765
|
layout: o = "inline"
|
|
2763
2766
|
}) {
|
|
2764
|
-
const a = Math.max(0, Math.min(1, s)),
|
|
2767
|
+
const a = Math.max(0, Math.min(1, s)), n = Math.round(a * Oe), i = Ps(a);
|
|
2765
2768
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2766
2769
|
"ds-confidence-bar",
|
|
2767
2770
|
`ds-confidence-bar--${t}`,
|
|
@@ -2771,11 +2774,11 @@ function Ut({
|
|
|
2771
2774
|
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, m) => /* @__PURE__ */ e.jsx(
|
|
2772
2775
|
"div",
|
|
2773
2776
|
{
|
|
2774
|
-
className: `ds-confidence-bar__seg${m <
|
|
2777
|
+
className: `ds-confidence-bar__seg${m < n ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2775
2778
|
},
|
|
2776
2779
|
m
|
|
2777
2780
|
)) }),
|
|
2778
|
-
|
|
2781
|
+
r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
2779
2782
|
] });
|
|
2780
2783
|
}
|
|
2781
2784
|
const zs = { add: "+", remove: "-", context: " " };
|
|
@@ -2789,20 +2792,20 @@ function je({ line: s, lineNumbers: t }) {
|
|
|
2789
2792
|
function Vt({
|
|
2790
2793
|
lines: s = [],
|
|
2791
2794
|
layout: t = "inline",
|
|
2792
|
-
wordWrap:
|
|
2795
|
+
wordWrap: r = !1,
|
|
2793
2796
|
lineNumbers: o = !0,
|
|
2794
2797
|
maxHeight: a,
|
|
2795
|
-
title:
|
|
2798
|
+
title: n
|
|
2796
2799
|
}) {
|
|
2797
2800
|
const i = [
|
|
2798
2801
|
"ds-diff-view",
|
|
2799
2802
|
`ds-diff-view--${t}`,
|
|
2800
|
-
|
|
2803
|
+
r && "ds-diff-view--wrap"
|
|
2801
2804
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2802
2805
|
if (t === "split") {
|
|
2803
2806
|
const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2804
2807
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
2805
|
-
|
|
2808
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2806
2809
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
|
|
2807
2810
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: m.map((f, p) => /* @__PURE__ */ e.jsx(je, { line: f, lineNumbers: o }, p)) }),
|
|
2808
2811
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((f, p) => /* @__PURE__ */ e.jsx(je, { line: f, lineNumbers: o }, p)) })
|
|
@@ -2810,29 +2813,29 @@ function Vt({
|
|
|
2810
2813
|
] });
|
|
2811
2814
|
}
|
|
2812
2815
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
2813
|
-
|
|
2816
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2814
2817
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(je, { line: m, lineNumbers: o }, d)) })
|
|
2815
2818
|
] });
|
|
2816
2819
|
}
|
|
2817
2820
|
function Os({
|
|
2818
2821
|
value: s = "idle",
|
|
2819
2822
|
onLike: t,
|
|
2820
|
-
onDislike:
|
|
2823
|
+
onDislike: r,
|
|
2821
2824
|
className: o = "",
|
|
2822
2825
|
...a
|
|
2823
2826
|
}) {
|
|
2824
|
-
const
|
|
2827
|
+
const n = s !== "idle";
|
|
2825
2828
|
return /* @__PURE__ */ e.jsxs(
|
|
2826
2829
|
"div",
|
|
2827
2830
|
{
|
|
2828
2831
|
className: [
|
|
2829
2832
|
"ds-message-feedback",
|
|
2830
|
-
|
|
2833
|
+
n && "ds-message-feedback--voted",
|
|
2831
2834
|
o
|
|
2832
2835
|
].filter(Boolean).join(" "),
|
|
2833
2836
|
...a,
|
|
2834
2837
|
children: [
|
|
2835
|
-
(!
|
|
2838
|
+
(!n || s === "liked") && /* @__PURE__ */ e.jsx(
|
|
2836
2839
|
"button",
|
|
2837
2840
|
{
|
|
2838
2841
|
className: [
|
|
@@ -2840,11 +2843,11 @@ function Os({
|
|
|
2840
2843
|
s === "liked" && "ds-message-feedback__btn--liked"
|
|
2841
2844
|
].filter(Boolean).join(" "),
|
|
2842
2845
|
onClick: t,
|
|
2843
|
-
disabled:
|
|
2846
|
+
disabled: n,
|
|
2844
2847
|
"aria-label": "Like",
|
|
2845
2848
|
"aria-pressed": s === "liked",
|
|
2846
2849
|
children: /* @__PURE__ */ e.jsx(
|
|
2847
|
-
|
|
2850
|
+
ns,
|
|
2848
2851
|
{
|
|
2849
2852
|
size: I[1],
|
|
2850
2853
|
strokeWidth: 1.5,
|
|
@@ -2853,15 +2856,15 @@ function Os({
|
|
|
2853
2856
|
)
|
|
2854
2857
|
}
|
|
2855
2858
|
),
|
|
2856
|
-
(!
|
|
2859
|
+
(!n || s === "disliked") && /* @__PURE__ */ e.jsx(
|
|
2857
2860
|
"button",
|
|
2858
2861
|
{
|
|
2859
2862
|
className: [
|
|
2860
2863
|
"ds-message-feedback__btn",
|
|
2861
2864
|
s === "disliked" && "ds-message-feedback__btn--disliked"
|
|
2862
2865
|
].filter(Boolean).join(" "),
|
|
2863
|
-
onClick:
|
|
2864
|
-
disabled:
|
|
2866
|
+
onClick: r,
|
|
2867
|
+
disabled: n,
|
|
2865
2868
|
"aria-label": "Dislike",
|
|
2866
2869
|
"aria-pressed": s === "disliked",
|
|
2867
2870
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -2881,23 +2884,23 @@ function Os({
|
|
|
2881
2884
|
function Fs(s) {
|
|
2882
2885
|
const t = s instanceof Date ? s : new Date(s);
|
|
2883
2886
|
if (isNaN(t)) return null;
|
|
2884
|
-
const
|
|
2887
|
+
const r = /* @__PURE__ */ new Date(), o = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(r.getFullYear(), r.getMonth(), r.getDate()), n = new Date(a - 864e5);
|
|
2885
2888
|
if (t >= a) return o;
|
|
2886
|
-
if (t >=
|
|
2889
|
+
if (t >= n) return `Yesterday ${o}`;
|
|
2887
2890
|
const i = t.getDate(), l = t.toLocaleString([], { month: "short" });
|
|
2888
2891
|
return `${i} ${l} ${o}`;
|
|
2889
2892
|
}
|
|
2890
2893
|
function Yt({
|
|
2891
2894
|
role: s = "assistant",
|
|
2892
2895
|
text: t,
|
|
2893
|
-
timestamp:
|
|
2896
|
+
timestamp: r,
|
|
2894
2897
|
feedbackValue: o = "idle",
|
|
2895
2898
|
onLike: a,
|
|
2896
|
-
onDislike:
|
|
2899
|
+
onDislike: n,
|
|
2897
2900
|
className: i = "",
|
|
2898
2901
|
...l
|
|
2899
2902
|
}) {
|
|
2900
|
-
const m = s === "assistant" && (a ||
|
|
2903
|
+
const m = s === "assistant" && (a || n), d = !!t, f = r ? Fs(r) : null;
|
|
2901
2904
|
return !m && !d && !f ? null : /* @__PURE__ */ e.jsxs(
|
|
2902
2905
|
"div",
|
|
2903
2906
|
{
|
|
@@ -2905,21 +2908,21 @@ function Yt({
|
|
|
2905
2908
|
...l,
|
|
2906
2909
|
children: [
|
|
2907
2910
|
s === "user" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f }),
|
|
2908
|
-
m && /* @__PURE__ */ e.jsx(Os, { className: "ds-message-action", value: o, onLike: a, onDislike:
|
|
2911
|
+
m && /* @__PURE__ */ e.jsx(Os, { className: "ds-message-action", value: o, onLike: a, onDislike: n }),
|
|
2909
2912
|
d && /* @__PURE__ */ e.jsx(Is, { className: "ds-message-action", text: t }),
|
|
2910
2913
|
s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f })
|
|
2911
2914
|
]
|
|
2912
2915
|
}
|
|
2913
2916
|
);
|
|
2914
2917
|
}
|
|
2915
|
-
function qt({ label: s, className: t = "", ...
|
|
2916
|
-
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...
|
|
2918
|
+
function qt({ label: s, className: t = "", ...r }) {
|
|
2919
|
+
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...r, children: [
|
|
2917
2920
|
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
2918
2921
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: s })
|
|
2919
2922
|
] });
|
|
2920
2923
|
}
|
|
2921
|
-
function Ht({ variant: s = "light", glow: t, mask:
|
|
2922
|
-
const
|
|
2924
|
+
function Ht({ variant: s = "light", glow: t, mask: r = !0, style: o, ...a }) {
|
|
2925
|
+
const n = s === "dark", i = t ?? n, l = n ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", m = n ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
2923
2926
|
return /* @__PURE__ */ e.jsx(
|
|
2924
2927
|
"div",
|
|
2925
2928
|
{
|
|
@@ -2949,7 +2952,7 @@ function Ht({ variant: s = "light", glow: t, mask: n = !0, style: o, ...a }) {
|
|
|
2949
2952
|
].join(", "),
|
|
2950
2953
|
backgroundSize: "80px 80px, 80px 80px, 16px 16px, 16px 16px",
|
|
2951
2954
|
backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
|
|
2952
|
-
...
|
|
2955
|
+
...r && {
|
|
2953
2956
|
WebkitMaskImage: "radial-gradient(ellipse at center, #000 30%, transparent 85%)",
|
|
2954
2957
|
maskImage: "radial-gradient(ellipse at center, #000 30%, transparent 85%)"
|
|
2955
2958
|
}
|
|
@@ -2959,13 +2962,13 @@ function Ht({ variant: s = "light", glow: t, mask: n = !0, style: o, ...a }) {
|
|
|
2959
2962
|
}
|
|
2960
2963
|
);
|
|
2961
2964
|
}
|
|
2962
|
-
function Kt({ children: s, axis: t = "y", style:
|
|
2963
|
-
const
|
|
2965
|
+
function Kt({ children: s, axis: t = "y", style: r, className: o = "", ...a }) {
|
|
2966
|
+
const n = t === "x" ? { overflowX: "auto", overflowY: "hidden" } : t === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
2964
2967
|
return /* @__PURE__ */ e.jsx(
|
|
2965
2968
|
"div",
|
|
2966
2969
|
{
|
|
2967
2970
|
className: `ds-scrollable ${o}`,
|
|
2968
|
-
style: { ...
|
|
2971
|
+
style: { ...n, ...r },
|
|
2969
2972
|
...a,
|
|
2970
2973
|
children: s
|
|
2971
2974
|
}
|
|
@@ -2984,7 +2987,7 @@ export {
|
|
|
2984
2987
|
Ks as Card,
|
|
2985
2988
|
Pt as ChatMessage,
|
|
2986
2989
|
dt as Checkbox,
|
|
2987
|
-
|
|
2990
|
+
rt as Code,
|
|
2988
2991
|
ps as CodeAccordion,
|
|
2989
2992
|
Ut as ConfidenceBar,
|
|
2990
2993
|
Is as CopyButton,
|
|
@@ -3001,7 +3004,7 @@ export {
|
|
|
3001
3004
|
Zs as H4,
|
|
3002
3005
|
St as InView,
|
|
3003
3006
|
Vs as Input,
|
|
3004
|
-
|
|
3007
|
+
nt as Link,
|
|
3005
3008
|
Os as MessageFeedback,
|
|
3006
3009
|
Yt as MessageFooter,
|
|
3007
3010
|
st as Modal,
|