@donkit-ai/design-system 1.4.64 → 1.4.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +582 -570
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Y, { useState as I, useRef as T, useEffect as D, useLayoutEffect as Ze,
|
|
1
|
+
import Y, { useState as I, useRef as T, useEffect as D, useLayoutEffect as Ze, useCallback as je, useContext as Ne, forwardRef as Qe, createContext as et } from "react";
|
|
2
2
|
import { Check as Te, X as ee, ChevronDown as ve, Minus as tt, Plus as st, XCircle as Re, AlertTriangle as Se, CheckCircle as Ae, Info as Ie, ChevronUp as nt, ChevronsUpDown as rt, ChevronLeft as at, ChevronRight as ot, Copy as it, Brain as lt, Loader as ct, Paperclip as Me, Square as dt, ArrowUp as ut, Zap as ft, Cpu as ze, FileText as mt, ThumbsUp as pt, ThumbsDown as ht } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const P = {
|
|
@@ -8,7 +8,7 @@ const P = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var ke = { exports: {} }, he = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -23,19 +23,19 @@ function xt() {
|
|
|
23
23
|
if (Ce) return he;
|
|
24
24
|
Ce = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
26
|
-
function n(
|
|
26
|
+
function n(r, o, a) {
|
|
27
27
|
var i = null;
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (a !== void 0 && (i = "" + a), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
29
|
+
a = {};
|
|
30
30
|
for (var l in o)
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return o =
|
|
31
|
+
l !== "key" && (a[l] = o[l]);
|
|
32
|
+
} else a = o;
|
|
33
|
+
return o = a.ref, {
|
|
34
34
|
$$typeof: t,
|
|
35
|
-
type:
|
|
35
|
+
type: r,
|
|
36
36
|
key: i,
|
|
37
37
|
ref: o !== void 0 ? o : null,
|
|
38
|
-
props:
|
|
38
|
+
props: a
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
return he.Fragment = s, he.jsx = n, he.jsxs = n, he;
|
|
@@ -116,7 +116,7 @@ function vt() {
|
|
|
116
116
|
), s(f);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function r(f) {
|
|
120
120
|
if (f === j) return "<>";
|
|
121
121
|
if (typeof f == "object" && f !== null && f.$$typeof === V)
|
|
122
122
|
return "<...>";
|
|
@@ -131,7 +131,7 @@ function vt() {
|
|
|
131
131
|
var f = G.A;
|
|
132
132
|
return f === null ? null : f.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function a() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(f) {
|
|
@@ -153,13 +153,13 @@ function vt() {
|
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function c() {
|
|
157
157
|
var f = t(this.type);
|
|
158
158
|
return R[f] || (R[f] = !0, console.error(
|
|
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
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function d(f, $, z, W, ne, oe) {
|
|
163
163
|
var q = z.ref;
|
|
164
164
|
return f = {
|
|
165
165
|
$$typeof: x,
|
|
@@ -169,7 +169,7 @@ function vt() {
|
|
|
169
169
|
_owner: W
|
|
170
170
|
}, (q !== void 0 ? q : null) !== null ? Object.defineProperty(f, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
172
|
+
get: c
|
|
173
173
|
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -207,8 +207,8 @@ function vt() {
|
|
|
207
207
|
else p(q);
|
|
208
208
|
if (F.call($, "key")) {
|
|
209
209
|
q = t(f);
|
|
210
|
-
var Q = Object.keys($).filter(function(
|
|
211
|
-
return
|
|
210
|
+
var Q = Object.keys($).filter(function(we) {
|
|
211
|
+
return we !== "key";
|
|
212
212
|
});
|
|
213
213
|
W = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", k[q + W] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -231,7 +231,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
231
|
return q && l(
|
|
232
232
|
z,
|
|
233
233
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
234
|
-
),
|
|
234
|
+
), d(
|
|
235
235
|
f,
|
|
236
236
|
q,
|
|
237
237
|
z,
|
|
@@ -256,8 +256,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
256
256
|
};
|
|
257
257
|
var y, R = {}, O = u.react_stack_bottom_frame.bind(
|
|
258
258
|
u,
|
|
259
|
-
|
|
260
|
-
)(), H = _(a
|
|
259
|
+
a
|
|
260
|
+
)(), H = _(r(a)), k = {};
|
|
261
261
|
xe.Fragment = j, xe.jsx = function(f, $, z) {
|
|
262
262
|
var W = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return m(
|
|
@@ -266,7 +266,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
266
266
|
z,
|
|
267
267
|
!1,
|
|
268
268
|
W ? Error("react-stack-top-frame") : O,
|
|
269
|
-
W ? _(
|
|
269
|
+
W ? _(r(f)) : H
|
|
270
270
|
);
|
|
271
271
|
}, xe.jsxs = function(f, $, z) {
|
|
272
272
|
var W = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
@@ -276,21 +276,21 @@ React keys must be passed directly to JSX without using spread:
|
|
|
276
276
|
z,
|
|
277
277
|
!0,
|
|
278
278
|
W ? Error("react-stack-top-frame") : O,
|
|
279
|
-
W ? _(
|
|
279
|
+
W ? _(r(f)) : H
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), xe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
286
|
-
function _t({ size: t = "m", color: s = "default", className: n = "", ...
|
|
284
|
+
process.env.NODE_ENV === "production" ? ke.exports = xt() : ke.exports = vt();
|
|
285
|
+
var e = ke.exports;
|
|
286
|
+
function _t({ size: t = "m", color: s = "default", className: n = "", ...r }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
290
290
|
className: ["ds-spinner", `ds-spinner--${t}`, `ds-spinner--${s}`, n].filter(Boolean).join(" "),
|
|
291
291
|
role: "status",
|
|
292
292
|
"aria-label": "Loading",
|
|
293
|
-
...
|
|
293
|
+
...r
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}
|
|
@@ -299,13 +299,13 @@ function ae({
|
|
|
299
299
|
children: t,
|
|
300
300
|
variant: s = "primary",
|
|
301
301
|
size: n = "m",
|
|
302
|
-
fullWidth:
|
|
302
|
+
fullWidth: r = !1,
|
|
303
303
|
icon: o,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: a = !1,
|
|
305
305
|
state: i = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
308
|
-
href:
|
|
307
|
+
type: c = "button",
|
|
308
|
+
href: d,
|
|
309
309
|
"aria-label": m,
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
@@ -314,16 +314,16 @@ function ae({
|
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${s}`,
|
|
316
316
|
`ds-button--${n}`,
|
|
317
|
-
|
|
317
|
+
r && "ds-button--full",
|
|
318
318
|
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
320
|
].filter(Boolean).join(" "), U = i !== "idle" ? i : void 0, K = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
321
|
E ? L : o && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: o }),
|
|
322
322
|
t
|
|
323
323
|
] });
|
|
324
|
-
if (
|
|
324
|
+
if (d) {
|
|
325
325
|
const V = (w) => {
|
|
326
|
-
if (
|
|
326
|
+
if (a || x) {
|
|
327
327
|
w.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
@@ -333,10 +333,10 @@ function ae({
|
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: C,
|
|
336
|
-
href:
|
|
336
|
+
href: a || x ? void 0 : d,
|
|
337
337
|
onClick: V,
|
|
338
338
|
"aria-label": m,
|
|
339
|
-
"aria-disabled":
|
|
339
|
+
"aria-disabled": a || x ? "true" : void 0,
|
|
340
340
|
"aria-busy": x ? "true" : void 0,
|
|
341
341
|
"data-state": U,
|
|
342
342
|
...h,
|
|
@@ -347,9 +347,9 @@ function ae({
|
|
|
347
347
|
return /* @__PURE__ */ e.jsx(
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
|
-
type:
|
|
350
|
+
type: c,
|
|
351
351
|
className: C,
|
|
352
|
-
disabled:
|
|
352
|
+
disabled: a,
|
|
353
353
|
onClick: x ? void 0 : l,
|
|
354
354
|
"aria-label": m,
|
|
355
355
|
"aria-busy": x ? "true" : void 0,
|
|
@@ -363,17 +363,17 @@ function is({
|
|
|
363
363
|
label: t,
|
|
364
364
|
error: s,
|
|
365
365
|
hint: n,
|
|
366
|
-
fullWidth:
|
|
366
|
+
fullWidth: r = !0,
|
|
367
367
|
icon: o,
|
|
368
|
-
iconRight:
|
|
368
|
+
iconRight: a,
|
|
369
369
|
onIconRightClick: i,
|
|
370
370
|
size: l = "m",
|
|
371
|
-
disabled:
|
|
372
|
-
id:
|
|
371
|
+
disabled: c,
|
|
372
|
+
id: d,
|
|
373
373
|
...m
|
|
374
374
|
}) {
|
|
375
|
-
const p =
|
|
376
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${
|
|
375
|
+
const p = d || `input-${Y.useId()}`, h = n ? `${p}-hint` : void 0, u = s ? `${p}-error` : void 0, x = u || h;
|
|
376
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${r ? "ds-input-wrapper--full" : ""} ${c ? "ds-input-wrapper--disabled" : ""} ${s ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
377
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: t }),
|
|
378
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
379
379
|
o && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: o }),
|
|
@@ -381,14 +381,14 @@ function is({
|
|
|
381
381
|
"input",
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
|
-
className: `ds-input ds-input--${l} ${o ? "ds-input--with-icon" : ""} ${
|
|
385
|
-
disabled:
|
|
384
|
+
className: `ds-input ds-input--${l} ${o ? "ds-input--with-icon" : ""} ${a ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
|
|
385
|
+
disabled: c,
|
|
386
386
|
"aria-invalid": s ? "true" : "false",
|
|
387
387
|
"aria-describedby": x,
|
|
388
388
|
...m
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
|
|
391
|
+
a && /* @__PURE__ */ e.jsx(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
@@ -396,7 +396,7 @@ function is({
|
|
|
396
396
|
onClick: i,
|
|
397
397
|
tabIndex: -1,
|
|
398
398
|
"aria-label": "Toggle visibility",
|
|
399
|
-
children:
|
|
399
|
+
children: a
|
|
400
400
|
}
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
@@ -408,27 +408,27 @@ function ls({
|
|
|
408
408
|
label: t,
|
|
409
409
|
error: s,
|
|
410
410
|
hint: n,
|
|
411
|
-
fullWidth:
|
|
411
|
+
fullWidth: r = !0,
|
|
412
412
|
size: o = "m",
|
|
413
|
-
disabled:
|
|
413
|
+
disabled: a,
|
|
414
414
|
id: i,
|
|
415
415
|
resize: l = !0,
|
|
416
|
-
rows:
|
|
417
|
-
...
|
|
416
|
+
rows: c = 3,
|
|
417
|
+
...d
|
|
418
418
|
}) {
|
|
419
419
|
const m = i || `textarea-${Y.useId()}`, p = n ? `${m}-hint` : void 0, h = s ? `${m}-error` : void 0, u = h || p;
|
|
420
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${
|
|
420
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${r ? "ds-textarea-wrapper--full" : ""} ${a ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
421
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: m, children: t }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
423
423
|
"textarea",
|
|
424
424
|
{
|
|
425
425
|
id: m,
|
|
426
426
|
className: `ds-textarea ds-textarea--${o} ${s ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: a,
|
|
428
428
|
"aria-invalid": s ? "true" : "false",
|
|
429
429
|
"aria-describedby": u,
|
|
430
|
-
rows:
|
|
431
|
-
...
|
|
430
|
+
rows: c,
|
|
431
|
+
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
434
|
n && !s && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: n }),
|
|
@@ -439,23 +439,23 @@ function cs({
|
|
|
439
439
|
label: t,
|
|
440
440
|
value: s,
|
|
441
441
|
onChange: n,
|
|
442
|
-
options:
|
|
442
|
+
options: r = [],
|
|
443
443
|
placeholder: o = "Select option",
|
|
444
|
-
error:
|
|
444
|
+
error: a,
|
|
445
445
|
fullWidth: i = !0,
|
|
446
446
|
size: l = "m",
|
|
447
|
-
disabled:
|
|
448
|
-
id:
|
|
447
|
+
disabled: c = !1,
|
|
448
|
+
id: d,
|
|
449
449
|
...m
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = I(!1), [u, x] = I(!1), [v, j] = I({}), [E, g] = I("down"), [b, S] = I(-1), L = T(null), C = T(null), U = T(null), K = T(null), V =
|
|
451
|
+
const [p, h] = I(!1), [u, x] = I(!1), [v, j] = I({}), [E, g] = I("down"), [b, S] = I(-1), L = T(null), C = T(null), U = T(null), K = T(null), V = d || `select-${Y.useId()}`, w = `${V}-label`, M = a ? `${V}-error` : void 0, G = 150, F = (k = !1) => {
|
|
452
452
|
u || (x(!0), S(-1), K.current = setTimeout(() => {
|
|
453
453
|
var f;
|
|
454
454
|
h(!1), x(!1), k && ((f = U.current) == null || f.focus());
|
|
455
455
|
}, G));
|
|
456
456
|
}, A = (k) => {
|
|
457
457
|
clearTimeout(K.current), x(!1);
|
|
458
|
-
const f = k !== void 0 ? k : Math.max(
|
|
458
|
+
const f = k !== void 0 ? k : Math.max(r.findIndex(($) => $.value === s), 0);
|
|
459
459
|
S(f), h(!0);
|
|
460
460
|
};
|
|
461
461
|
D(() => () => clearTimeout(K.current), []);
|
|
@@ -486,20 +486,20 @@ function cs({
|
|
|
486
486
|
const y = (k) => {
|
|
487
487
|
switch (k.key) {
|
|
488
488
|
case "ArrowDown":
|
|
489
|
-
k.preventDefault(), p ? S((f) => Math.min(f + 1,
|
|
489
|
+
k.preventDefault(), p ? S((f) => Math.min(f + 1, r.length - 1)) : A();
|
|
490
490
|
break;
|
|
491
491
|
case "ArrowUp":
|
|
492
|
-
k.preventDefault(), p ? S((f) => Math.max(f - 1, 0)) : A(
|
|
492
|
+
k.preventDefault(), p ? S((f) => Math.max(f - 1, 0)) : A(r.length - 1);
|
|
493
493
|
break;
|
|
494
494
|
case "Home":
|
|
495
495
|
p && (k.preventDefault(), S(0));
|
|
496
496
|
break;
|
|
497
497
|
case "End":
|
|
498
|
-
p && (k.preventDefault(), S(
|
|
498
|
+
p && (k.preventDefault(), S(r.length - 1));
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
k.preventDefault(), p ? b >= 0 && (n == null || n(
|
|
502
|
+
k.preventDefault(), p ? b >= 0 && (n == null || n(r[b].value), F(!0)) : A();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
505
|
p && (k.preventDefault(), F(!0));
|
|
@@ -508,7 +508,7 @@ function cs({
|
|
|
508
508
|
p && F(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
}, R =
|
|
511
|
+
}, R = r.find((k) => k.value === s), O = l === "xs" ? P[1] : l === "small" ? P[2] : P[3], H = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
514
|
ref: C,
|
|
@@ -523,7 +523,7 @@ function cs({
|
|
|
523
523
|
u && "ds-select-dropdown--closing"
|
|
524
524
|
].filter(Boolean).join(" "),
|
|
525
525
|
style: v,
|
|
526
|
-
children:
|
|
526
|
+
children: r.map((k, f) => /* @__PURE__ */ e.jsx(
|
|
527
527
|
"button",
|
|
528
528
|
{
|
|
529
529
|
id: `${V}-opt-${f}`,
|
|
@@ -546,7 +546,7 @@ function cs({
|
|
|
546
546
|
))
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${
|
|
549
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${c ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
550
550
|
t && /* @__PURE__ */ e.jsx("label", { id: w, className: "ds-select-label", children: t }),
|
|
551
551
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: L, children: /* @__PURE__ */ e.jsxs(
|
|
552
552
|
"button",
|
|
@@ -559,14 +559,14 @@ function cs({
|
|
|
559
559
|
"aria-expanded": p,
|
|
560
560
|
"aria-activedescendant": p && b >= 0 ? `${V}-opt-${b}` : void 0,
|
|
561
561
|
"aria-labelledby": t ? w : void 0,
|
|
562
|
-
"aria-invalid":
|
|
562
|
+
"aria-invalid": a ? "true" : "false",
|
|
563
563
|
"aria-describedby": M,
|
|
564
|
-
className: `ds-select-trigger ds-select-trigger--${l} ${
|
|
564
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${a ? "ds-select-trigger--error" : ""}`,
|
|
565
565
|
onClick: () => {
|
|
566
|
-
|
|
566
|
+
c || (p ? F() : A());
|
|
567
567
|
},
|
|
568
568
|
onKeyDown: y,
|
|
569
|
-
disabled:
|
|
569
|
+
disabled: c,
|
|
570
570
|
...m,
|
|
571
571
|
children: [
|
|
572
572
|
/* @__PURE__ */ e.jsx("span", { className: R ? "" : "ds-select-placeholder", children: (R == null ? void 0 : R.label) || o }),
|
|
@@ -582,7 +582,7 @@ function cs({
|
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
) }),
|
|
585
|
-
|
|
585
|
+
a && /* @__PURE__ */ e.jsx("span", { id: M, className: "ds-select-error", role: "alert", children: a }),
|
|
586
586
|
typeof document < "u" && pe.createPortal(H, document.body)
|
|
587
587
|
] });
|
|
588
588
|
}
|
|
@@ -590,39 +590,39 @@ function ds({
|
|
|
590
590
|
label: t,
|
|
591
591
|
value: s = 0,
|
|
592
592
|
onChange: n,
|
|
593
|
-
min:
|
|
593
|
+
min: r = 0,
|
|
594
594
|
max: o = 100,
|
|
595
|
-
step:
|
|
595
|
+
step: a = 1,
|
|
596
596
|
size: i = "m",
|
|
597
597
|
disabled: l = !1,
|
|
598
|
-
hint:
|
|
599
|
-
error:
|
|
598
|
+
hint: c,
|
|
599
|
+
error: d,
|
|
600
600
|
...m
|
|
601
601
|
}) {
|
|
602
602
|
const p = () => {
|
|
603
603
|
if (l) return;
|
|
604
|
-
const E = Math.min(Number(s) +
|
|
604
|
+
const E = Math.min(Number(s) + a, o);
|
|
605
605
|
n == null || n(E);
|
|
606
606
|
}, h = () => {
|
|
607
607
|
if (l) return;
|
|
608
|
-
const E = Math.max(Number(s) -
|
|
608
|
+
const E = Math.max(Number(s) - a, r);
|
|
609
609
|
n == null || n(E);
|
|
610
610
|
}, u = (E) => {
|
|
611
611
|
if (l) return;
|
|
612
612
|
const g = E.target.value;
|
|
613
613
|
if (g === "") {
|
|
614
|
-
n == null || n(
|
|
614
|
+
n == null || n(r);
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
617
|
const b = Number(g);
|
|
618
618
|
if (!isNaN(b)) {
|
|
619
|
-
const S = Math.min(Math.max(b,
|
|
619
|
+
const S = Math.min(Math.max(b, r), o);
|
|
620
620
|
n == null || n(S);
|
|
621
621
|
}
|
|
622
622
|
}, x = [
|
|
623
623
|
"ds-stepper-wrapper",
|
|
624
624
|
l && "ds-stepper-wrapper--disabled",
|
|
625
|
-
|
|
625
|
+
d && "ds-stepper-wrapper--error"
|
|
626
626
|
].filter(Boolean).join(" "), v = [
|
|
627
627
|
"ds-stepper",
|
|
628
628
|
`ds-stepper--${i}`,
|
|
@@ -637,7 +637,7 @@ function ds({
|
|
|
637
637
|
type: "button",
|
|
638
638
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
639
639
|
onClick: h,
|
|
640
|
-
disabled: l || s <=
|
|
640
|
+
disabled: l || s <= r,
|
|
641
641
|
"aria-label": "Decrease",
|
|
642
642
|
children: /* @__PURE__ */ e.jsx(tt, { size: j, strokeWidth: 1.5 })
|
|
643
643
|
}
|
|
@@ -649,9 +649,9 @@ function ds({
|
|
|
649
649
|
className: "ds-stepper-input",
|
|
650
650
|
value: s,
|
|
651
651
|
onChange: u,
|
|
652
|
-
min:
|
|
652
|
+
min: r,
|
|
653
653
|
max: o,
|
|
654
|
-
step:
|
|
654
|
+
step: a,
|
|
655
655
|
disabled: l,
|
|
656
656
|
...m
|
|
657
657
|
}
|
|
@@ -668,27 +668,27 @@ function ds({
|
|
|
668
668
|
}
|
|
669
669
|
)
|
|
670
670
|
] }),
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
c && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: c }),
|
|
672
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
673
673
|
] });
|
|
674
674
|
}
|
|
675
675
|
function us({
|
|
676
676
|
children: t,
|
|
677
677
|
padding: s = "m",
|
|
678
678
|
variant: n = "info",
|
|
679
|
-
hover:
|
|
679
|
+
hover: r = !1,
|
|
680
680
|
// deprecated, use variant="interactive"
|
|
681
681
|
onClick: o,
|
|
682
|
-
href:
|
|
682
|
+
href: a,
|
|
683
683
|
disabled: i = !1,
|
|
684
684
|
...l
|
|
685
685
|
}) {
|
|
686
|
-
const
|
|
686
|
+
const d = (r ? "interactive" : n) === "interactive" || o || a, m = [
|
|
687
687
|
"ds-card",
|
|
688
688
|
`ds-card--${s}`,
|
|
689
|
-
|
|
689
|
+
d && "ds-card--interactive"
|
|
690
690
|
].filter(Boolean).join(" ");
|
|
691
|
-
if (
|
|
691
|
+
if (a) {
|
|
692
692
|
const u = (x) => {
|
|
693
693
|
if (i) {
|
|
694
694
|
x.preventDefault();
|
|
@@ -700,7 +700,7 @@ function us({
|
|
|
700
700
|
"a",
|
|
701
701
|
{
|
|
702
702
|
className: m,
|
|
703
|
-
href: i ? void 0 :
|
|
703
|
+
href: i ? void 0 : a,
|
|
704
704
|
onClick: u,
|
|
705
705
|
"aria-disabled": i ? "true" : void 0,
|
|
706
706
|
...l,
|
|
@@ -708,7 +708,7 @@ function us({
|
|
|
708
708
|
}
|
|
709
709
|
);
|
|
710
710
|
}
|
|
711
|
-
const p =
|
|
711
|
+
const p = d && o ? "button" : "div", h = d && o ? {
|
|
712
712
|
type: "button",
|
|
713
713
|
onClick: o,
|
|
714
714
|
disabled: i
|
|
@@ -717,7 +717,7 @@ function us({
|
|
|
717
717
|
p,
|
|
718
718
|
{
|
|
719
719
|
className: m,
|
|
720
|
-
role:
|
|
720
|
+
role: d && !o ? "article" : void 0,
|
|
721
721
|
...h,
|
|
722
722
|
...l,
|
|
723
723
|
children: t
|
|
@@ -749,15 +749,15 @@ function de({
|
|
|
749
749
|
children: t,
|
|
750
750
|
variant: s = "default",
|
|
751
751
|
size: n = "m",
|
|
752
|
-
role:
|
|
752
|
+
role: r,
|
|
753
753
|
...o
|
|
754
754
|
}) {
|
|
755
|
-
const
|
|
755
|
+
const a = [
|
|
756
756
|
"ds-badge",
|
|
757
757
|
`ds-badge--${s}`,
|
|
758
758
|
`ds-badge--${n}`
|
|
759
|
-
].filter(Boolean).join(" "), i =
|
|
760
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
759
|
+
].filter(Boolean).join(" "), i = r || (["info", "success", "warning", "error"].includes(s) ? "status" : void 0);
|
|
760
|
+
return /* @__PURE__ */ e.jsx("span", { className: a, role: i, ...o, children: t });
|
|
761
761
|
}
|
|
762
762
|
const Nt = {
|
|
763
763
|
info: Ie,
|
|
@@ -767,16 +767,16 @@ const Nt = {
|
|
|
767
767
|
}, vs = Y.forwardRef(function({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: n = "info",
|
|
770
|
-
title:
|
|
770
|
+
title: r,
|
|
771
771
|
onClose: o,
|
|
772
|
-
role:
|
|
772
|
+
role: a,
|
|
773
773
|
...i
|
|
774
774
|
}, l) {
|
|
775
|
-
const
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: `ds-alert ds-alert--${n} ${
|
|
777
|
-
|
|
775
|
+
const c = Nt[n], d = a || (n === "error" ? "alert" : "status");
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: `ds-alert ds-alert--${n} ${r ? "" : "ds-alert--no-title"}`, role: d, ...i, children: [
|
|
777
|
+
c && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(c, { size: P[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
|
-
|
|
779
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
781
781
|
] }),
|
|
782
782
|
o && /* @__PURE__ */ e.jsx(
|
|
@@ -795,13 +795,13 @@ function _s({
|
|
|
795
795
|
children: t,
|
|
796
796
|
title: s,
|
|
797
797
|
onClose: n,
|
|
798
|
-
size:
|
|
798
|
+
size: r = "m",
|
|
799
799
|
scrollable: o = !1,
|
|
800
|
-
subHeader:
|
|
800
|
+
subHeader: a,
|
|
801
801
|
...i
|
|
802
802
|
}) {
|
|
803
|
-
const l = T(null),
|
|
804
|
-
!n ||
|
|
803
|
+
const l = T(null), c = Y.useId(), [d, m] = I(!1), p = () => {
|
|
804
|
+
!n || d || (m(!0), setTimeout(() => {
|
|
805
805
|
m(!1), n();
|
|
806
806
|
}, wt));
|
|
807
807
|
};
|
|
@@ -816,16 +816,16 @@ function _s({
|
|
|
816
816
|
return document.addEventListener("keydown", v), document.addEventListener("mousedown", j), () => {
|
|
817
817
|
document.removeEventListener("keydown", v), document.removeEventListener("mousedown", j);
|
|
818
818
|
};
|
|
819
|
-
}, [n,
|
|
819
|
+
}, [n, d]);
|
|
820
820
|
const h = Y.Children.toArray(t), u = h.find((v) => (v == null ? void 0 : v.type) === fe), x = h.filter((v) => (v == null ? void 0 : v.type) !== fe);
|
|
821
|
-
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay",
|
|
821
|
+
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
|
-
className: [`ds-modal ds-modal--${
|
|
824
|
+
className: [`ds-modal ds-modal--${r}`, o && "ds-modal--scrollable"].filter(Boolean).join(" "),
|
|
825
825
|
ref: l,
|
|
826
826
|
role: "dialog",
|
|
827
827
|
"aria-modal": "true",
|
|
828
|
-
"aria-labelledby": s ?
|
|
828
|
+
"aria-labelledby": s ? c : void 0,
|
|
829
829
|
children: [
|
|
830
830
|
n && /* @__PURE__ */ e.jsx(
|
|
831
831
|
ae,
|
|
@@ -838,9 +838,9 @@ function _s({
|
|
|
838
838
|
"aria-label": "Close modal"
|
|
839
839
|
}
|
|
840
840
|
),
|
|
841
|
-
(s ||
|
|
842
|
-
s && /* @__PURE__ */ e.jsx("h3", { id:
|
|
843
|
-
|
|
841
|
+
(s || a) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
842
|
+
s && /* @__PURE__ */ e.jsx("h3", { id: c, className: "ds-modal__title", children: s }),
|
|
843
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: a })
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: x }),
|
|
846
846
|
u
|
|
@@ -856,21 +856,21 @@ function bs({
|
|
|
856
856
|
children: t,
|
|
857
857
|
title: s,
|
|
858
858
|
onClose: n,
|
|
859
|
-
subHeader:
|
|
859
|
+
subHeader: r,
|
|
860
860
|
...o
|
|
861
861
|
}) {
|
|
862
|
-
const
|
|
863
|
-
!n || l || (
|
|
864
|
-
|
|
862
|
+
const a = T(null), i = Y.useId(), [l, c] = I(!1), d = () => {
|
|
863
|
+
!n || l || (c(!0), setTimeout(() => {
|
|
864
|
+
c(!1), n();
|
|
865
865
|
}, gt));
|
|
866
866
|
};
|
|
867
867
|
D(() => {
|
|
868
868
|
const u = (v) => {
|
|
869
|
-
v.key === "Escape" &&
|
|
869
|
+
v.key === "Escape" && d();
|
|
870
870
|
}, x = (v) => {
|
|
871
871
|
var E, g, b;
|
|
872
872
|
const j = ((g = (E = v.composedPath) == null ? void 0 : E.call(v)) == null ? void 0 : g[0]) ?? v.target;
|
|
873
|
-
|
|
873
|
+
a.current && !a.current.contains(j) && !((b = j.closest) != null && b.call(j, "[data-ds-portal]")) && d();
|
|
874
874
|
};
|
|
875
875
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", x), () => {
|
|
876
876
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", x);
|
|
@@ -885,7 +885,7 @@ function bs({
|
|
|
885
885
|
children: /* @__PURE__ */ e.jsxs(
|
|
886
886
|
"div",
|
|
887
887
|
{
|
|
888
|
-
ref:
|
|
888
|
+
ref: a,
|
|
889
889
|
className: ["ds-bottom-sheet", l && "ds-bottom-sheet--closing"].filter(Boolean).join(" "),
|
|
890
890
|
role: "dialog",
|
|
891
891
|
"aria-modal": "true",
|
|
@@ -899,13 +899,13 @@ function bs({
|
|
|
899
899
|
variant: "ghost",
|
|
900
900
|
size: "small",
|
|
901
901
|
icon: /* @__PURE__ */ e.jsx(ee, { size: P[2], strokeWidth: 1.5 }),
|
|
902
|
-
onClick:
|
|
902
|
+
onClick: d,
|
|
903
903
|
"aria-label": "Close"
|
|
904
904
|
}
|
|
905
905
|
),
|
|
906
|
-
(s ||
|
|
906
|
+
(s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-bottom-sheet__header", children: [
|
|
907
907
|
s && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-bottom-sheet__title", children: s }),
|
|
908
|
-
|
|
908
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__subheader", children: r })
|
|
909
909
|
] }),
|
|
910
910
|
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: h }),
|
|
911
911
|
p
|
|
@@ -919,17 +919,17 @@ function yt({
|
|
|
919
919
|
children: t,
|
|
920
920
|
title: s = "Code",
|
|
921
921
|
defaultExpanded: n = !1,
|
|
922
|
-
expanded:
|
|
922
|
+
expanded: r,
|
|
923
923
|
onToggle: o,
|
|
924
|
-
padding:
|
|
924
|
+
padding: a = "s",
|
|
925
925
|
className: i = "",
|
|
926
926
|
...l
|
|
927
927
|
}) {
|
|
928
|
-
const [
|
|
929
|
-
m ? o == null || o(!
|
|
928
|
+
const [c, d] = I(n), m = r !== void 0, p = m ? r : c, h = () => {
|
|
929
|
+
m ? o == null || o(!r) : d((x) => !x);
|
|
930
930
|
}, u = [
|
|
931
931
|
"ds-code-accordion",
|
|
932
|
-
`ds-code-accordion--${
|
|
932
|
+
`ds-code-accordion--${a}`,
|
|
933
933
|
p && "ds-code-accordion--expanded",
|
|
934
934
|
i
|
|
935
935
|
].filter(Boolean).join(" ");
|
|
@@ -957,41 +957,41 @@ function yt({
|
|
|
957
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: t }) }) }) })
|
|
958
958
|
] });
|
|
959
959
|
}
|
|
960
|
-
function js({ children: t, block: s = !1, collapsible: n = !1, title:
|
|
961
|
-
return s ? n ? /* @__PURE__ */ e.jsx(yt, { title:
|
|
960
|
+
function js({ children: t, block: s = !1, collapsible: n = !1, title: r = "Code", defaultExpanded: o = !1, ...a }) {
|
|
961
|
+
return s ? n ? /* @__PURE__ */ e.jsx(yt, { title: r, defaultExpanded: o, ...a, children: t }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...a, children: /* @__PURE__ */ e.jsx("code", { children: t }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...a, children: t });
|
|
962
962
|
}
|
|
963
|
-
function Ns({ href: t, children: s, onClick: n, target:
|
|
964
|
-
const l =
|
|
963
|
+
function Ns({ href: t, children: s, onClick: n, target: r, rel: o, ...a }) {
|
|
964
|
+
const l = r === "_blank" ? o ? `${o} noopener noreferrer` : "noopener noreferrer" : o;
|
|
965
965
|
return /* @__PURE__ */ e.jsx(
|
|
966
966
|
"a",
|
|
967
967
|
{
|
|
968
968
|
href: t,
|
|
969
969
|
className: "ds-link",
|
|
970
970
|
onClick: n,
|
|
971
|
-
target:
|
|
971
|
+
target: r,
|
|
972
972
|
rel: l,
|
|
973
|
-
...
|
|
973
|
+
...a,
|
|
974
974
|
children: s
|
|
975
975
|
}
|
|
976
976
|
);
|
|
977
977
|
}
|
|
978
|
-
function ws({ children: t, size: s = "m", variant: n = "ghost", ...
|
|
979
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...
|
|
978
|
+
function ws({ children: t, size: s = "m", variant: n = "ghost", ...r }) {
|
|
979
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...r, children: Y.Children.map(t, (o) => Y.isValidElement(o) ? Y.cloneElement(o, { size: s, variant: n }) : o) });
|
|
980
980
|
}
|
|
981
|
-
function gs({ children: t, selected: s = !1, onClick: n, size:
|
|
982
|
-
const
|
|
981
|
+
function gs({ children: t, selected: s = !1, onClick: n, size: r = "m", variant: o = "ghost", disabled: a = !1, icon: i, href: l, ...c }) {
|
|
982
|
+
const d = i && !t, m = [
|
|
983
983
|
"ds-tab",
|
|
984
|
-
`ds-tab--${
|
|
984
|
+
`ds-tab--${r}`,
|
|
985
985
|
`ds-tab--${o}`,
|
|
986
986
|
s && "ds-tab--selected",
|
|
987
|
-
|
|
987
|
+
d && "ds-tab--icon-only"
|
|
988
988
|
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
989
989
|
i && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: i }),
|
|
990
990
|
t
|
|
991
991
|
] });
|
|
992
992
|
if (l) {
|
|
993
993
|
const h = (u) => {
|
|
994
|
-
if (
|
|
994
|
+
if (a) {
|
|
995
995
|
u.preventDefault();
|
|
996
996
|
return;
|
|
997
997
|
}
|
|
@@ -1002,11 +1002,11 @@ function gs({ children: t, selected: s = !1, onClick: n, size: a = "m", variant:
|
|
|
1002
1002
|
{
|
|
1003
1003
|
role: "tab",
|
|
1004
1004
|
"aria-current": s ? "page" : void 0,
|
|
1005
|
-
"aria-disabled":
|
|
1005
|
+
"aria-disabled": a ? "true" : void 0,
|
|
1006
1006
|
className: m,
|
|
1007
|
-
href:
|
|
1007
|
+
href: a ? void 0 : l,
|
|
1008
1008
|
onClick: h,
|
|
1009
|
-
...
|
|
1009
|
+
...c,
|
|
1010
1010
|
children: p
|
|
1011
1011
|
}
|
|
1012
1012
|
);
|
|
@@ -1018,44 +1018,44 @@ function gs({ children: t, selected: s = !1, onClick: n, size: a = "m", variant:
|
|
|
1018
1018
|
"aria-selected": s,
|
|
1019
1019
|
className: m,
|
|
1020
1020
|
onClick: n,
|
|
1021
|
-
disabled:
|
|
1022
|
-
...
|
|
1021
|
+
disabled: a,
|
|
1022
|
+
...c,
|
|
1023
1023
|
children: p
|
|
1024
1024
|
}
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
1027
|
-
function ys({ options: t, value: s, onChange: n, size:
|
|
1028
|
-
const
|
|
1029
|
-
if (!
|
|
1030
|
-
const u =
|
|
1027
|
+
function ys({ options: t, value: s, onChange: n, size: r = "m", disabled: o = !1 }) {
|
|
1028
|
+
const a = T(null), i = T(null), [l, c] = I(!1), d = T(!1), m = T(null), p = T(null), h = () => {
|
|
1029
|
+
if (!a.current) return;
|
|
1030
|
+
const u = a.current.querySelector(`[data-value="${s}"]`);
|
|
1031
1031
|
if (!u) return;
|
|
1032
|
-
const x =
|
|
1033
|
-
i.current ? (i.current.style.transition =
|
|
1034
|
-
if (!i.current || !
|
|
1035
|
-
const g =
|
|
1032
|
+
const x = a.current.getBoundingClientRect(), v = u.getBoundingClientRect(), j = v.left - x.left, E = v.width;
|
|
1033
|
+
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = j + "px", i.current.style.width = E + "px", d.current = !1) : (c(!0), requestAnimationFrame(() => {
|
|
1034
|
+
if (!i.current || !a.current) return;
|
|
1035
|
+
const g = a.current.querySelector(`[data-value="${s}"]`);
|
|
1036
1036
|
if (!g) return;
|
|
1037
|
-
const b =
|
|
1037
|
+
const b = a.current.getBoundingClientRect(), S = g.getBoundingClientRect();
|
|
1038
1038
|
i.current.style.transition = "none", i.current.style.left = S.left - b.left + "px", i.current.style.width = S.width + "px";
|
|
1039
1039
|
}));
|
|
1040
1040
|
};
|
|
1041
1041
|
return p.current = h, Ze(() => {
|
|
1042
1042
|
const u = m.current !== s;
|
|
1043
|
-
m.current = s,
|
|
1043
|
+
m.current = s, d.current = l && u, h();
|
|
1044
1044
|
}), D(() => {
|
|
1045
|
-
if (!
|
|
1045
|
+
if (!a.current) return;
|
|
1046
1046
|
const u = new ResizeObserver(() => {
|
|
1047
|
-
|
|
1047
|
+
d.current = !1, p.current();
|
|
1048
1048
|
});
|
|
1049
|
-
return u.observe(
|
|
1049
|
+
return u.observe(a.current), () => u.disconnect();
|
|
1050
1050
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
1051
1051
|
"div",
|
|
1052
1052
|
{
|
|
1053
1053
|
className: [
|
|
1054
1054
|
"ds-seg",
|
|
1055
|
-
`ds-seg--${
|
|
1055
|
+
`ds-seg--${r}`,
|
|
1056
1056
|
o && "ds-seg--disabled"
|
|
1057
1057
|
].filter(Boolean).join(" "),
|
|
1058
|
-
ref:
|
|
1058
|
+
ref: a,
|
|
1059
1059
|
role: "group",
|
|
1060
1060
|
children: [
|
|
1061
1061
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -1090,16 +1090,16 @@ function Be({
|
|
|
1090
1090
|
children: t,
|
|
1091
1091
|
title: s,
|
|
1092
1092
|
defaultExpanded: n = !1,
|
|
1093
|
-
expanded:
|
|
1093
|
+
expanded: r,
|
|
1094
1094
|
onToggle: o,
|
|
1095
|
-
padding:
|
|
1095
|
+
padding: a = "m",
|
|
1096
1096
|
...i
|
|
1097
1097
|
}) {
|
|
1098
|
-
const [l,
|
|
1099
|
-
|
|
1098
|
+
const [l, c] = I(n), d = r !== void 0, m = d ? r : l, p = () => {
|
|
1099
|
+
d ? o == null || o(!r) : c((u) => !u);
|
|
1100
1100
|
}, h = [
|
|
1101
1101
|
"ds-accordion",
|
|
1102
|
-
`ds-accordion--${
|
|
1102
|
+
`ds-accordion--${a}`,
|
|
1103
1103
|
m && "ds-accordion--expanded"
|
|
1104
1104
|
].filter(Boolean).join(" ");
|
|
1105
1105
|
return /* @__PURE__ */ e.jsxs("div", { className: h, ...i, children: [
|
|
@@ -1128,41 +1128,41 @@ function Be({
|
|
|
1128
1128
|
}
|
|
1129
1129
|
const re = 8, ue = 8;
|
|
1130
1130
|
function kt(t, s, n) {
|
|
1131
|
-
const
|
|
1132
|
-
let o,
|
|
1131
|
+
const r = window.innerWidth;
|
|
1132
|
+
let o, a;
|
|
1133
1133
|
switch (t) {
|
|
1134
1134
|
case "top":
|
|
1135
|
-
o = s.top - n.height - re,
|
|
1135
|
+
o = s.top - n.height - re, a = s.left + s.width / 2 - n.width / 2;
|
|
1136
1136
|
break;
|
|
1137
1137
|
case "bottom":
|
|
1138
|
-
o = s.bottom + re,
|
|
1138
|
+
o = s.bottom + re, a = s.left + s.width / 2 - n.width / 2;
|
|
1139
1139
|
break;
|
|
1140
1140
|
case "left":
|
|
1141
|
-
o = s.top + s.height / 2 - n.height / 2,
|
|
1141
|
+
o = s.top + s.height / 2 - n.height / 2, a = s.left - n.width - re;
|
|
1142
1142
|
break;
|
|
1143
1143
|
case "right":
|
|
1144
|
-
o = s.top + s.height / 2 - n.height / 2,
|
|
1144
|
+
o = s.top + s.height / 2 - n.height / 2, a = s.right + re;
|
|
1145
1145
|
break;
|
|
1146
1146
|
default:
|
|
1147
|
-
o = s.bottom + re,
|
|
1147
|
+
o = s.bottom + re, a = s.left;
|
|
1148
1148
|
}
|
|
1149
|
-
const i = Math.max(ue, Math.min(
|
|
1149
|
+
const i = Math.max(ue, Math.min(r - n.width - ue, a)), l = a - i;
|
|
1150
1150
|
return { top: o, left: i, arrowOffset: l };
|
|
1151
1151
|
}
|
|
1152
1152
|
function Et(t, s, n) {
|
|
1153
|
-
const
|
|
1153
|
+
const r = window.innerWidth, o = window.innerHeight;
|
|
1154
1154
|
if (t.top >= s + re + ue) return "top";
|
|
1155
1155
|
if (o - t.bottom >= s + re + ue) return "bottom";
|
|
1156
|
-
if (
|
|
1156
|
+
if (r - t.right >= n + re + ue) return "right";
|
|
1157
1157
|
if (t.left >= n + re + ue) return "left";
|
|
1158
|
-
const
|
|
1159
|
-
return
|
|
1158
|
+
const a = Math.max(t.top, o - t.bottom, t.left, r - t.right);
|
|
1159
|
+
return a === t.top ? "top" : a === o - t.bottom ? "bottom" : a === r - t.right ? "right" : "left";
|
|
1160
1160
|
}
|
|
1161
|
-
function De({ children: t, content: s, position: n, ...
|
|
1162
|
-
const [o,
|
|
1161
|
+
function De({ children: t, content: s, position: n, ...r }) {
|
|
1162
|
+
const [o, a] = I(!1), [i, l] = I({ visibility: "hidden" }), [c, d] = I(n || "top"), m = T(null), p = T(null), h = T(!1), u = () => {
|
|
1163
1163
|
if (!m.current || !p.current) return;
|
|
1164
1164
|
const v = m.current.getBoundingClientRect(), j = p.current.getBoundingClientRect(), E = n || Et(v, j.height, j.width), { top: g, left: b, arrowOffset: S } = kt(E, v, j);
|
|
1165
|
-
|
|
1165
|
+
d(E), l({
|
|
1166
1166
|
position: "fixed",
|
|
1167
1167
|
top: g,
|
|
1168
1168
|
left: b,
|
|
@@ -1180,7 +1180,7 @@ function De({ children: t, content: s, position: n, ...a }) {
|
|
|
1180
1180
|
}, [o, n]), D(() => {
|
|
1181
1181
|
if (!o) return;
|
|
1182
1182
|
const v = (j) => {
|
|
1183
|
-
m.current && !m.current.contains(j.target) &&
|
|
1183
|
+
m.current && !m.current.contains(j.target) && a(!1);
|
|
1184
1184
|
};
|
|
1185
1185
|
return document.addEventListener("touchstart", v), () => document.removeEventListener("touchstart", v);
|
|
1186
1186
|
}, [o]), !s) return t;
|
|
@@ -1189,7 +1189,7 @@ function De({ children: t, content: s, position: n, ...a }) {
|
|
|
1189
1189
|
{
|
|
1190
1190
|
ref: p,
|
|
1191
1191
|
"data-ds-portal": "",
|
|
1192
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1192
|
+
className: `ds-tooltip ds-tooltip--${c}`,
|
|
1193
1193
|
role: "tooltip",
|
|
1194
1194
|
style: i,
|
|
1195
1195
|
children: s
|
|
@@ -1201,15 +1201,15 @@ function De({ children: t, content: s, position: n, ...a }) {
|
|
|
1201
1201
|
ref: m,
|
|
1202
1202
|
className: "ds-tooltip-wrapper",
|
|
1203
1203
|
onMouseEnter: () => {
|
|
1204
|
-
h.current ||
|
|
1204
|
+
h.current || a(!0);
|
|
1205
1205
|
},
|
|
1206
1206
|
onMouseLeave: () => {
|
|
1207
|
-
h.current ||
|
|
1207
|
+
h.current || a(!1);
|
|
1208
1208
|
},
|
|
1209
1209
|
onTouchStart: () => {
|
|
1210
|
-
h.current = !0,
|
|
1210
|
+
h.current = !0, a((v) => !v);
|
|
1211
1211
|
},
|
|
1212
|
-
...
|
|
1212
|
+
...r,
|
|
1213
1213
|
children: [
|
|
1214
1214
|
t,
|
|
1215
1215
|
typeof document < "u" && pe.createPortal(x, document.body)
|
|
@@ -1221,17 +1221,17 @@ function ks({
|
|
|
1221
1221
|
checked: t = !1,
|
|
1222
1222
|
onChange: s,
|
|
1223
1223
|
size: n = "m",
|
|
1224
|
-
disabled:
|
|
1224
|
+
disabled: r = !1,
|
|
1225
1225
|
label: o,
|
|
1226
|
-
id:
|
|
1226
|
+
id: a,
|
|
1227
1227
|
...i
|
|
1228
1228
|
}) {
|
|
1229
|
-
const l =
|
|
1229
|
+
const l = a || `toggle-${Y.useId()}`, c = [
|
|
1230
1230
|
"ds-toggle",
|
|
1231
1231
|
`ds-toggle--${n}`,
|
|
1232
|
-
|
|
1232
|
+
r && "ds-toggle--disabled"
|
|
1233
1233
|
].filter(Boolean).join(" ");
|
|
1234
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1234
|
+
return /* @__PURE__ */ e.jsxs("label", { className: c, htmlFor: l, children: [
|
|
1235
1235
|
/* @__PURE__ */ e.jsx(
|
|
1236
1236
|
"input",
|
|
1237
1237
|
{
|
|
@@ -1239,8 +1239,8 @@ function ks({
|
|
|
1239
1239
|
id: l,
|
|
1240
1240
|
className: "ds-toggle__input",
|
|
1241
1241
|
checked: t,
|
|
1242
|
-
onChange: (
|
|
1243
|
-
disabled:
|
|
1242
|
+
onChange: (d) => s == null ? void 0 : s(d.target.checked),
|
|
1243
|
+
disabled: r,
|
|
1244
1244
|
...i
|
|
1245
1245
|
}
|
|
1246
1246
|
),
|
|
@@ -1252,17 +1252,17 @@ function Es({
|
|
|
1252
1252
|
checked: t = !1,
|
|
1253
1253
|
onChange: s,
|
|
1254
1254
|
size: n = "m",
|
|
1255
|
-
disabled:
|
|
1255
|
+
disabled: r = !1,
|
|
1256
1256
|
label: o,
|
|
1257
|
-
id:
|
|
1257
|
+
id: a,
|
|
1258
1258
|
...i
|
|
1259
1259
|
}) {
|
|
1260
|
-
const l =
|
|
1260
|
+
const l = a || `checkbox-${Y.useId()}`, c = [
|
|
1261
1261
|
"ds-checkbox",
|
|
1262
1262
|
`ds-checkbox--${n}`,
|
|
1263
|
-
|
|
1264
|
-
].filter(Boolean).join(" "),
|
|
1265
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1263
|
+
r && "ds-checkbox--disabled"
|
|
1264
|
+
].filter(Boolean).join(" "), d = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1265
|
+
return /* @__PURE__ */ e.jsxs("label", { className: c, htmlFor: l, children: [
|
|
1266
1266
|
/* @__PURE__ */ e.jsx(
|
|
1267
1267
|
"input",
|
|
1268
1268
|
{
|
|
@@ -1271,14 +1271,14 @@ function Es({
|
|
|
1271
1271
|
className: "ds-checkbox__input",
|
|
1272
1272
|
checked: t,
|
|
1273
1273
|
onChange: (m) => s == null ? void 0 : s(m.target.checked),
|
|
1274
|
-
disabled:
|
|
1274
|
+
disabled: r,
|
|
1275
1275
|
...i
|
|
1276
1276
|
}
|
|
1277
1277
|
),
|
|
1278
1278
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: t && /* @__PURE__ */ e.jsx(
|
|
1279
1279
|
Te,
|
|
1280
1280
|
{
|
|
1281
|
-
size:
|
|
1281
|
+
size: d,
|
|
1282
1282
|
strokeWidth: 2.5,
|
|
1283
1283
|
className: "ds-checkbox__icon"
|
|
1284
1284
|
}
|
|
@@ -1290,56 +1290,56 @@ function $s({
|
|
|
1290
1290
|
checked: t = !1,
|
|
1291
1291
|
onChange: s,
|
|
1292
1292
|
size: n = "m",
|
|
1293
|
-
disabled:
|
|
1293
|
+
disabled: r = !1,
|
|
1294
1294
|
label: o,
|
|
1295
|
-
name:
|
|
1295
|
+
name: a,
|
|
1296
1296
|
value: i,
|
|
1297
1297
|
id: l,
|
|
1298
|
-
...
|
|
1298
|
+
...c
|
|
1299
1299
|
}) {
|
|
1300
|
-
const
|
|
1300
|
+
const d = l || `radio-${Y.useId()}`, m = [
|
|
1301
1301
|
"ds-radio",
|
|
1302
1302
|
`ds-radio--${n}`,
|
|
1303
|
-
|
|
1303
|
+
r && "ds-radio--disabled"
|
|
1304
1304
|
].filter(Boolean).join(" ");
|
|
1305
|
-
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor:
|
|
1305
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: d, children: [
|
|
1306
1306
|
/* @__PURE__ */ e.jsx(
|
|
1307
1307
|
"input",
|
|
1308
1308
|
{
|
|
1309
1309
|
type: "radio",
|
|
1310
|
-
id:
|
|
1310
|
+
id: d,
|
|
1311
1311
|
className: "ds-radio__input",
|
|
1312
1312
|
checked: t,
|
|
1313
1313
|
onChange: (p) => s == null ? void 0 : s(p.target.checked),
|
|
1314
|
-
disabled:
|
|
1315
|
-
name:
|
|
1314
|
+
disabled: r,
|
|
1315
|
+
name: a,
|
|
1316
1316
|
value: i,
|
|
1317
|
-
...
|
|
1317
|
+
...c
|
|
1318
1318
|
}
|
|
1319
1319
|
),
|
|
1320
1320
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1321
1321
|
o && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: o })
|
|
1322
1322
|
] });
|
|
1323
1323
|
}
|
|
1324
|
-
function $t({ width: t, height: s, shape: n = "rect", aspectRatio:
|
|
1324
|
+
function $t({ width: t, height: s, shape: n = "rect", aspectRatio: r, className: o = "", style: a = {}, ...i }) {
|
|
1325
1325
|
return /* @__PURE__ */ e.jsx(
|
|
1326
1326
|
"span",
|
|
1327
1327
|
{
|
|
1328
1328
|
className: ["ds-skeleton", `ds-skeleton--${n}`, o].filter(Boolean).join(" "),
|
|
1329
|
-
style: { width: t, height: s, aspectRatio:
|
|
1329
|
+
style: { width: t, height: s, aspectRatio: r, ...a },
|
|
1330
1330
|
"aria-hidden": "true",
|
|
1331
1331
|
...i
|
|
1332
1332
|
}
|
|
1333
1333
|
);
|
|
1334
1334
|
}
|
|
1335
|
-
function Tt({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className:
|
|
1335
|
+
function Tt({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "", style: o = {}, ...a }) {
|
|
1336
1336
|
return /* @__PURE__ */ e.jsx(
|
|
1337
1337
|
"span",
|
|
1338
1338
|
{
|
|
1339
|
-
className: ["ds-skeleton-text",
|
|
1339
|
+
className: ["ds-skeleton-text", r].filter(Boolean).join(" "),
|
|
1340
1340
|
style: { gap: n, ...o },
|
|
1341
1341
|
"aria-hidden": "true",
|
|
1342
|
-
...
|
|
1342
|
+
...a,
|
|
1343
1343
|
children: Array.from({ length: t }, (i, l) => /* @__PURE__ */ e.jsx(
|
|
1344
1344
|
"span",
|
|
1345
1345
|
{
|
|
@@ -1363,16 +1363,16 @@ function St(t) {
|
|
|
1363
1363
|
const s = t.trim().split(/\s+/);
|
|
1364
1364
|
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
|
|
1365
1365
|
}
|
|
1366
|
-
function Ts({ seed: t, icon: s, src: n, size:
|
|
1367
|
-
const l = Rt(t ?? ""), [
|
|
1366
|
+
function Ts({ seed: t, icon: s, src: n, size: r = 32, className: o = "", style: a = {}, ...i }) {
|
|
1367
|
+
const l = Rt(t ?? ""), [c, d] = I(!1), m = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: St(t) });
|
|
1368
1368
|
return /* @__PURE__ */ e.jsx(
|
|
1369
1369
|
"div",
|
|
1370
1370
|
{
|
|
1371
1371
|
className: ["ds-avatar", o].filter(Boolean).join(" "),
|
|
1372
|
-
style: { width:
|
|
1372
|
+
style: { width: r, height: r, "--ds-avatar-h": l, ...a },
|
|
1373
1373
|
"aria-hidden": "true",
|
|
1374
1374
|
...i,
|
|
1375
|
-
children: n && !
|
|
1375
|
+
children: n && !c ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => d(!0) }) : m
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
@@ -1380,20 +1380,20 @@ function Rs({
|
|
|
1380
1380
|
children: t,
|
|
1381
1381
|
size: s = "compact",
|
|
1382
1382
|
stickyTop: n,
|
|
1383
|
-
maxHeight:
|
|
1383
|
+
maxHeight: r,
|
|
1384
1384
|
className: o = "",
|
|
1385
|
-
style:
|
|
1385
|
+
style: a = {},
|
|
1386
1386
|
...i
|
|
1387
1387
|
}) {
|
|
1388
1388
|
const l = {
|
|
1389
|
-
...
|
|
1389
|
+
...r ? { maxHeight: r } : {},
|
|
1390
1390
|
...n !== void 0 ? { "--ds-table-sticky-top": typeof n == "number" ? `${n}px` : n } : {},
|
|
1391
|
-
...
|
|
1391
|
+
...a
|
|
1392
1392
|
};
|
|
1393
1393
|
return /* @__PURE__ */ e.jsx(
|
|
1394
1394
|
"div",
|
|
1395
1395
|
{
|
|
1396
|
-
className: ["ds-table-wrap", "ds-scrollable",
|
|
1396
|
+
className: ["ds-table-wrap", "ds-scrollable", r ? "ds-table-wrap--scroll" : ""].filter(Boolean).join(" "),
|
|
1397
1397
|
style: l,
|
|
1398
1398
|
children: /* @__PURE__ */ e.jsx(
|
|
1399
1399
|
"table",
|
|
@@ -1412,7 +1412,7 @@ function Ss({ children: t, ...s }) {
|
|
|
1412
1412
|
function As({ children: t, ...s }) {
|
|
1413
1413
|
return /* @__PURE__ */ e.jsx("tbody", { ...s, children: t });
|
|
1414
1414
|
}
|
|
1415
|
-
function Is({ children: t, interactive: s, selected: n, subheader:
|
|
1415
|
+
function Is({ children: t, interactive: s, selected: n, subheader: r, exiting: o, updated: a, className: i = "", onClick: l, ...c }) {
|
|
1416
1416
|
return /* @__PURE__ */ e.jsx(
|
|
1417
1417
|
"tr",
|
|
1418
1418
|
{
|
|
@@ -1420,13 +1420,13 @@ function Is({ children: t, interactive: s, selected: n, subheader: a, exiting: o
|
|
|
1420
1420
|
"ds-table-row",
|
|
1421
1421
|
s || l ? "ds-table-row--interactive" : "",
|
|
1422
1422
|
n ? "ds-table-row--selected" : "",
|
|
1423
|
-
|
|
1423
|
+
r ? "ds-table-row--subheader" : "",
|
|
1424
1424
|
o ? "ds-table-row--exiting" : "",
|
|
1425
|
-
|
|
1425
|
+
a ? "ds-table-row--updated" : "",
|
|
1426
1426
|
i
|
|
1427
1427
|
].filter(Boolean).join(" "),
|
|
1428
1428
|
onClick: l,
|
|
1429
|
-
...
|
|
1429
|
+
...c,
|
|
1430
1430
|
children: t
|
|
1431
1431
|
}
|
|
1432
1432
|
);
|
|
@@ -1434,29 +1434,29 @@ function Is({ children: t, interactive: s, selected: n, subheader: a, exiting: o
|
|
|
1434
1434
|
function Bs({ children: t, colSpan: s = 999, ...n }) {
|
|
1435
1435
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: s, children: t }) });
|
|
1436
1436
|
}
|
|
1437
|
-
function Ds({ children: t, align: s = "left", sortDir: n, onSort:
|
|
1438
|
-
const
|
|
1437
|
+
function Ds({ children: t, align: s = "left", sortDir: n, onSort: r, width: o, className: a = "", style: i = {}, ...l }) {
|
|
1438
|
+
const c = !!r || n !== void 0, d = n === "asc" ? nt : n === "desc" ? ve : rt;
|
|
1439
1439
|
return /* @__PURE__ */ e.jsx(
|
|
1440
1440
|
"th",
|
|
1441
1441
|
{
|
|
1442
1442
|
className: [
|
|
1443
1443
|
"ds-th",
|
|
1444
|
-
|
|
1444
|
+
c ? "ds-th--sortable" : "",
|
|
1445
1445
|
n ? "ds-th--sorted" : "",
|
|
1446
1446
|
s !== "left" ? `ds-table-cell--${s}` : "",
|
|
1447
|
-
|
|
1447
|
+
a
|
|
1448
1448
|
].filter(Boolean).join(" "),
|
|
1449
|
-
onClick:
|
|
1449
|
+
onClick: r,
|
|
1450
1450
|
style: { width: o, ...i },
|
|
1451
1451
|
...l,
|
|
1452
|
-
children:
|
|
1452
|
+
children: c ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1453
1453
|
t,
|
|
1454
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(
|
|
1454
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
|
|
1455
1455
|
] }) : t
|
|
1456
1456
|
}
|
|
1457
1457
|
);
|
|
1458
1458
|
}
|
|
1459
|
-
function Ls({ children: t, align: s = "left", secondary: n, muted:
|
|
1459
|
+
function Ls({ children: t, align: s = "left", secondary: n, muted: r, truncate: o, nowrap: a, className: i = "", ...l }) {
|
|
1460
1460
|
return /* @__PURE__ */ e.jsx(
|
|
1461
1461
|
"td",
|
|
1462
1462
|
{
|
|
@@ -1464,9 +1464,9 @@ function Ls({ children: t, align: s = "left", secondary: n, muted: a, truncate:
|
|
|
1464
1464
|
"ds-td",
|
|
1465
1465
|
s !== "left" ? `ds-table-cell--${s}` : "",
|
|
1466
1466
|
n ? "ds-table-cell--secondary" : "",
|
|
1467
|
-
|
|
1467
|
+
r ? "ds-table-cell--muted" : "",
|
|
1468
1468
|
o ? "ds-table-cell--truncate" : "",
|
|
1469
|
-
|
|
1469
|
+
a ? "ds-table-cell--nowrap" : "",
|
|
1470
1470
|
i
|
|
1471
1471
|
].filter(Boolean).join(" "),
|
|
1472
1472
|
...l,
|
|
@@ -1478,21 +1478,21 @@ function Ps({
|
|
|
1478
1478
|
icon: t,
|
|
1479
1479
|
title: s,
|
|
1480
1480
|
description: n,
|
|
1481
|
-
action:
|
|
1481
|
+
action: r,
|
|
1482
1482
|
size: o = "m",
|
|
1483
|
-
className:
|
|
1483
|
+
className: a = "",
|
|
1484
1484
|
...i
|
|
1485
1485
|
}) {
|
|
1486
1486
|
return /* @__PURE__ */ e.jsxs(
|
|
1487
1487
|
"div",
|
|
1488
1488
|
{
|
|
1489
|
-
className: ["ds-empty-state", `ds-empty-state--${o}`,
|
|
1489
|
+
className: ["ds-empty-state", `ds-empty-state--${o}`, a].filter(Boolean).join(" "),
|
|
1490
1490
|
...i,
|
|
1491
1491
|
children: [
|
|
1492
1492
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: t }),
|
|
1493
1493
|
/* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__title", children: s }),
|
|
1494
1494
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__description", children: n }),
|
|
1495
|
-
|
|
1495
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__action", children: r })
|
|
1496
1496
|
]
|
|
1497
1497
|
}
|
|
1498
1498
|
);
|
|
@@ -1501,24 +1501,24 @@ function Ms({
|
|
|
1501
1501
|
label: t,
|
|
1502
1502
|
hint: s,
|
|
1503
1503
|
error: n,
|
|
1504
|
-
required:
|
|
1504
|
+
required: r = !1,
|
|
1505
1505
|
disabled: o = !1,
|
|
1506
|
-
htmlFor:
|
|
1506
|
+
htmlFor: a,
|
|
1507
1507
|
children: i,
|
|
1508
1508
|
className: l = "",
|
|
1509
|
-
style:
|
|
1510
|
-
...
|
|
1509
|
+
style: c,
|
|
1510
|
+
...d
|
|
1511
1511
|
}) {
|
|
1512
|
-
const m = Y.useId(), p =
|
|
1512
|
+
const m = Y.useId(), p = a ?? m, h = `${p}-hint`, u = `${p}-error`;
|
|
1513
1513
|
return /* @__PURE__ */ e.jsxs(
|
|
1514
1514
|
"div",
|
|
1515
1515
|
{
|
|
1516
1516
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1517
1517
|
"data-state": n ? "error" : void 0,
|
|
1518
|
-
"data-required":
|
|
1518
|
+
"data-required": r ? "" : void 0,
|
|
1519
1519
|
"data-disabled": o ? "" : void 0,
|
|
1520
|
-
style:
|
|
1521
|
-
...
|
|
1520
|
+
style: c,
|
|
1521
|
+
...d,
|
|
1522
1522
|
children: [
|
|
1523
1523
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: t }),
|
|
1524
1524
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
|
|
@@ -1528,23 +1528,23 @@ function Ms({
|
|
|
1528
1528
|
}
|
|
1529
1529
|
);
|
|
1530
1530
|
}
|
|
1531
|
-
function zs({ label: t, value: s, delta: n, size:
|
|
1532
|
-
const
|
|
1531
|
+
function zs({ label: t, value: s, delta: n, size: r = "m", inline: o = !1, className: a = "", style: i, ...l }) {
|
|
1532
|
+
const c = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1533
1533
|
return /* @__PURE__ */ e.jsxs(
|
|
1534
1534
|
"div",
|
|
1535
1535
|
{
|
|
1536
1536
|
className: [
|
|
1537
1537
|
"ds-stat",
|
|
1538
|
-
`ds-stat--${
|
|
1538
|
+
`ds-stat--${r}`,
|
|
1539
1539
|
o && "ds-stat--inline",
|
|
1540
|
-
|
|
1540
|
+
a
|
|
1541
1541
|
].filter(Boolean).join(" "),
|
|
1542
1542
|
style: i,
|
|
1543
1543
|
...l,
|
|
1544
1544
|
children: [
|
|
1545
1545
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: t }),
|
|
1546
1546
|
s != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: s }),
|
|
1547
|
-
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${
|
|
1547
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${c}`, children: n })
|
|
1548
1548
|
]
|
|
1549
1549
|
}
|
|
1550
1550
|
);
|
|
@@ -1553,22 +1553,22 @@ function Cs({
|
|
|
1553
1553
|
children: t,
|
|
1554
1554
|
separator: s = "/",
|
|
1555
1555
|
"aria-label": n = "Breadcrumb",
|
|
1556
|
-
className:
|
|
1556
|
+
className: r = "",
|
|
1557
1557
|
style: o,
|
|
1558
|
-
...
|
|
1558
|
+
...a
|
|
1559
1559
|
}) {
|
|
1560
1560
|
const i = Y.Children.toArray(t).filter(Boolean);
|
|
1561
1561
|
return /* @__PURE__ */ e.jsx(
|
|
1562
1562
|
"nav",
|
|
1563
1563
|
{
|
|
1564
|
-
className: `ds-breadcrumb${
|
|
1564
|
+
className: `ds-breadcrumb${r ? ` ${r}` : ""}`,
|
|
1565
1565
|
"aria-label": n,
|
|
1566
1566
|
style: o,
|
|
1567
|
-
...
|
|
1568
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l,
|
|
1567
|
+
...a,
|
|
1568
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l, c) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1569
1569
|
l,
|
|
1570
|
-
|
|
1571
|
-
] },
|
|
1570
|
+
c < i.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: s })
|
|
1571
|
+
] }, c)) })
|
|
1572
1572
|
}
|
|
1573
1573
|
);
|
|
1574
1574
|
}
|
|
@@ -1576,17 +1576,17 @@ function Os({
|
|
|
1576
1576
|
page: t,
|
|
1577
1577
|
total: s,
|
|
1578
1578
|
onChange: n,
|
|
1579
|
-
siblings:
|
|
1579
|
+
siblings: r = 1,
|
|
1580
1580
|
"aria-label": o = "Pagination",
|
|
1581
|
-
className:
|
|
1581
|
+
className: a = "",
|
|
1582
1582
|
style: i,
|
|
1583
1583
|
...l
|
|
1584
1584
|
}) {
|
|
1585
|
-
const
|
|
1585
|
+
const c = At(t, s, r);
|
|
1586
1586
|
return /* @__PURE__ */ e.jsxs(
|
|
1587
1587
|
"nav",
|
|
1588
1588
|
{
|
|
1589
|
-
className: `ds-pagination${
|
|
1589
|
+
className: `ds-pagination${a ? ` ${a}` : ""}`,
|
|
1590
1590
|
"aria-label": o,
|
|
1591
1591
|
style: i,
|
|
1592
1592
|
...l,
|
|
@@ -1601,17 +1601,17 @@ function Os({
|
|
|
1601
1601
|
children: /* @__PURE__ */ e.jsx(at, { size: 16 })
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
|
-
|
|
1605
|
-
(
|
|
1604
|
+
c.map(
|
|
1605
|
+
(d, m) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${m}`) : /* @__PURE__ */ e.jsx(
|
|
1606
1606
|
"button",
|
|
1607
1607
|
{
|
|
1608
|
-
className: `ds-pagination-page${
|
|
1609
|
-
onClick: () =>
|
|
1610
|
-
"aria-current":
|
|
1611
|
-
"aria-label": `Page ${
|
|
1612
|
-
children:
|
|
1608
|
+
className: `ds-pagination-page${d === t ? " ds-pagination-page--current" : ""}`,
|
|
1609
|
+
onClick: () => d !== t && (n == null ? void 0 : n(d)),
|
|
1610
|
+
"aria-current": d === t ? "page" : void 0,
|
|
1611
|
+
"aria-label": `Page ${d}`,
|
|
1612
|
+
children: d
|
|
1613
1613
|
},
|
|
1614
|
-
|
|
1614
|
+
d
|
|
1615
1615
|
)
|
|
1616
1616
|
),
|
|
1617
1617
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1630,31 +1630,31 @@ function Os({
|
|
|
1630
1630
|
}
|
|
1631
1631
|
function At(t, s, n) {
|
|
1632
1632
|
if (s <= 7) return Array.from({ length: s }, (i, l) => l + 1);
|
|
1633
|
-
const
|
|
1634
|
-
|
|
1635
|
-
for (let i =
|
|
1636
|
-
return o < s - 1 &&
|
|
1633
|
+
const r = Math.max(2, t - n), o = Math.min(s - 1, t + n), a = [1];
|
|
1634
|
+
r > 2 && a.push("…");
|
|
1635
|
+
for (let i = r; i <= o; i++) a.push(i);
|
|
1636
|
+
return o < s - 1 && a.push("…"), a.push(s), a;
|
|
1637
1637
|
}
|
|
1638
1638
|
const It = 200;
|
|
1639
1639
|
function Fs({
|
|
1640
1640
|
children: t,
|
|
1641
1641
|
title: s,
|
|
1642
1642
|
onClose: n,
|
|
1643
|
-
side:
|
|
1643
|
+
side: r = "right",
|
|
1644
1644
|
...o
|
|
1645
1645
|
}) {
|
|
1646
|
-
const
|
|
1647
|
-
!n || l || (
|
|
1648
|
-
|
|
1646
|
+
const a = T(null), i = Y.useId(), [l, c] = I(!1), d = () => {
|
|
1647
|
+
!n || l || (c(!0), setTimeout(() => {
|
|
1648
|
+
c(!1), n();
|
|
1649
1649
|
}, It));
|
|
1650
1650
|
};
|
|
1651
1651
|
D(() => {
|
|
1652
1652
|
const u = (v) => {
|
|
1653
|
-
v.key === "Escape" &&
|
|
1653
|
+
v.key === "Escape" && d();
|
|
1654
1654
|
}, x = (v) => {
|
|
1655
1655
|
var E, g, b;
|
|
1656
1656
|
const j = ((g = (E = v.composedPath) == null ? void 0 : E.call(v)) == null ? void 0 : g[0]) ?? v.target;
|
|
1657
|
-
|
|
1657
|
+
a.current && !a.current.contains(j) && !((b = j.closest) != null && b.call(j, "[data-ds-portal]")) && d();
|
|
1658
1658
|
};
|
|
1659
1659
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", x), () => {
|
|
1660
1660
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", x);
|
|
@@ -1670,15 +1670,15 @@ function Fs({
|
|
|
1670
1670
|
"aside",
|
|
1671
1671
|
{
|
|
1672
1672
|
className: ["ds-drawer", l && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1673
|
-
"data-side":
|
|
1674
|
-
ref:
|
|
1673
|
+
"data-side": r,
|
|
1674
|
+
ref: a,
|
|
1675
1675
|
role: "dialog",
|
|
1676
1676
|
"aria-modal": "true",
|
|
1677
1677
|
"aria-labelledby": s ? i : void 0,
|
|
1678
1678
|
children: [
|
|
1679
1679
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1680
1680
|
s && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-drawer-title", children: s }),
|
|
1681
|
-
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick:
|
|
1681
|
+
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ee, { size: P[2], strokeWidth: 1.5 }) })
|
|
1682
1682
|
] }),
|
|
1683
1683
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children: h }),
|
|
1684
1684
|
p
|
|
@@ -1696,21 +1696,21 @@ function Ws({
|
|
|
1696
1696
|
children: t,
|
|
1697
1697
|
title: s,
|
|
1698
1698
|
onClose: n,
|
|
1699
|
-
subHeader:
|
|
1699
|
+
subHeader: r,
|
|
1700
1700
|
...o
|
|
1701
1701
|
}) {
|
|
1702
|
-
const
|
|
1703
|
-
!n || l || (
|
|
1704
|
-
|
|
1702
|
+
const a = T(null), i = Y.useId(), [l, c] = I(!1), d = () => {
|
|
1703
|
+
!n || l || (c(!0), setTimeout(() => {
|
|
1704
|
+
c(!1), n();
|
|
1705
1705
|
}, Bt));
|
|
1706
1706
|
};
|
|
1707
1707
|
D(() => {
|
|
1708
1708
|
const u = (v) => {
|
|
1709
|
-
v.key === "Escape" &&
|
|
1709
|
+
v.key === "Escape" && d();
|
|
1710
1710
|
}, x = (v) => {
|
|
1711
1711
|
var E, g, b;
|
|
1712
1712
|
const j = ((g = (E = v.composedPath) == null ? void 0 : E.call(v)) == null ? void 0 : g[0]) ?? v.target;
|
|
1713
|
-
|
|
1713
|
+
a.current && !a.current.contains(j) && !((b = j.closest) != null && b.call(j, "[data-ds-portal]")) && d();
|
|
1714
1714
|
};
|
|
1715
1715
|
return document.addEventListener("keydown", u), document.addEventListener("mousedown", x), () => {
|
|
1716
1716
|
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", x);
|
|
@@ -1725,7 +1725,7 @@ function Ws({
|
|
|
1725
1725
|
children: /* @__PURE__ */ e.jsxs(
|
|
1726
1726
|
"div",
|
|
1727
1727
|
{
|
|
1728
|
-
ref:
|
|
1728
|
+
ref: a,
|
|
1729
1729
|
className: ["ds-side-page", l && "ds-side-page--closing"].filter(Boolean).join(" "),
|
|
1730
1730
|
role: "dialog",
|
|
1731
1731
|
"aria-modal": "true",
|
|
@@ -1738,13 +1738,13 @@ function Ws({
|
|
|
1738
1738
|
variant: "ghost",
|
|
1739
1739
|
size: "small",
|
|
1740
1740
|
icon: /* @__PURE__ */ e.jsx(ee, { size: P[2], strokeWidth: 1.5 }),
|
|
1741
|
-
onClick:
|
|
1741
|
+
onClick: d,
|
|
1742
1742
|
"aria-label": "Close"
|
|
1743
1743
|
}
|
|
1744
1744
|
),
|
|
1745
|
-
(s ||
|
|
1745
|
+
(s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-side-page__header", children: [
|
|
1746
1746
|
s && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-side-page__title", children: s }),
|
|
1747
|
-
|
|
1747
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
|
|
1748
1748
|
] }),
|
|
1749
1749
|
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: h }),
|
|
1750
1750
|
p
|
|
@@ -1762,46 +1762,58 @@ function Us({
|
|
|
1762
1762
|
children: t,
|
|
1763
1763
|
collapsed: s = !1,
|
|
1764
1764
|
side: n = "left",
|
|
1765
|
-
|
|
1766
|
-
|
|
1765
|
+
onExpand: r,
|
|
1766
|
+
className: o = "",
|
|
1767
|
+
...a
|
|
1767
1768
|
}) {
|
|
1768
|
-
const
|
|
1769
|
+
const i = [
|
|
1769
1770
|
"ds-nav-rail",
|
|
1770
1771
|
s && "ds-nav-rail--collapsed",
|
|
1771
1772
|
`ds-nav-rail--${n}`,
|
|
1772
|
-
|
|
1773
|
-
].filter(Boolean).join(" ")
|
|
1774
|
-
|
|
1773
|
+
o
|
|
1774
|
+
].filter(Boolean).join(" "), l = je((c) => {
|
|
1775
|
+
!s || !r || c.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]') || r();
|
|
1776
|
+
}, [s, r]);
|
|
1777
|
+
return /* @__PURE__ */ e.jsx(_e.Provider, { value: { collapsed: s, side: n }, children: /* @__PURE__ */ e.jsx(
|
|
1778
|
+
"nav",
|
|
1779
|
+
{
|
|
1780
|
+
className: i,
|
|
1781
|
+
onClick: l,
|
|
1782
|
+
"data-expandable": s && r ? "" : void 0,
|
|
1783
|
+
...a,
|
|
1784
|
+
children: t
|
|
1785
|
+
}
|
|
1786
|
+
) });
|
|
1775
1787
|
}
|
|
1776
1788
|
function Vs({
|
|
1777
1789
|
icon: t,
|
|
1778
1790
|
label: s,
|
|
1779
1791
|
selected: n = !1,
|
|
1780
|
-
disabled:
|
|
1792
|
+
disabled: r = !1,
|
|
1781
1793
|
href: o,
|
|
1782
|
-
onClick:
|
|
1794
|
+
onClick: a,
|
|
1783
1795
|
count: i,
|
|
1784
1796
|
updated: l = !1,
|
|
1785
|
-
open:
|
|
1786
|
-
onboarding:
|
|
1797
|
+
open: c = !1,
|
|
1798
|
+
onboarding: d = !1,
|
|
1787
1799
|
className: m = "",
|
|
1788
1800
|
...p
|
|
1789
1801
|
}) {
|
|
1790
|
-
const { collapsed: h, side: u } =
|
|
1802
|
+
const { collapsed: h, side: u } = Ne(_e), j = {
|
|
1791
1803
|
className: [
|
|
1792
1804
|
"ds-nav-rail__item",
|
|
1793
1805
|
m
|
|
1794
1806
|
].filter(Boolean).join(" "),
|
|
1795
|
-
onClick:
|
|
1807
|
+
onClick: r ? void 0 : a,
|
|
1796
1808
|
"aria-current": n ? "page" : void 0,
|
|
1797
|
-
"aria-disabled":
|
|
1809
|
+
"aria-disabled": r ? "true" : void 0,
|
|
1798
1810
|
"aria-label": h ? s : void 0,
|
|
1799
|
-
tabIndex:
|
|
1811
|
+
tabIndex: r ? -1 : void 0,
|
|
1800
1812
|
...{
|
|
1801
1813
|
"data-selected": n || void 0,
|
|
1802
|
-
"data-disabled":
|
|
1803
|
-
"data-open":
|
|
1804
|
-
"data-onboarding":
|
|
1814
|
+
"data-disabled": r || void 0,
|
|
1815
|
+
"data-open": c || void 0,
|
|
1816
|
+
"data-onboarding": d || void 0
|
|
1805
1817
|
},
|
|
1806
1818
|
...p
|
|
1807
1819
|
}, E = i != null, g = u === "left" ? "right" : "left", b = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -1810,7 +1822,7 @@ function Vs({
|
|
|
1810
1822
|
!h && l && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
|
|
1811
1823
|
!h && E && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
|
|
1812
1824
|
h && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
1813
|
-
] }), S = o ? /* @__PURE__ */ e.jsx("a", { href:
|
|
1825
|
+
] }), S = o ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : o, ...j, children: b }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...j, children: b });
|
|
1814
1826
|
return h ? /* @__PURE__ */ e.jsx(De, { content: s, position: g, children: S }) : S;
|
|
1815
1827
|
}
|
|
1816
1828
|
function Ys({ children: t, className: s = "", ...n }) {
|
|
@@ -1825,15 +1837,15 @@ function Hs({ children: t, className: s = "", ...n }) {
|
|
|
1825
1837
|
function Ks({ className: t = "", ...s }) {
|
|
1826
1838
|
return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
|
|
1827
1839
|
}
|
|
1828
|
-
function Gs({ children: t, label: s = "Recents", defaultOpen: n = !0, className:
|
|
1829
|
-
const { collapsed:
|
|
1830
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents",
|
|
1831
|
-
!
|
|
1840
|
+
function Gs({ children: t, label: s = "Recents", defaultOpen: n = !0, className: r = "", ...o }) {
|
|
1841
|
+
const { collapsed: a } = Ne(_e), [i, l] = I(n);
|
|
1842
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...o, children: [
|
|
1843
|
+
!a && /* @__PURE__ */ e.jsxs(
|
|
1832
1844
|
"button",
|
|
1833
1845
|
{
|
|
1834
1846
|
type: "button",
|
|
1835
1847
|
className: ["ds-nav-rail__recents-toggle", !i && "ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),
|
|
1836
|
-
onClick: () => l((
|
|
1848
|
+
onClick: () => l((c) => !c),
|
|
1837
1849
|
"aria-expanded": i,
|
|
1838
1850
|
children: [
|
|
1839
1851
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__recents-label", children: s }),
|
|
@@ -1841,57 +1853,57 @@ function Gs({ children: t, label: s = "Recents", defaultOpen: n = !0, className:
|
|
|
1841
1853
|
]
|
|
1842
1854
|
}
|
|
1843
1855
|
),
|
|
1844
|
-
(i ||
|
|
1856
|
+
(i || a) && /* @__PURE__ */ e.jsx("div", { className: "ds-nav-rail__recents-body", children: t })
|
|
1845
1857
|
] });
|
|
1846
1858
|
}
|
|
1847
1859
|
const Xs = Qe(function({
|
|
1848
1860
|
as: s = "button",
|
|
1849
1861
|
avatar: n,
|
|
1850
|
-
label:
|
|
1862
|
+
label: r,
|
|
1851
1863
|
className: o = "",
|
|
1852
|
-
...
|
|
1864
|
+
...a
|
|
1853
1865
|
}, i) {
|
|
1854
|
-
const { collapsed: l, side:
|
|
1866
|
+
const { collapsed: l, side: c } = Ne(_e), d = c === "left" ? "right" : "left", m = [
|
|
1855
1867
|
"ds-nav-rail__item",
|
|
1856
1868
|
"ds-nav-rail__agent",
|
|
1857
1869
|
o
|
|
1858
1870
|
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1859
1871
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: n }),
|
|
1860
|
-
!l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children:
|
|
1872
|
+
!l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: r })
|
|
1861
1873
|
] }), h = /* @__PURE__ */ e.jsx(
|
|
1862
1874
|
s,
|
|
1863
1875
|
{
|
|
1864
1876
|
ref: i,
|
|
1865
1877
|
className: m,
|
|
1866
|
-
"aria-label": l ?
|
|
1878
|
+
"aria-label": l ? r : void 0,
|
|
1867
1879
|
...s === "button" ? { type: "button" } : {},
|
|
1868
|
-
...
|
|
1880
|
+
...a,
|
|
1869
1881
|
children: p
|
|
1870
1882
|
}
|
|
1871
1883
|
);
|
|
1872
|
-
return l ? /* @__PURE__ */ e.jsx(De, { content:
|
|
1884
|
+
return l ? /* @__PURE__ */ e.jsx(De, { content: r, position: d, children: h }) : h;
|
|
1873
1885
|
});
|
|
1874
|
-
function Js({ avatar: t, label: s, selected: n = !1, disabled:
|
|
1875
|
-
const { collapsed:
|
|
1886
|
+
function Js({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: o, onClick: a, className: i = "", ...l }) {
|
|
1887
|
+
const { collapsed: c, side: d } = Ne(_e), h = {
|
|
1876
1888
|
className: [
|
|
1877
1889
|
"ds-nav-rail__item",
|
|
1878
1890
|
"ds-nav-rail__agent",
|
|
1879
1891
|
i
|
|
1880
1892
|
].filter(Boolean).join(" "),
|
|
1881
|
-
onClick:
|
|
1893
|
+
onClick: r ? void 0 : a,
|
|
1882
1894
|
"aria-current": n ? "page" : void 0,
|
|
1883
|
-
"aria-disabled":
|
|
1884
|
-
tabIndex:
|
|
1895
|
+
"aria-disabled": r ? "true" : void 0,
|
|
1896
|
+
tabIndex: r ? -1 : void 0,
|
|
1885
1897
|
...{
|
|
1886
1898
|
"data-selected": n || void 0,
|
|
1887
|
-
"data-disabled":
|
|
1899
|
+
"data-disabled": r || void 0
|
|
1888
1900
|
},
|
|
1889
1901
|
...l
|
|
1890
1902
|
}, u = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1891
1903
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1892
|
-
!
|
|
1893
|
-
] }), x =
|
|
1894
|
-
return
|
|
1904
|
+
!c && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
1905
|
+
] }), x = d === "left" ? "right" : "left", v = o ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : o, ...h, children: u }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...h, children: u });
|
|
1906
|
+
return c ? /* @__PURE__ */ e.jsx(De, { content: s, position: x, children: v }) : v;
|
|
1895
1907
|
}
|
|
1896
1908
|
const Dt = {
|
|
1897
1909
|
info: Ie,
|
|
@@ -1903,17 +1915,17 @@ function Zs({
|
|
|
1903
1915
|
children: t,
|
|
1904
1916
|
variant: s = "info",
|
|
1905
1917
|
action: n,
|
|
1906
|
-
onAction:
|
|
1918
|
+
onAction: r,
|
|
1907
1919
|
onDismiss: o,
|
|
1908
|
-
role:
|
|
1920
|
+
role: a,
|
|
1909
1921
|
...i
|
|
1910
1922
|
}) {
|
|
1911
|
-
const l = Dt[s],
|
|
1923
|
+
const l = Dt[s], c = a || (s === "error" ? "alert" : "status");
|
|
1912
1924
|
return /* @__PURE__ */ e.jsxs(
|
|
1913
1925
|
"div",
|
|
1914
1926
|
{
|
|
1915
1927
|
className: `ds-banner ds-banner--${s}`,
|
|
1916
|
-
role:
|
|
1928
|
+
role: c,
|
|
1917
1929
|
...i,
|
|
1918
1930
|
children: [
|
|
1919
1931
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: P[2], strokeWidth: 1.5 }) }),
|
|
@@ -1923,7 +1935,7 @@ function Zs({
|
|
|
1923
1935
|
{
|
|
1924
1936
|
type: "button",
|
|
1925
1937
|
className: "ds-banner-action",
|
|
1926
|
-
onClick:
|
|
1938
|
+
onClick: r,
|
|
1927
1939
|
children: n
|
|
1928
1940
|
}
|
|
1929
1941
|
),
|
|
@@ -1945,16 +1957,16 @@ function Qs({
|
|
|
1945
1957
|
trigger: t,
|
|
1946
1958
|
items: s = [],
|
|
1947
1959
|
open: n,
|
|
1948
|
-
onOpenChange:
|
|
1960
|
+
onOpenChange: r,
|
|
1949
1961
|
align: o = "left",
|
|
1950
|
-
fullWidth:
|
|
1962
|
+
fullWidth: a = !1,
|
|
1951
1963
|
className: i = "",
|
|
1952
1964
|
style: l,
|
|
1953
|
-
...
|
|
1965
|
+
...c
|
|
1954
1966
|
}) {
|
|
1955
|
-
const [
|
|
1967
|
+
const [d, m] = I(!1), [p, h] = I(!1), u = n !== void 0, x = u ? n : d, v = T(null), j = T(null), E = T(null), g = T(null), [b, S] = I({}), L = T(null), C = 150, U = () => {
|
|
1956
1968
|
if (u)
|
|
1957
|
-
|
|
1969
|
+
r == null || r(!1);
|
|
1958
1970
|
else {
|
|
1959
1971
|
if (p) return;
|
|
1960
1972
|
h(!0), L.current = setTimeout(() => {
|
|
@@ -1963,9 +1975,9 @@ function Qs({
|
|
|
1963
1975
|
}
|
|
1964
1976
|
}, K = () => {
|
|
1965
1977
|
const _ = !x;
|
|
1966
|
-
u ?
|
|
1978
|
+
u ? r == null || r(_) : _ ? (clearTimeout(L.current), h(!1), m(!0)) : U();
|
|
1967
1979
|
}, V = () => {
|
|
1968
|
-
x || (u ?
|
|
1980
|
+
x || (u ? r == null || r(!0) : (clearTimeout(L.current), h(!1), m(!0)));
|
|
1969
1981
|
};
|
|
1970
1982
|
D(() => () => clearTimeout(L.current), []), D(() => {
|
|
1971
1983
|
if (!x) return;
|
|
@@ -2088,9 +2100,9 @@ function Qs({
|
|
|
2088
2100
|
"div",
|
|
2089
2101
|
{
|
|
2090
2102
|
ref: v,
|
|
2091
|
-
className: ["ds-dropdown",
|
|
2103
|
+
className: ["ds-dropdown", a && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
|
|
2092
2104
|
style: l,
|
|
2093
|
-
...
|
|
2105
|
+
...c,
|
|
2094
2106
|
children: [
|
|
2095
2107
|
/* @__PURE__ */ e.jsx(
|
|
2096
2108
|
"div",
|
|
@@ -2111,18 +2123,18 @@ function en({
|
|
|
2111
2123
|
value: t = 0,
|
|
2112
2124
|
size: s = "m",
|
|
2113
2125
|
variant: n = "default",
|
|
2114
|
-
showValue:
|
|
2126
|
+
showValue: r = !1,
|
|
2115
2127
|
min: o = 2,
|
|
2116
|
-
animate:
|
|
2128
|
+
animate: a = !0
|
|
2117
2129
|
}) {
|
|
2118
|
-
const i = Math.min(100, Math.max(0, t)), l = Math.max(o, i),
|
|
2130
|
+
const i = Math.min(100, Math.max(0, t)), l = Math.max(o, i), c = n === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : n;
|
|
2119
2131
|
return /* @__PURE__ */ e.jsxs(
|
|
2120
2132
|
"div",
|
|
2121
2133
|
{
|
|
2122
2134
|
className: [
|
|
2123
2135
|
"ds-progress",
|
|
2124
2136
|
`ds-progress--${s}`,
|
|
2125
|
-
!
|
|
2137
|
+
!a && "ds-progress--instant"
|
|
2126
2138
|
].filter(Boolean).join(" "),
|
|
2127
2139
|
role: "progressbar",
|
|
2128
2140
|
"aria-valuenow": i,
|
|
@@ -2132,11 +2144,11 @@ function en({
|
|
|
2132
2144
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
2133
2145
|
"div",
|
|
2134
2146
|
{
|
|
2135
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
2147
|
+
className: `ds-progress__fill ds-progress__fill--${c}`,
|
|
2136
2148
|
style: { width: `${l}%` }
|
|
2137
2149
|
}
|
|
2138
2150
|
) }),
|
|
2139
|
-
|
|
2151
|
+
r && /* @__PURE__ */ e.jsxs("span", { className: "ds-progress__value", children: [
|
|
2140
2152
|
Math.round(i),
|
|
2141
2153
|
"%"
|
|
2142
2154
|
] })
|
|
@@ -2146,61 +2158,61 @@ function en({
|
|
|
2146
2158
|
}
|
|
2147
2159
|
const Lt = (t) => 1 - Math.pow(1 - t, 3), Pt = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2148
2160
|
function Mt(t, { duration: s = 600 } = {}) {
|
|
2149
|
-
const [n,
|
|
2161
|
+
const [n, r] = I(t), o = T(t), a = T(null);
|
|
2150
2162
|
return D(() => {
|
|
2151
2163
|
if (Pt()) {
|
|
2152
|
-
|
|
2164
|
+
r(t), o.current = t;
|
|
2153
2165
|
return;
|
|
2154
2166
|
}
|
|
2155
2167
|
const i = o.current, l = t - i;
|
|
2156
2168
|
if (l === 0) return;
|
|
2157
|
-
let
|
|
2158
|
-
const
|
|
2159
|
-
|
|
2160
|
-
const p = Math.min((m -
|
|
2161
|
-
|
|
2169
|
+
let c = null;
|
|
2170
|
+
const d = (m) => {
|
|
2171
|
+
c || (c = m);
|
|
2172
|
+
const p = Math.min((m - c) / s, 1);
|
|
2173
|
+
r(i + l * Lt(p)), p < 1 ? a.current = requestAnimationFrame(d) : o.current = t;
|
|
2162
2174
|
};
|
|
2163
|
-
return
|
|
2175
|
+
return a.current = requestAnimationFrame(d), () => cancelAnimationFrame(a.current);
|
|
2164
2176
|
}, [t, s]), n;
|
|
2165
2177
|
}
|
|
2166
2178
|
function tn({
|
|
2167
2179
|
value: t,
|
|
2168
2180
|
duration: s = 600,
|
|
2169
2181
|
decimals: n = 0,
|
|
2170
|
-
prefix:
|
|
2182
|
+
prefix: r = "",
|
|
2171
2183
|
suffix: o = ""
|
|
2172
2184
|
}) {
|
|
2173
2185
|
const i = Mt(t, { duration: s }).toFixed(n);
|
|
2174
|
-
return `${
|
|
2186
|
+
return `${r}${i}${o}`;
|
|
2175
2187
|
}
|
|
2176
2188
|
function zt({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2177
|
-
const
|
|
2189
|
+
const r = T(null), [o, a] = I(!1);
|
|
2178
2190
|
return D(() => {
|
|
2179
|
-
const i =
|
|
2191
|
+
const i = r.current;
|
|
2180
2192
|
if (!i) return;
|
|
2181
2193
|
const l = new IntersectionObserver(
|
|
2182
|
-
([
|
|
2183
|
-
|
|
2194
|
+
([c]) => {
|
|
2195
|
+
c.isIntersecting ? (a(!0), n && l.disconnect()) : n || a(!1);
|
|
2184
2196
|
},
|
|
2185
2197
|
{ threshold: t, rootMargin: s }
|
|
2186
2198
|
);
|
|
2187
2199
|
return l.observe(i), () => l.disconnect();
|
|
2188
|
-
}, [t, s, n]), { ref:
|
|
2200
|
+
}, [t, s, n]), { ref: r, inView: o };
|
|
2189
2201
|
}
|
|
2190
2202
|
function sn({
|
|
2191
2203
|
children: t,
|
|
2192
2204
|
as: s = "div",
|
|
2193
2205
|
once: n = !1,
|
|
2194
|
-
threshold:
|
|
2206
|
+
threshold: r = 0.1,
|
|
2195
2207
|
rootMargin: o = "0px",
|
|
2196
|
-
onEnter:
|
|
2208
|
+
onEnter: a,
|
|
2197
2209
|
onLeave: i,
|
|
2198
2210
|
...l
|
|
2199
2211
|
}) {
|
|
2200
|
-
const { ref:
|
|
2212
|
+
const { ref: c, inView: d } = zt({ threshold: r, rootMargin: o, once: n }), m = T(!1);
|
|
2201
2213
|
return D(() => {
|
|
2202
|
-
|
|
2203
|
-
}, [
|
|
2214
|
+
d && !m.current && (a == null || a()), !d && m.current && (i == null || i()), m.current = d;
|
|
2215
|
+
}, [d]), /* @__PURE__ */ e.jsx(s, { ref: c, ...l, children: typeof t == "function" ? t(d) : t });
|
|
2204
2216
|
}
|
|
2205
2217
|
const Ue = {
|
|
2206
2218
|
default: Ie,
|
|
@@ -2209,9 +2221,9 @@ const Ue = {
|
|
|
2209
2221
|
error: Re
|
|
2210
2222
|
};
|
|
2211
2223
|
let me = [];
|
|
2212
|
-
const
|
|
2224
|
+
const Ee = /* @__PURE__ */ new Set();
|
|
2213
2225
|
function Ge() {
|
|
2214
|
-
|
|
2226
|
+
Ee.forEach((t) => t([...me]));
|
|
2215
2227
|
}
|
|
2216
2228
|
function Ct(t) {
|
|
2217
2229
|
me = [...me, t], Ge();
|
|
@@ -2232,10 +2244,10 @@ function nn() {
|
|
|
2232
2244
|
return t.success = (s, n) => t(s, { ...n, type: "success" }), t.error = (s, n) => t(s, { ...n, type: "error" }), t.warning = (s, n) => t(s, { ...n, type: "warning" }), { toast: t };
|
|
2233
2245
|
}
|
|
2234
2246
|
function Ft({ data: t, onDismiss: s }) {
|
|
2235
|
-
const [n,
|
|
2236
|
-
D(() => (requestAnimationFrame(() =>
|
|
2237
|
-
function
|
|
2238
|
-
|
|
2247
|
+
const [n, r] = I(!1), o = T(null);
|
|
2248
|
+
D(() => (requestAnimationFrame(() => r(!0)), t.duration > 0 && (o.current = setTimeout(() => a(), t.duration)), () => clearTimeout(o.current)), []);
|
|
2249
|
+
function a() {
|
|
2250
|
+
r(!1), setTimeout(() => s(t.id), 250);
|
|
2239
2251
|
}
|
|
2240
2252
|
const i = Ue[t.type] ?? Ue.default;
|
|
2241
2253
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -2255,7 +2267,7 @@ function Ft({ data: t, onDismiss: s }) {
|
|
|
2255
2267
|
"button",
|
|
2256
2268
|
{
|
|
2257
2269
|
className: "ds-toast__close",
|
|
2258
|
-
onClick:
|
|
2270
|
+
onClick: a,
|
|
2259
2271
|
"aria-label": "Закрыть",
|
|
2260
2272
|
children: /* @__PURE__ */ e.jsx(ee, { size: P[3], strokeWidth: 1.5 })
|
|
2261
2273
|
}
|
|
@@ -2266,8 +2278,8 @@ function Ft({ data: t, onDismiss: s }) {
|
|
|
2266
2278
|
}
|
|
2267
2279
|
function rn({ position: t = "bottom-right" }) {
|
|
2268
2280
|
const [s, n] = I(() => [...me]);
|
|
2269
|
-
return D(() => (
|
|
2270
|
-
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((
|
|
2281
|
+
return D(() => (Ee.add(n), () => Ee.delete(n)), []), !s.length || typeof document > "u" ? null : pe.createPortal(
|
|
2282
|
+
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(Ft, { data: r, onDismiss: Ot }, r.id)) }),
|
|
2271
2283
|
document.body
|
|
2272
2284
|
);
|
|
2273
2285
|
}
|
|
@@ -2280,32 +2292,32 @@ function an({
|
|
|
2280
2292
|
label: t,
|
|
2281
2293
|
status: s = "idle",
|
|
2282
2294
|
icon: n,
|
|
2283
|
-
badge:
|
|
2295
|
+
badge: r,
|
|
2284
2296
|
defaultExpanded: o = !1,
|
|
2285
|
-
expanded:
|
|
2297
|
+
expanded: a,
|
|
2286
2298
|
onToggle: i,
|
|
2287
2299
|
children: l,
|
|
2288
|
-
className:
|
|
2289
|
-
...
|
|
2300
|
+
className: c = "",
|
|
2301
|
+
...d
|
|
2290
2302
|
}) {
|
|
2291
2303
|
const m = s === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2292
2304
|
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2293
2305
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: t }),
|
|
2294
2306
|
Wt[s],
|
|
2295
|
-
|
|
2307
|
+
r
|
|
2296
2308
|
] });
|
|
2297
2309
|
return l ? /* @__PURE__ */ e.jsx(
|
|
2298
2310
|
"div",
|
|
2299
2311
|
{
|
|
2300
|
-
className: ["ds-tool-card", m && "ds-tool-card--running",
|
|
2301
|
-
...
|
|
2312
|
+
className: ["ds-tool-card", m && "ds-tool-card--running", c].filter(Boolean).join(" "),
|
|
2313
|
+
...d,
|
|
2302
2314
|
children: /* @__PURE__ */ e.jsx(
|
|
2303
2315
|
Be,
|
|
2304
2316
|
{
|
|
2305
2317
|
title: p,
|
|
2306
2318
|
padding: "s",
|
|
2307
2319
|
defaultExpanded: o,
|
|
2308
|
-
expanded: m ? !1 :
|
|
2320
|
+
expanded: m ? !1 : a,
|
|
2309
2321
|
onToggle: m ? void 0 : i,
|
|
2310
2322
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2311
2323
|
}
|
|
@@ -2314,8 +2326,8 @@ function an({
|
|
|
2314
2326
|
) : /* @__PURE__ */ e.jsx(
|
|
2315
2327
|
"div",
|
|
2316
2328
|
{
|
|
2317
|
-
className: ["ds-tool-card", "ds-tool-card--bubble",
|
|
2318
|
-
...
|
|
2329
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", c].filter(Boolean).join(" "),
|
|
2330
|
+
...d,
|
|
2319
2331
|
children: p
|
|
2320
2332
|
}
|
|
2321
2333
|
);
|
|
@@ -2324,11 +2336,11 @@ function Ut({
|
|
|
2324
2336
|
text: t,
|
|
2325
2337
|
size: s = "xs",
|
|
2326
2338
|
timeout: n = 800,
|
|
2327
|
-
"aria-label":
|
|
2339
|
+
"aria-label": r = "Copy to clipboard",
|
|
2328
2340
|
...o
|
|
2329
2341
|
}) {
|
|
2330
|
-
const [
|
|
2331
|
-
|
|
2342
|
+
const [a, i] = I(!1), l = (c) => {
|
|
2343
|
+
c.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
|
|
2332
2344
|
i(!0), setTimeout(() => i(!1), n);
|
|
2333
2345
|
});
|
|
2334
2346
|
};
|
|
@@ -2337,22 +2349,22 @@ function Ut({
|
|
|
2337
2349
|
{
|
|
2338
2350
|
variant: "ghost",
|
|
2339
2351
|
size: s,
|
|
2340
|
-
state:
|
|
2352
|
+
state: a ? "success" : "idle",
|
|
2341
2353
|
icon: /* @__PURE__ */ e.jsx(it, { size: P[1], strokeWidth: 1.5 }),
|
|
2342
|
-
"aria-label":
|
|
2354
|
+
"aria-label": r,
|
|
2343
2355
|
onClick: l,
|
|
2344
2356
|
...o
|
|
2345
2357
|
}
|
|
2346
2358
|
);
|
|
2347
2359
|
}
|
|
2348
2360
|
function on({ content: t, streaming: s = !1, ...n }) {
|
|
2349
|
-
const [
|
|
2361
|
+
const [r, o] = I(s);
|
|
2350
2362
|
return D(() => {
|
|
2351
2363
|
o(!!s);
|
|
2352
2364
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2353
2365
|
Be,
|
|
2354
2366
|
{
|
|
2355
|
-
expanded:
|
|
2367
|
+
expanded: r,
|
|
2356
2368
|
onToggle: o,
|
|
2357
2369
|
padding: "s",
|
|
2358
2370
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
@@ -2371,15 +2383,15 @@ function ln({
|
|
|
2371
2383
|
count: t,
|
|
2372
2384
|
current: s = 0,
|
|
2373
2385
|
done: n = [],
|
|
2374
|
-
onChange:
|
|
2386
|
+
onChange: r,
|
|
2375
2387
|
showCounter: o = !0,
|
|
2376
|
-
className:
|
|
2388
|
+
className: a = "",
|
|
2377
2389
|
"aria-label": i = "Steps",
|
|
2378
2390
|
...l
|
|
2379
2391
|
}) {
|
|
2380
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2381
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (
|
|
2382
|
-
const m =
|
|
2392
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", a].filter(Boolean).join(" "), ...l, children: [
|
|
2393
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (c, d) => {
|
|
2394
|
+
const m = d === s, p = n.includes(d) && !m, h = r && (d <= s || n.includes(d)), u = [
|
|
2383
2395
|
"ds-step-indicator__dot",
|
|
2384
2396
|
m && "ds-step-indicator__dot--active",
|
|
2385
2397
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2391,12 +2403,12 @@ function ln({
|
|
|
2391
2403
|
className: u,
|
|
2392
2404
|
role: "tab",
|
|
2393
2405
|
"aria-selected": m,
|
|
2394
|
-
"aria-label": `Step ${
|
|
2395
|
-
disabled: !h ||
|
|
2396
|
-
onClick: () =>
|
|
2406
|
+
"aria-label": `Step ${d + 1}`,
|
|
2407
|
+
disabled: !h || d === s,
|
|
2408
|
+
onClick: () => r == null ? void 0 : r(d),
|
|
2397
2409
|
children: p ? /* @__PURE__ */ e.jsx(Te, { size: 8, strokeWidth: 3 }) : null
|
|
2398
2410
|
},
|
|
2399
|
-
|
|
2411
|
+
d
|
|
2400
2412
|
);
|
|
2401
2413
|
}) }),
|
|
2402
2414
|
o && /* @__PURE__ */ e.jsxs(Ke, { secondary: !0, className: "ds-step-indicator__counter", children: [
|
|
@@ -2410,14 +2422,14 @@ function cn({
|
|
|
2410
2422
|
content: t,
|
|
2411
2423
|
isStreaming: s = !1,
|
|
2412
2424
|
cursor: n = "line",
|
|
2413
|
-
onChunk:
|
|
2425
|
+
onChunk: r,
|
|
2414
2426
|
className: o = "",
|
|
2415
|
-
...
|
|
2427
|
+
...a
|
|
2416
2428
|
}) {
|
|
2417
2429
|
const i = T(t);
|
|
2418
2430
|
return D(() => {
|
|
2419
|
-
t !== i.current && (
|
|
2420
|
-
}, [t,
|
|
2431
|
+
t !== i.current && (r == null || r(t), i.current = t);
|
|
2432
|
+
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", o].filter(Boolean).join(" "), ...a, children: [
|
|
2421
2433
|
t,
|
|
2422
2434
|
s && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2423
2435
|
] });
|
|
@@ -2426,54 +2438,54 @@ function dn({
|
|
|
2426
2438
|
role: t = "assistant",
|
|
2427
2439
|
header: s,
|
|
2428
2440
|
footer: n,
|
|
2429
|
-
attachments:
|
|
2441
|
+
attachments: r,
|
|
2430
2442
|
isStreaming: o = !1,
|
|
2431
|
-
children:
|
|
2443
|
+
children: a,
|
|
2432
2444
|
className: i = "",
|
|
2433
2445
|
...l
|
|
2434
2446
|
}) {
|
|
2435
|
-
const
|
|
2447
|
+
const c = [
|
|
2436
2448
|
"ds-chat-message",
|
|
2437
2449
|
`ds-chat-message--${t}`,
|
|
2438
2450
|
o && "ds-chat-message--streaming",
|
|
2439
2451
|
i
|
|
2440
2452
|
].filter(Boolean).join(" ");
|
|
2441
|
-
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2442
|
-
|
|
2443
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2453
|
+
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className: c, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: a }) }) : t === "user" ? /* @__PURE__ */ e.jsxs("div", { className: c, ...l, children: [
|
|
2454
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: r }),
|
|
2455
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: a }),
|
|
2444
2456
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2445
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2457
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: c, ...l, children: [
|
|
2446
2458
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: s }),
|
|
2447
|
-
|
|
2448
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2459
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: r }),
|
|
2460
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: a }),
|
|
2449
2461
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2450
2462
|
] });
|
|
2451
2463
|
}
|
|
2452
2464
|
function un(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2453
|
-
const
|
|
2465
|
+
const r = T(!1), o = T(0);
|
|
2454
2466
|
D(() => {
|
|
2455
|
-
const
|
|
2456
|
-
if (!
|
|
2467
|
+
const a = s == null ? void 0 : s.current;
|
|
2468
|
+
if (!a) return;
|
|
2457
2469
|
const i = () => {
|
|
2458
|
-
const l =
|
|
2459
|
-
!l &&
|
|
2470
|
+
const l = a.scrollHeight - a.scrollTop - a.clientHeight < 64;
|
|
2471
|
+
!l && a.scrollTop < o.current && (r.current = !0), l && (r.current = !1), o.current = a.scrollTop;
|
|
2460
2472
|
};
|
|
2461
|
-
return
|
|
2473
|
+
return a.addEventListener("scroll", i, { passive: !0 }), () => a.removeEventListener("scroll", i);
|
|
2462
2474
|
}, [s]), D(() => {
|
|
2463
|
-
const
|
|
2464
|
-
|
|
2475
|
+
const a = s == null ? void 0 : s.current;
|
|
2476
|
+
a && (n && r.current || (a.scrollTop = a.scrollHeight));
|
|
2465
2477
|
}, t);
|
|
2466
2478
|
}
|
|
2467
2479
|
function Vt({
|
|
2468
2480
|
prompts: t,
|
|
2469
2481
|
enabled: s,
|
|
2470
2482
|
typingSpeed: n = 38,
|
|
2471
|
-
erasingSpeed:
|
|
2483
|
+
erasingSpeed: r = 18,
|
|
2472
2484
|
holdTime: o = 2200,
|
|
2473
|
-
betweenTime:
|
|
2485
|
+
betweenTime: a = 380,
|
|
2474
2486
|
manualPauseMs: i = 5e3
|
|
2475
2487
|
}) {
|
|
2476
|
-
const [l,
|
|
2488
|
+
const [l, c] = I(0), [d, m] = I(""), p = T("typing"), h = T(0), u = T(0), x = T(null), v = T(0);
|
|
2477
2489
|
D(() => {
|
|
2478
2490
|
u.current = l;
|
|
2479
2491
|
}, [l]), D(() => {
|
|
@@ -2488,31 +2500,31 @@ function Vt({
|
|
|
2488
2500
|
return;
|
|
2489
2501
|
}
|
|
2490
2502
|
const C = t[u.current % t.length] ?? "";
|
|
2491
|
-
p.current === "typing" ? (h.current += 1, m(C.slice(0, h.current)), h.current >= C.length ? (p.current = "holding", x.current = setTimeout(S, o)) : x.current = setTimeout(S, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(S,
|
|
2503
|
+
p.current === "typing" ? (h.current += 1, m(C.slice(0, h.current)), h.current >= C.length ? (p.current = "holding", x.current = setTimeout(S, o)) : x.current = setTimeout(S, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(S, r)) : (h.current = Math.max(0, h.current - 1), m(C.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % t.length, c(u.current), x.current = setTimeout(S, a)) : x.current = setTimeout(S, r));
|
|
2492
2504
|
};
|
|
2493
2505
|
return x.current = setTimeout(S, 260), () => {
|
|
2494
2506
|
x.current && clearTimeout(x.current);
|
|
2495
2507
|
};
|
|
2496
|
-
}, [s, t, n,
|
|
2508
|
+
}, [s, t, n, r, o, a]);
|
|
2497
2509
|
const j = (S) => {
|
|
2498
2510
|
if (t.length === 0) return;
|
|
2499
2511
|
const L = (S % t.length + t.length) % t.length, C = t[L];
|
|
2500
|
-
u.current = L, h.current = C.length, p.current = "holding", v.current = Date.now() + i,
|
|
2512
|
+
u.current = L, h.current = C.length, p.current = "holding", v.current = Date.now() + i, c(L), m(C);
|
|
2501
2513
|
}, E = () => j(u.current + 1), g = () => j(u.current - 1), b = t[l % t.length] ?? "";
|
|
2502
|
-
return { displayed:
|
|
2514
|
+
return { displayed: d, currentPrompt: b, index: l, next: E, prev: g };
|
|
2503
2515
|
}
|
|
2504
2516
|
let Yt = 0;
|
|
2505
2517
|
function fn({
|
|
2506
2518
|
value: t = "",
|
|
2507
2519
|
onChange: s,
|
|
2508
2520
|
onSubmit: n,
|
|
2509
|
-
onStop:
|
|
2521
|
+
onStop: r,
|
|
2510
2522
|
onKeyDown: o,
|
|
2511
|
-
loading:
|
|
2523
|
+
loading: a = !1,
|
|
2512
2524
|
disabled: i = !1,
|
|
2513
2525
|
placeholder: l = "Let's get things done...",
|
|
2514
|
-
animatedPlaceholders:
|
|
2515
|
-
attachments:
|
|
2526
|
+
animatedPlaceholders: c,
|
|
2527
|
+
attachments: d,
|
|
2516
2528
|
images: m,
|
|
2517
2529
|
onAttachFiles: p,
|
|
2518
2530
|
onAttachImages: h,
|
|
@@ -2548,12 +2560,12 @@ function fn({
|
|
|
2548
2560
|
}, [t]), D(() => {
|
|
2549
2561
|
const N = (B) => {
|
|
2550
2562
|
var J, Z, te;
|
|
2551
|
-
if (
|
|
2563
|
+
if (a || i) return;
|
|
2552
2564
|
const X = (J = B.target) == null ? void 0 : J.tagName;
|
|
2553
2565
|
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z = B.target) != null && Z.isContentEditable || B.ctrlKey || B.metaKey || B.altKey || B.key.length !== 1 && B.key !== "Backspace" && B.key !== "Delete" || (te = K.current) == null || te.focus();
|
|
2554
2566
|
};
|
|
2555
2567
|
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
2556
|
-
}, [
|
|
2568
|
+
}, [a, i]);
|
|
2557
2569
|
const $ = (N) => {
|
|
2558
2570
|
N.preventDefault(), V.current++, N.dataTransfer.types.includes("Files") && M(!0);
|
|
2559
2571
|
}, z = (N) => {
|
|
@@ -2578,10 +2590,10 @@ function fn({
|
|
|
2578
2590
|
if (X.length === 0) return;
|
|
2579
2591
|
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ce } = k(X);
|
|
2580
2592
|
Z.length && A(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), te.length && A(`Skipped unsupported file${te.length > 1 ? "s" : ""}: ${te.join(", ")}`), ce && A(`Max ${E} images per message`), J.length && (N.preventDefault(), h(J));
|
|
2581
|
-
}, Q = !
|
|
2582
|
-
prompts:
|
|
2593
|
+
}, Q = !a && !i && !!(c != null && c.length) && t.length === 0, ie = Vt({
|
|
2594
|
+
prompts: c ?? [],
|
|
2583
2595
|
enabled: Q
|
|
2584
|
-
}),
|
|
2596
|
+
}), we = (N) => {
|
|
2585
2597
|
if (Q) {
|
|
2586
2598
|
if (N.key === "ArrowDown" || N.key === "ArrowRight") {
|
|
2587
2599
|
N.preventDefault(), ie.next();
|
|
@@ -2597,7 +2609,7 @@ function fn({
|
|
|
2597
2609
|
}
|
|
2598
2610
|
}
|
|
2599
2611
|
o == null || o(N);
|
|
2600
|
-
}, Xe = (t.trim() || (m == null ? void 0 : m.length) > 0 || (
|
|
2612
|
+
}, Xe = (t.trim() || (m == null ? void 0 : m.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, Le = p || h;
|
|
2601
2613
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", L].filter(Boolean).join(" "), ...C, children: [
|
|
2602
2614
|
Le && /* @__PURE__ */ e.jsx(
|
|
2603
2615
|
"input",
|
|
@@ -2626,10 +2638,10 @@ function fn({
|
|
|
2626
2638
|
ref: K,
|
|
2627
2639
|
value: t,
|
|
2628
2640
|
onChange: (N) => s == null ? void 0 : s(N.target.value),
|
|
2629
|
-
onKeyDown:
|
|
2641
|
+
onKeyDown: we,
|
|
2630
2642
|
onPaste: q,
|
|
2631
2643
|
placeholder: Q ? "" : l,
|
|
2632
|
-
disabled:
|
|
2644
|
+
disabled: a || i,
|
|
2633
2645
|
rows: 1,
|
|
2634
2646
|
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2635
2647
|
}
|
|
@@ -2664,7 +2676,7 @@ function fn({
|
|
|
2664
2676
|
}
|
|
2665
2677
|
)
|
|
2666
2678
|
] }, N.id)) }),
|
|
2667
|
-
|
|
2679
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((N, B) => /* @__PURE__ */ e.jsx(de, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2668
2680
|
N.uploading ? /* @__PURE__ */ e.jsx(ct, { size: P[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Me, { size: P[1], strokeWidth: 1.5 }),
|
|
2669
2681
|
N.filename,
|
|
2670
2682
|
N.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
@@ -2694,13 +2706,13 @@ function fn({
|
|
|
2694
2706
|
b,
|
|
2695
2707
|
S,
|
|
2696
2708
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2697
|
-
|
|
2709
|
+
a ? /* @__PURE__ */ e.jsx(
|
|
2698
2710
|
ae,
|
|
2699
2711
|
{
|
|
2700
2712
|
variant: "primary",
|
|
2701
2713
|
size: "xs",
|
|
2702
2714
|
icon: /* @__PURE__ */ e.jsx(dt, { size: P[2], strokeWidth: 1.5 }),
|
|
2703
|
-
onClick:
|
|
2715
|
+
onClick: r,
|
|
2704
2716
|
"aria-label": "Stop"
|
|
2705
2717
|
}
|
|
2706
2718
|
) : /* @__PURE__ */ e.jsx(
|
|
@@ -2725,16 +2737,16 @@ function mn({
|
|
|
2725
2737
|
models: t = [],
|
|
2726
2738
|
value: s,
|
|
2727
2739
|
onChange: n,
|
|
2728
|
-
size:
|
|
2740
|
+
size: r = "xs",
|
|
2729
2741
|
minTier: o,
|
|
2730
|
-
showAutoOption:
|
|
2742
|
+
showAutoOption: a = !1,
|
|
2731
2743
|
groupByTier: i = !0,
|
|
2732
2744
|
className: l = "",
|
|
2733
|
-
...
|
|
2745
|
+
...c
|
|
2734
2746
|
}) {
|
|
2735
|
-
const [
|
|
2747
|
+
const [d, m] = I(!1), p = T(null), h = T(null), u = T(null), [x, v] = I({}), j = t.filter((w) => !o || w.name === "auto" ? !0 : (Ve[w.tier] ?? 1) >= (Ve[o] ?? 1)), E = j.find((w) => w.name === "auto"), g = j.filter((w) => w.name !== "auto"), b = t.find((w) => w.name === s), L = new Set(g.map((w) => w.tier).filter(Boolean)).size > 1;
|
|
2736
2748
|
D(() => {
|
|
2737
|
-
if (!
|
|
2749
|
+
if (!d) return;
|
|
2738
2750
|
const w = 320, M = () => {
|
|
2739
2751
|
var R;
|
|
2740
2752
|
const A = (R = h.current) == null ? void 0 : R.getBoundingClientRect();
|
|
@@ -2757,7 +2769,7 @@ function mn({
|
|
|
2757
2769
|
return document.addEventListener("mousedown", G), document.addEventListener("keydown", F), () => {
|
|
2758
2770
|
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M), document.removeEventListener("mousedown", G), document.removeEventListener("keydown", F);
|
|
2759
2771
|
};
|
|
2760
|
-
}, [
|
|
2772
|
+
}, [d]);
|
|
2761
2773
|
const C = (w) => {
|
|
2762
2774
|
n == null || n(w), m(!1);
|
|
2763
2775
|
}, U = (w) => /* @__PURE__ */ e.jsxs(
|
|
@@ -2782,8 +2794,8 @@ function mn({
|
|
|
2782
2794
|
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": w, children: w.charAt(0).toUpperCase() + w.slice(1) }, `lbl-${w}`),
|
|
2783
2795
|
...M.map(U)
|
|
2784
2796
|
] : [];
|
|
2785
|
-
}), V =
|
|
2786
|
-
|
|
2797
|
+
}), V = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: x, children: [
|
|
2798
|
+
a && E && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2787
2799
|
/* @__PURE__ */ e.jsxs(
|
|
2788
2800
|
"button",
|
|
2789
2801
|
{
|
|
@@ -2809,7 +2821,7 @@ function mn({
|
|
|
2809
2821
|
{
|
|
2810
2822
|
ref: p,
|
|
2811
2823
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2812
|
-
...
|
|
2824
|
+
...c,
|
|
2813
2825
|
children: [
|
|
2814
2826
|
/* @__PURE__ */ e.jsxs(
|
|
2815
2827
|
"button",
|
|
@@ -2819,7 +2831,7 @@ function mn({
|
|
|
2819
2831
|
className: "ds-model-picker__trigger",
|
|
2820
2832
|
onClick: () => m((w) => !w),
|
|
2821
2833
|
"aria-haspopup": "listbox",
|
|
2822
|
-
"aria-expanded":
|
|
2834
|
+
"aria-expanded": d,
|
|
2823
2835
|
children: [
|
|
2824
2836
|
b != null && b.icon ? /* @__PURE__ */ e.jsx("span", { children: b.icon }) : /* @__PURE__ */ e.jsx(ze, { size: 12, strokeWidth: 1.5 }),
|
|
2825
2837
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (b == null ? void 0 : b.displayName) || (b == null ? void 0 : b.name) || s }),
|
|
@@ -2834,9 +2846,9 @@ function mn({
|
|
|
2834
2846
|
}
|
|
2835
2847
|
const qt = ({ filename: t, pages: s }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
2836
2848
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: t }),
|
|
2837
|
-
s.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2849
|
+
s.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: $e(s) })
|
|
2838
2850
|
] });
|
|
2839
|
-
function
|
|
2851
|
+
function $e(t) {
|
|
2840
2852
|
return t != null && t.length ? "p. " + t.join(", ") : null;
|
|
2841
2853
|
}
|
|
2842
2854
|
function Ht(t) {
|
|
@@ -2849,12 +2861,12 @@ function pn({
|
|
|
2849
2861
|
sources: t = [],
|
|
2850
2862
|
layout: s = "list",
|
|
2851
2863
|
title: n = "Sources",
|
|
2852
|
-
maxVisible:
|
|
2864
|
+
maxVisible: r = 5,
|
|
2853
2865
|
onSourceClick: o
|
|
2854
2866
|
}) {
|
|
2855
|
-
const [
|
|
2867
|
+
const [a, i] = I(!1), l = Ht(t), c = l.length > r, d = a ? l : l.slice(0, r), m = t.some((h) => h.snippet), p = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2856
2868
|
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2857
|
-
|
|
2869
|
+
d.map((h) => {
|
|
2858
2870
|
const u = h.items.map((v) => v.page).filter(Boolean), x = !!o;
|
|
2859
2871
|
return /* @__PURE__ */ e.jsxs(
|
|
2860
2872
|
"div",
|
|
@@ -2864,20 +2876,20 @@ function pn({
|
|
|
2864
2876
|
children: [
|
|
2865
2877
|
/* @__PURE__ */ e.jsx(mt, { size: P[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2866
2878
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2867
|
-
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2879
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: $e(u) })
|
|
2868
2880
|
]
|
|
2869
2881
|
},
|
|
2870
2882
|
h.filename
|
|
2871
2883
|
);
|
|
2872
2884
|
}),
|
|
2873
|
-
|
|
2885
|
+
c && !a && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2874
2886
|
"+",
|
|
2875
|
-
l.length -
|
|
2887
|
+
l.length - r,
|
|
2876
2888
|
" more sources"
|
|
2877
2889
|
] })
|
|
2878
2890
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2879
2891
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2880
|
-
|
|
2892
|
+
d.map((h) => {
|
|
2881
2893
|
const u = h.items.map((v) => v.page).filter(Boolean), x = !!o;
|
|
2882
2894
|
return m ? /* @__PURE__ */ e.jsx(
|
|
2883
2895
|
Be,
|
|
@@ -2902,15 +2914,15 @@ function pn({
|
|
|
2902
2914
|
onClick: x ? () => o(h.items[0]) : void 0,
|
|
2903
2915
|
children: [
|
|
2904
2916
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2905
|
-
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2917
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: $e(u) })
|
|
2906
2918
|
]
|
|
2907
2919
|
},
|
|
2908
2920
|
h.filename
|
|
2909
2921
|
);
|
|
2910
2922
|
}),
|
|
2911
|
-
|
|
2923
|
+
c && !a && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2912
2924
|
"+",
|
|
2913
|
-
l.length -
|
|
2925
|
+
l.length - r,
|
|
2914
2926
|
" more sources"
|
|
2915
2927
|
] })
|
|
2916
2928
|
] });
|
|
@@ -2922,12 +2934,12 @@ function hn({
|
|
|
2922
2934
|
used: t,
|
|
2923
2935
|
limit: s,
|
|
2924
2936
|
size: n = "s",
|
|
2925
|
-
showCount:
|
|
2937
|
+
showCount: r = !0,
|
|
2926
2938
|
showPercent: o = !1,
|
|
2927
|
-
warningThreshold:
|
|
2939
|
+
warningThreshold: a = 0.8,
|
|
2928
2940
|
errorThreshold: i = 1
|
|
2929
2941
|
}) {
|
|
2930
|
-
const l = s > 0 ? t / s : 0,
|
|
2942
|
+
const l = s > 0 ? t / s : 0, c = Math.min(l * 100, 100), d = l >= i ? "error" : l >= a ? "warning" : "normal";
|
|
2931
2943
|
return /* @__PURE__ */ e.jsxs(
|
|
2932
2944
|
"div",
|
|
2933
2945
|
{
|
|
@@ -2939,12 +2951,12 @@ function hn({
|
|
|
2939
2951
|
/* @__PURE__ */ e.jsx("div", { className: "ds-token-counter__track", children: /* @__PURE__ */ e.jsx(
|
|
2940
2952
|
"div",
|
|
2941
2953
|
{
|
|
2942
|
-
className: `ds-token-counter__fill ds-token-counter__fill--${
|
|
2943
|
-
style: { width: `${
|
|
2954
|
+
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2955
|
+
style: { width: `${c}%` }
|
|
2944
2956
|
}
|
|
2945
2957
|
) }),
|
|
2946
|
-
(
|
|
2947
|
-
|
|
2958
|
+
(r || o) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
2959
|
+
r && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2948
2960
|
qe(t),
|
|
2949
2961
|
" / ",
|
|
2950
2962
|
qe(s)
|
|
@@ -2966,27 +2978,27 @@ function xn({
|
|
|
2966
2978
|
value: t = 0,
|
|
2967
2979
|
size: s = "xs",
|
|
2968
2980
|
showLabel: n = "none",
|
|
2969
|
-
layout:
|
|
2981
|
+
layout: r = "inline"
|
|
2970
2982
|
}) {
|
|
2971
|
-
const o = Math.max(0, Math.min(1, t)),
|
|
2983
|
+
const o = Math.max(0, Math.min(1, t)), a = Math.round(o * He), i = Kt(o);
|
|
2972
2984
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2973
2985
|
"ds-confidence-bar",
|
|
2974
2986
|
`ds-confidence-bar--${s}`,
|
|
2975
2987
|
`ds-confidence-bar--${i}`,
|
|
2976
|
-
|
|
2988
|
+
r === "block" && "ds-confidence-bar--block"
|
|
2977
2989
|
].filter(Boolean).join(" "), children: [
|
|
2978
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: He }, (l,
|
|
2990
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: He }, (l, c) => /* @__PURE__ */ e.jsx(
|
|
2979
2991
|
"div",
|
|
2980
2992
|
{
|
|
2981
|
-
className: `ds-confidence-bar__seg${
|
|
2993
|
+
className: `ds-confidence-bar__seg${c < a ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2982
2994
|
},
|
|
2983
|
-
|
|
2995
|
+
c
|
|
2984
2996
|
)) }),
|
|
2985
2997
|
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
2986
2998
|
] });
|
|
2987
2999
|
}
|
|
2988
3000
|
const Gt = { add: "+", remove: "-", context: " " };
|
|
2989
|
-
function
|
|
3001
|
+
function ge({ line: t, lineNumbers: s }) {
|
|
2990
3002
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${t.type}`, children: [
|
|
2991
3003
|
s && t.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: t.lineNo }),
|
|
2992
3004
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Gt[t.type] }),
|
|
@@ -2997,9 +3009,9 @@ function vn({
|
|
|
2997
3009
|
lines: t = [],
|
|
2998
3010
|
layout: s = "inline",
|
|
2999
3011
|
wordWrap: n = !1,
|
|
3000
|
-
lineNumbers:
|
|
3012
|
+
lineNumbers: r = !0,
|
|
3001
3013
|
maxHeight: o,
|
|
3002
|
-
title:
|
|
3014
|
+
title: a
|
|
3003
3015
|
}) {
|
|
3004
3016
|
const i = [
|
|
3005
3017
|
"ds-diff-view",
|
|
@@ -3007,39 +3019,39 @@ function vn({
|
|
|
3007
3019
|
n && "ds-diff-view--wrap"
|
|
3008
3020
|
].filter(Boolean).join(" "), l = o ? { maxHeight: o, overflowY: "auto" } : void 0;
|
|
3009
3021
|
if (s === "split") {
|
|
3010
|
-
const
|
|
3022
|
+
const c = t.filter((m) => m.type === "remove" || m.type === "context"), d = t.filter((m) => m.type === "add" || m.type === "context");
|
|
3011
3023
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3012
|
-
|
|
3024
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: a }),
|
|
3013
3025
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
|
|
3014
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children:
|
|
3015
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children:
|
|
3026
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((m, p) => /* @__PURE__ */ e.jsx(ge, { line: m, lineNumbers: r }, p)) }),
|
|
3027
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((m, p) => /* @__PURE__ */ e.jsx(ge, { line: m, lineNumbers: r }, p)) })
|
|
3016
3028
|
] })
|
|
3017
3029
|
] });
|
|
3018
3030
|
}
|
|
3019
3031
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3020
|
-
|
|
3021
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((
|
|
3032
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: a }),
|
|
3033
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((c, d) => /* @__PURE__ */ e.jsx(ge, { line: c, lineNumbers: r }, d)) })
|
|
3022
3034
|
] });
|
|
3023
3035
|
}
|
|
3024
3036
|
function Xt({
|
|
3025
3037
|
value: t = "idle",
|
|
3026
3038
|
onLike: s,
|
|
3027
3039
|
onDislike: n,
|
|
3028
|
-
className:
|
|
3040
|
+
className: r = "",
|
|
3029
3041
|
...o
|
|
3030
3042
|
}) {
|
|
3031
|
-
const
|
|
3043
|
+
const a = t !== "idle";
|
|
3032
3044
|
return /* @__PURE__ */ e.jsxs(
|
|
3033
3045
|
"div",
|
|
3034
3046
|
{
|
|
3035
3047
|
className: [
|
|
3036
3048
|
"ds-message-feedback",
|
|
3037
|
-
|
|
3038
|
-
|
|
3049
|
+
a && "ds-message-feedback--voted",
|
|
3050
|
+
r
|
|
3039
3051
|
].filter(Boolean).join(" "),
|
|
3040
3052
|
...o,
|
|
3041
3053
|
children: [
|
|
3042
|
-
(!
|
|
3054
|
+
(!a || t === "liked") && /* @__PURE__ */ e.jsx(
|
|
3043
3055
|
"button",
|
|
3044
3056
|
{
|
|
3045
3057
|
className: [
|
|
@@ -3047,7 +3059,7 @@ function Xt({
|
|
|
3047
3059
|
t === "liked" && "ds-message-feedback__btn--liked"
|
|
3048
3060
|
].filter(Boolean).join(" "),
|
|
3049
3061
|
onClick: s,
|
|
3050
|
-
disabled:
|
|
3062
|
+
disabled: a,
|
|
3051
3063
|
"aria-label": "Like",
|
|
3052
3064
|
"aria-pressed": t === "liked",
|
|
3053
3065
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -3060,7 +3072,7 @@ function Xt({
|
|
|
3060
3072
|
)
|
|
3061
3073
|
}
|
|
3062
3074
|
),
|
|
3063
|
-
(!
|
|
3075
|
+
(!a || t === "disliked") && /* @__PURE__ */ e.jsx(
|
|
3064
3076
|
"button",
|
|
3065
3077
|
{
|
|
3066
3078
|
className: [
|
|
@@ -3068,7 +3080,7 @@ function Xt({
|
|
|
3068
3080
|
t === "disliked" && "ds-message-feedback__btn--disliked"
|
|
3069
3081
|
].filter(Boolean).join(" "),
|
|
3070
3082
|
onClick: n,
|
|
3071
|
-
disabled:
|
|
3083
|
+
disabled: a,
|
|
3072
3084
|
"aria-label": "Dislike",
|
|
3073
3085
|
"aria-pressed": t === "disliked",
|
|
3074
3086
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -3088,32 +3100,32 @@ function Xt({
|
|
|
3088
3100
|
function Jt(t) {
|
|
3089
3101
|
const s = t instanceof Date ? t : new Date(t);
|
|
3090
3102
|
if (isNaN(s)) return null;
|
|
3091
|
-
const n = /* @__PURE__ */ new Date(),
|
|
3092
|
-
if (s >= o) return
|
|
3093
|
-
if (s >=
|
|
3103
|
+
const n = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), o = new Date(n.getFullYear(), n.getMonth(), n.getDate()), a = new Date(o - 864e5);
|
|
3104
|
+
if (s >= o) return r;
|
|
3105
|
+
if (s >= a) return `Yesterday ${r}`;
|
|
3094
3106
|
const i = s.getDate(), l = s.toLocaleString([], { month: "short" });
|
|
3095
|
-
return `${i} ${l} ${
|
|
3107
|
+
return `${i} ${l} ${r}`;
|
|
3096
3108
|
}
|
|
3097
3109
|
function _n({
|
|
3098
3110
|
role: t = "assistant",
|
|
3099
3111
|
text: s,
|
|
3100
3112
|
timestamp: n,
|
|
3101
|
-
feedbackValue:
|
|
3113
|
+
feedbackValue: r = "idle",
|
|
3102
3114
|
onLike: o,
|
|
3103
|
-
onDislike:
|
|
3115
|
+
onDislike: a,
|
|
3104
3116
|
className: i = "",
|
|
3105
3117
|
...l
|
|
3106
3118
|
}) {
|
|
3107
|
-
const
|
|
3108
|
-
return !
|
|
3119
|
+
const c = t === "assistant" && (o || a), d = !!s, m = n ? Jt(n) : null;
|
|
3120
|
+
return !c && !d && !m ? null : /* @__PURE__ */ e.jsxs(
|
|
3109
3121
|
"div",
|
|
3110
3122
|
{
|
|
3111
3123
|
className: ["ds-message-footer", `ds-message-footer--${t}`, i].filter(Boolean).join(" "),
|
|
3112
3124
|
...l,
|
|
3113
3125
|
children: [
|
|
3114
3126
|
t === "user" && m && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: m }),
|
|
3115
|
-
|
|
3116
|
-
|
|
3127
|
+
c && /* @__PURE__ */ e.jsx(Xt, { className: "ds-message-action", value: r, onLike: o, onDislike: a }),
|
|
3128
|
+
d && /* @__PURE__ */ e.jsx(Ut, { className: "ds-message-action", text: s }),
|
|
3117
3129
|
t === "assistant" && m && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: m })
|
|
3118
3130
|
]
|
|
3119
3131
|
}
|
|
@@ -3125,8 +3137,8 @@ function bn({ label: t, className: s = "", ...n }) {
|
|
|
3125
3137
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: t })
|
|
3126
3138
|
] });
|
|
3127
3139
|
}
|
|
3128
|
-
function jn({ variant: t = "light", glow: s, mask: n = !0, style:
|
|
3129
|
-
const
|
|
3140
|
+
function jn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...o }) {
|
|
3141
|
+
const a = t === "dark", i = s ?? a, l = a ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", c = a ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
3130
3142
|
return /* @__PURE__ */ e.jsx(
|
|
3131
3143
|
"div",
|
|
3132
3144
|
{
|
|
@@ -3139,7 +3151,7 @@ function jn({ variant: t = "light", glow: s, mask: n = !0, style: a, ...o }) {
|
|
|
3139
3151
|
...i && {
|
|
3140
3152
|
background: "radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"
|
|
3141
3153
|
},
|
|
3142
|
-
...
|
|
3154
|
+
...r
|
|
3143
3155
|
},
|
|
3144
3156
|
...o,
|
|
3145
3157
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -3151,8 +3163,8 @@ function jn({ variant: t = "light", glow: s, mask: n = !0, style: a, ...o }) {
|
|
|
3151
3163
|
backgroundImage: [
|
|
3152
3164
|
`linear-gradient(${l} 1px, transparent 1px)`,
|
|
3153
3165
|
`linear-gradient(90deg, ${l} 1px, transparent 1px)`,
|
|
3154
|
-
`linear-gradient(${
|
|
3155
|
-
`linear-gradient(90deg, ${
|
|
3166
|
+
`linear-gradient(${c} 1px, transparent 1px)`,
|
|
3167
|
+
`linear-gradient(90deg, ${c} 1px, transparent 1px)`
|
|
3156
3168
|
].join(", "),
|
|
3157
3169
|
backgroundSize: "80px 80px, 80px 80px, 16px 16px, 16px 16px",
|
|
3158
3170
|
backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
|
|
@@ -3166,61 +3178,61 @@ function jn({ variant: t = "light", glow: s, mask: n = !0, style: a, ...o }) {
|
|
|
3166
3178
|
}
|
|
3167
3179
|
);
|
|
3168
3180
|
}
|
|
3169
|
-
function Nn({ children: t, axis: s = "y", style: n, className:
|
|
3170
|
-
const
|
|
3181
|
+
function Nn({ children: t, axis: s = "y", style: n, className: r = "", ...o }) {
|
|
3182
|
+
const a = s === "x" ? { overflowX: "auto", overflowY: "hidden" } : s === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
3171
3183
|
return /* @__PURE__ */ e.jsx(
|
|
3172
3184
|
"div",
|
|
3173
3185
|
{
|
|
3174
|
-
className: `ds-scrollable ${
|
|
3175
|
-
style: { ...
|
|
3186
|
+
className: `ds-scrollable ${r}`,
|
|
3187
|
+
style: { ...a, ...n },
|
|
3176
3188
|
...o,
|
|
3177
3189
|
children: t
|
|
3178
3190
|
}
|
|
3179
3191
|
);
|
|
3180
3192
|
}
|
|
3181
|
-
const
|
|
3193
|
+
const ye = 280, Zt = 22, Qt = 14, le = 8, be = 6, es = 200;
|
|
3182
3194
|
function ts(t) {
|
|
3183
3195
|
return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
|
|
3184
3196
|
}
|
|
3185
|
-
function ss(t, s, n,
|
|
3186
|
-
const o = window.innerWidth,
|
|
3187
|
-
if (
|
|
3188
|
-
if (t.top >= s +
|
|
3189
|
-
if (o - t.right >= n +
|
|
3190
|
-
if (t.left >= n +
|
|
3191
|
-
const i = Math.max(t.top,
|
|
3192
|
-
return i ===
|
|
3193
|
-
}
|
|
3194
|
-
function ns(t, s, n,
|
|
3195
|
-
const
|
|
3196
|
-
let l,
|
|
3197
|
+
function ss(t, s, n, r) {
|
|
3198
|
+
const o = window.innerWidth, a = window.innerHeight;
|
|
3199
|
+
if (a - t.bottom >= s + r + le) return "bottom";
|
|
3200
|
+
if (t.top >= s + r + le) return "top";
|
|
3201
|
+
if (o - t.right >= n + r + le) return "right";
|
|
3202
|
+
if (t.left >= n + r + le) return "left";
|
|
3203
|
+
const i = Math.max(t.top, a - t.bottom, o - t.right, t.left);
|
|
3204
|
+
return i === a - t.bottom ? "bottom" : i === t.top ? "top" : i === o - t.right ? "right" : "left";
|
|
3205
|
+
}
|
|
3206
|
+
function ns(t, s, n, r, o) {
|
|
3207
|
+
const a = window.innerWidth, i = window.innerHeight;
|
|
3208
|
+
let l, c;
|
|
3197
3209
|
switch (t) {
|
|
3198
3210
|
case "top":
|
|
3199
|
-
l = s.top - n - o,
|
|
3211
|
+
l = s.top - n - o, c = s.left + s.width / 2 - r / 2;
|
|
3200
3212
|
break;
|
|
3201
3213
|
case "bottom":
|
|
3202
|
-
l = s.bottom + o,
|
|
3214
|
+
l = s.bottom + o, c = s.left + s.width / 2 - r / 2;
|
|
3203
3215
|
break;
|
|
3204
3216
|
case "left":
|
|
3205
|
-
l = s.top + s.height / 2 - n / 2,
|
|
3217
|
+
l = s.top + s.height / 2 - n / 2, c = s.left - r - o;
|
|
3206
3218
|
break;
|
|
3207
3219
|
default:
|
|
3208
|
-
l = s.top + s.height / 2 - n / 2,
|
|
3220
|
+
l = s.top + s.height / 2 - n / 2, c = s.right + o;
|
|
3209
3221
|
}
|
|
3210
|
-
const
|
|
3211
|
-
return { top: Math.max(le, Math.min(i - n - le, l)), left:
|
|
3222
|
+
const d = Math.max(le, Math.min(a - r - le, c));
|
|
3223
|
+
return { top: Math.max(le, Math.min(i - n - le, l)), left: d, arrowOffset: c - d };
|
|
3212
3224
|
}
|
|
3213
3225
|
function wn({
|
|
3214
3226
|
steps: t,
|
|
3215
3227
|
currentStep: s,
|
|
3216
3228
|
onNext: n,
|
|
3217
|
-
onBack:
|
|
3229
|
+
onBack: r,
|
|
3218
3230
|
onSkip: o,
|
|
3219
|
-
onFinish:
|
|
3231
|
+
onFinish: a,
|
|
3220
3232
|
overlay: i = !0,
|
|
3221
3233
|
ring: l = !0,
|
|
3222
|
-
labelNext:
|
|
3223
|
-
labelBack:
|
|
3234
|
+
labelNext: c = "Next",
|
|
3235
|
+
labelBack: d = "Back",
|
|
3224
3236
|
labelSkip: m = "Skip tour",
|
|
3225
3237
|
labelFinish: p = "Done",
|
|
3226
3238
|
statePrimary: h = "idle",
|
|
@@ -3228,17 +3240,17 @@ function wn({
|
|
|
3228
3240
|
}) {
|
|
3229
3241
|
const x = T(null), v = T(t), j = T(s), E = T(l);
|
|
3230
3242
|
v.current = t, j.current = s, E.current = l;
|
|
3231
|
-
const [g, b] = I(!1), [S, L] = I({ position: "fixed", visibility: "hidden", width:
|
|
3243
|
+
const [g, b] = I(!1), [S, L] = I({ position: "fixed", visibility: "hidden", width: ye }), [C, U] = I("bottom"), [K, V] = I(null), w = T(!1), M = t[s], G = s === t.length - 1, F = je(() => {
|
|
3232
3244
|
const A = v.current[j.current];
|
|
3233
3245
|
if (!A || !x.current) return;
|
|
3234
3246
|
const _ = ts(A.target);
|
|
3235
3247
|
if (!_) return;
|
|
3236
|
-
const y = _.getBoundingClientRect(), O = x.current.getBoundingClientRect().height || 160, H =
|
|
3248
|
+
const y = _.getBoundingClientRect(), O = x.current.getBoundingClientRect().height || 160, H = ye, k = E.current ? Zt : Qt, f = A.position || ss(y, O, H, k), { top: $, left: z, arrowOffset: W } = ns(f, y, O, H, k);
|
|
3237
3249
|
U(f), L({
|
|
3238
3250
|
position: "fixed",
|
|
3239
3251
|
top: $,
|
|
3240
3252
|
left: z,
|
|
3241
|
-
width:
|
|
3253
|
+
width: ye,
|
|
3242
3254
|
visibility: "visible",
|
|
3243
3255
|
"--arrow-offset": `${W}px`
|
|
3244
3256
|
}), V({
|
|
@@ -3335,8 +3347,8 @@ function wn({
|
|
|
3335
3347
|
t.length
|
|
3336
3348
|
] }),
|
|
3337
3349
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
|
|
3338
|
-
s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state: u, onClick:
|
|
3339
|
-
/* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick: G ?
|
|
3350
|
+
s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state: u, onClick: r, children: d }),
|
|
3351
|
+
/* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick: G ? a : n, children: G ? p : c })
|
|
3340
3352
|
] })
|
|
3341
3353
|
] })
|
|
3342
3354
|
]
|
|
@@ -3347,30 +3359,30 @@ function wn({
|
|
|
3347
3359
|
);
|
|
3348
3360
|
}
|
|
3349
3361
|
function gn(t, s = {}) {
|
|
3350
|
-
const { storageKey: n } = s, [
|
|
3362
|
+
const { storageKey: n } = s, [r, o] = I(0), [a, i] = I(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = je(() => {
|
|
3351
3363
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3352
3364
|
}, [n]);
|
|
3353
3365
|
return {
|
|
3354
|
-
currentStep:
|
|
3355
|
-
isActive:
|
|
3366
|
+
currentStep: r,
|
|
3367
|
+
isActive: a,
|
|
3356
3368
|
start: () => {
|
|
3357
3369
|
l() || (o(0), i(!0));
|
|
3358
3370
|
},
|
|
3359
|
-
next: () => o((
|
|
3360
|
-
back: () => o((
|
|
3361
|
-
skip:
|
|
3362
|
-
finish:
|
|
3371
|
+
next: () => o((d) => Math.min(d + 1, t.length - 1)),
|
|
3372
|
+
back: () => o((d) => Math.max(d - 1, 0)),
|
|
3373
|
+
skip: c,
|
|
3374
|
+
finish: c
|
|
3363
3375
|
};
|
|
3364
3376
|
}
|
|
3365
3377
|
function yn() {
|
|
3366
|
-
const t = T(null), s =
|
|
3378
|
+
const t = T(null), s = je(() => {
|
|
3367
3379
|
const n = t.current;
|
|
3368
3380
|
if (!n) return;
|
|
3369
3381
|
n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
|
|
3370
|
-
const
|
|
3371
|
-
n.classList.remove("ds-shake"), n.removeEventListener("animationend",
|
|
3382
|
+
const r = () => {
|
|
3383
|
+
n.classList.remove("ds-shake"), n.removeEventListener("animationend", r);
|
|
3372
3384
|
};
|
|
3373
|
-
n.addEventListener("animationend",
|
|
3385
|
+
n.addEventListener("animationend", r);
|
|
3374
3386
|
}, []);
|
|
3375
3387
|
return { ref: t, shake: s };
|
|
3376
3388
|
}
|