@donkit-ai/design-system 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +166 -164
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -153,7 +153,7 @@ function as() {
|
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function m() {
|
|
157
157
|
var c = s(this.type);
|
|
158
158
|
return C[c] || (C[c] = !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."
|
|
@@ -169,7 +169,7 @@ function as() {
|
|
|
169
169
|
_owner: F
|
|
170
170
|
}, (W !== void 0 ? W : null) !== null ? Object.defineProperty(c, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
172
|
+
get: m
|
|
173
173
|
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -198,13 +198,13 @@ function as() {
|
|
|
198
198
|
if (F)
|
|
199
199
|
if (_(W)) {
|
|
200
200
|
for (F = 0; F < W.length; F++)
|
|
201
|
-
|
|
201
|
+
p(W[F]);
|
|
202
202
|
Object.freeze && Object.freeze(W);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
|
-
else
|
|
207
|
+
else p(W);
|
|
208
208
|
if (U.call(N, "key")) {
|
|
209
209
|
W = s(c);
|
|
210
210
|
var Q = Object.keys(N).filter(function(_e) {
|
|
@@ -240,7 +240,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
240
240
|
ae
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function p(c) {
|
|
244
244
|
h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === z && (c._payload.status === "fulfilled" ? h(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(c) {
|
|
@@ -304,10 +304,10 @@ function fe({
|
|
|
304
304
|
disabled: n = !1,
|
|
305
305
|
state: o = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
307
|
+
type: m = "button",
|
|
308
308
|
href: u,
|
|
309
309
|
"aria-label": f,
|
|
310
|
-
...
|
|
310
|
+
...p
|
|
311
311
|
}) {
|
|
312
312
|
const h = a && !s, d = o === "loading", x = o === "success", b = o === "error", R = d || x || b, E = r === "xs" ? "s" : "m", g = os[r] ?? 16, A = d ? /* @__PURE__ */ e.jsx(is, { size: E }) : x ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(he, { size: g, strokeWidth: 2.5 }) }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ne, { size: g, strokeWidth: 2.5 }) }) : null, k = [
|
|
313
313
|
"ds-button",
|
|
@@ -337,7 +337,7 @@ function fe({
|
|
|
337
337
|
"aria-disabled": n || d ? "true" : void 0,
|
|
338
338
|
"aria-busy": d ? "true" : void 0,
|
|
339
339
|
"data-state": O,
|
|
340
|
-
...
|
|
340
|
+
...p,
|
|
341
341
|
children: D
|
|
342
342
|
}
|
|
343
343
|
);
|
|
@@ -345,14 +345,14 @@ function fe({
|
|
|
345
345
|
return /* @__PURE__ */ e.jsx(
|
|
346
346
|
"button",
|
|
347
347
|
{
|
|
348
|
-
type:
|
|
348
|
+
type: m,
|
|
349
349
|
className: k,
|
|
350
350
|
disabled: n,
|
|
351
351
|
onClick: d ? void 0 : l,
|
|
352
352
|
"aria-label": f,
|
|
353
353
|
"aria-busy": d ? "true" : void 0,
|
|
354
354
|
"data-state": O,
|
|
355
|
-
...
|
|
355
|
+
...p,
|
|
356
356
|
children: D
|
|
357
357
|
}
|
|
358
358
|
);
|
|
@@ -366,21 +366,21 @@ function Os({
|
|
|
366
366
|
iconRight: n,
|
|
367
367
|
onIconRightClick: o,
|
|
368
368
|
size: l = "m",
|
|
369
|
-
disabled:
|
|
369
|
+
disabled: m,
|
|
370
370
|
id: u,
|
|
371
371
|
...f
|
|
372
372
|
}) {
|
|
373
|
-
const
|
|
374
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${
|
|
375
|
-
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor:
|
|
373
|
+
const p = u || `input-${q.useId()}`, h = r ? `${p}-hint` : void 0, d = t ? `${p}-error` : void 0, x = d || h;
|
|
374
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
375
|
+
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
376
376
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
377
377
|
a && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: a }),
|
|
378
378
|
/* @__PURE__ */ e.jsx(
|
|
379
379
|
"input",
|
|
380
380
|
{
|
|
381
|
-
id:
|
|
381
|
+
id: p,
|
|
382
382
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
383
|
-
disabled:
|
|
383
|
+
disabled: m,
|
|
384
384
|
"aria-invalid": t ? "true" : "false",
|
|
385
385
|
"aria-describedby": x,
|
|
386
386
|
...f
|
|
@@ -411,10 +411,10 @@ function zs({
|
|
|
411
411
|
disabled: n,
|
|
412
412
|
id: o,
|
|
413
413
|
resize: l = !0,
|
|
414
|
-
rows:
|
|
414
|
+
rows: m = 3,
|
|
415
415
|
...u
|
|
416
416
|
}) {
|
|
417
|
-
const f = o || `textarea-${q.useId()}`,
|
|
417
|
+
const f = o || `textarea-${q.useId()}`, p = r ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, d = h || p;
|
|
418
418
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${n ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
419
419
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
|
|
420
420
|
/* @__PURE__ */ e.jsx(
|
|
@@ -425,11 +425,11 @@ function zs({
|
|
|
425
425
|
disabled: n,
|
|
426
426
|
"aria-invalid": t ? "true" : "false",
|
|
427
427
|
"aria-describedby": d,
|
|
428
|
-
rows:
|
|
428
|
+
rows: m,
|
|
429
429
|
...u
|
|
430
430
|
}
|
|
431
431
|
),
|
|
432
|
-
r && !t && /* @__PURE__ */ e.jsx("span", { id:
|
|
432
|
+
r && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: r }),
|
|
433
433
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
434
434
|
] });
|
|
435
435
|
}
|
|
@@ -442,11 +442,11 @@ function Fs({
|
|
|
442
442
|
error: n,
|
|
443
443
|
fullWidth: o = !0,
|
|
444
444
|
size: l = "m",
|
|
445
|
-
disabled:
|
|
445
|
+
disabled: m = !1,
|
|
446
446
|
id: u,
|
|
447
447
|
...f
|
|
448
448
|
}) {
|
|
449
|
-
const [
|
|
449
|
+
const [p, h] = S(!1), [d, x] = S(!1), [b, R] = S({}), [E, g] = S("down"), [A, k] = S(-1), O = $(null), D = $(null), v = $(null), M = $(null), z = u || `select-${q.useId()}`, Y = `${z}-label`, H = n ? `${z}-error` : void 0, X = 150, U = (w = !1) => {
|
|
450
450
|
d || (x(!0), k(-1), M.current = setTimeout(() => {
|
|
451
451
|
var c;
|
|
452
452
|
h(!1), x(!1), w && ((c = v.current) == null || c.focus());
|
|
@@ -467,46 +467,46 @@ function Fs({
|
|
|
467
467
|
);
|
|
468
468
|
};
|
|
469
469
|
B(() => {
|
|
470
|
-
if (
|
|
470
|
+
if (p)
|
|
471
471
|
return y(), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
|
|
472
472
|
window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
|
|
473
473
|
};
|
|
474
|
-
}, [
|
|
474
|
+
}, [p]), B(() => {
|
|
475
475
|
const w = (c) => {
|
|
476
476
|
O.current && !O.current.contains(c.target) && D.current && !D.current.contains(c.target) && U();
|
|
477
477
|
};
|
|
478
478
|
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
479
479
|
}, [d]), B(() => {
|
|
480
480
|
var c;
|
|
481
|
-
if (!
|
|
481
|
+
if (!p || A < 0 || !D.current) return;
|
|
482
482
|
(c = D.current.querySelectorAll(".ds-select-option")[A]) == null || c.scrollIntoView({ block: "nearest" });
|
|
483
|
-
}, [A,
|
|
483
|
+
}, [A, p]);
|
|
484
484
|
const L = (w) => {
|
|
485
485
|
switch (w.key) {
|
|
486
486
|
case "ArrowDown":
|
|
487
|
-
w.preventDefault(),
|
|
487
|
+
w.preventDefault(), p ? k((c) => Math.min(c + 1, i.length - 1)) : _();
|
|
488
488
|
break;
|
|
489
489
|
case "ArrowUp":
|
|
490
|
-
w.preventDefault(),
|
|
490
|
+
w.preventDefault(), p ? k((c) => Math.max(c - 1, 0)) : _(i.length - 1);
|
|
491
491
|
break;
|
|
492
492
|
case "Home":
|
|
493
|
-
|
|
493
|
+
p && (w.preventDefault(), k(0));
|
|
494
494
|
break;
|
|
495
495
|
case "End":
|
|
496
|
-
|
|
496
|
+
p && (w.preventDefault(), k(i.length - 1));
|
|
497
497
|
break;
|
|
498
498
|
case "Enter":
|
|
499
499
|
case " ":
|
|
500
|
-
w.preventDefault(),
|
|
500
|
+
w.preventDefault(), p ? A >= 0 && (r == null || r(i[A].value), U(!0)) : _();
|
|
501
501
|
break;
|
|
502
502
|
case "Escape":
|
|
503
|
-
|
|
503
|
+
p && (w.preventDefault(), U(!0));
|
|
504
504
|
break;
|
|
505
505
|
case "Tab":
|
|
506
|
-
|
|
506
|
+
p && U(!1);
|
|
507
507
|
break;
|
|
508
508
|
}
|
|
509
|
-
}, C = i.find((w) => w.value === t), K = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], Z =
|
|
509
|
+
}, C = i.find((w) => w.value === t), K = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], Z = p && /* @__PURE__ */ e.jsx(
|
|
510
510
|
"div",
|
|
511
511
|
{
|
|
512
512
|
ref: D,
|
|
@@ -543,7 +543,7 @@ function Fs({
|
|
|
543
543
|
))
|
|
544
544
|
}
|
|
545
545
|
);
|
|
546
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${
|
|
546
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
547
547
|
s && /* @__PURE__ */ e.jsx("label", { id: Y, className: "ds-select-label", children: s }),
|
|
548
548
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: O, children: /* @__PURE__ */ e.jsxs(
|
|
549
549
|
"button",
|
|
@@ -553,17 +553,17 @@ function Fs({
|
|
|
553
553
|
id: z,
|
|
554
554
|
role: "combobox",
|
|
555
555
|
"aria-haspopup": "listbox",
|
|
556
|
-
"aria-expanded":
|
|
557
|
-
"aria-activedescendant":
|
|
556
|
+
"aria-expanded": p,
|
|
557
|
+
"aria-activedescendant": p && A >= 0 ? `${z}-opt-${A}` : void 0,
|
|
558
558
|
"aria-labelledby": s ? Y : void 0,
|
|
559
559
|
"aria-invalid": n ? "true" : "false",
|
|
560
560
|
"aria-describedby": H,
|
|
561
561
|
className: `ds-select-trigger ds-select-trigger--${l} ${n ? "ds-select-trigger--error" : ""}`,
|
|
562
562
|
onClick: () => {
|
|
563
|
-
|
|
563
|
+
m || (p ? U() : _());
|
|
564
564
|
},
|
|
565
565
|
onKeyDown: L,
|
|
566
|
-
disabled:
|
|
566
|
+
disabled: m,
|
|
567
567
|
...f,
|
|
568
568
|
children: [
|
|
569
569
|
/* @__PURE__ */ e.jsx("span", { className: C ? "" : "ds-select-placeholder", children: (C == null ? void 0 : C.label) || a }),
|
|
@@ -572,7 +572,7 @@ function Fs({
|
|
|
572
572
|
{
|
|
573
573
|
size: K,
|
|
574
574
|
strokeWidth: 1.5,
|
|
575
|
-
className: `ds-select-icon ${
|
|
575
|
+
className: `ds-select-icon ${p && E === "down" ? "ds-select-icon--open" : ""} ${p && E === "up" ? "ds-select-icon--up" : ""}`,
|
|
576
576
|
"aria-hidden": "true"
|
|
577
577
|
}
|
|
578
578
|
)
|
|
@@ -592,11 +592,11 @@ function Ws({
|
|
|
592
592
|
step: n = 1,
|
|
593
593
|
size: o = "m",
|
|
594
594
|
disabled: l = !1,
|
|
595
|
-
hint:
|
|
595
|
+
hint: m,
|
|
596
596
|
error: u,
|
|
597
597
|
...f
|
|
598
598
|
}) {
|
|
599
|
-
const
|
|
599
|
+
const p = () => {
|
|
600
600
|
if (l) return;
|
|
601
601
|
const E = Math.min(Number(t) + n, a);
|
|
602
602
|
r == null || r(E);
|
|
@@ -658,14 +658,14 @@ function Ws({
|
|
|
658
658
|
{
|
|
659
659
|
type: "button",
|
|
660
660
|
className: "ds-stepper-button ds-stepper-button--plus",
|
|
661
|
-
onClick:
|
|
661
|
+
onClick: p,
|
|
662
662
|
disabled: l || t >= a,
|
|
663
663
|
"aria-label": "Increase",
|
|
664
664
|
children: /* @__PURE__ */ e.jsx(He, { size: R, strokeWidth: 1.5 })
|
|
665
665
|
}
|
|
666
666
|
)
|
|
667
667
|
] }),
|
|
668
|
-
|
|
668
|
+
m && !u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: m }),
|
|
669
669
|
u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: u })
|
|
670
670
|
] });
|
|
671
671
|
}
|
|
@@ -705,13 +705,13 @@ function ls({
|
|
|
705
705
|
}
|
|
706
706
|
);
|
|
707
707
|
}
|
|
708
|
-
const
|
|
708
|
+
const p = u && a ? "button" : "div", h = u && a ? {
|
|
709
709
|
type: "button",
|
|
710
710
|
onClick: a,
|
|
711
711
|
disabled: o
|
|
712
712
|
} : {};
|
|
713
713
|
return /* @__PURE__ */ e.jsx(
|
|
714
|
-
|
|
714
|
+
p,
|
|
715
715
|
{
|
|
716
716
|
className: f,
|
|
717
717
|
role: u && !a ? "article" : void 0,
|
|
@@ -797,9 +797,9 @@ function Ks({
|
|
|
797
797
|
size: i = "m",
|
|
798
798
|
...a
|
|
799
799
|
}) {
|
|
800
|
-
const n = $(null), o = q.useId(), [l,
|
|
801
|
-
!r || l || (
|
|
802
|
-
|
|
800
|
+
const n = $(null), o = q.useId(), [l, m] = S(!1), u = () => {
|
|
801
|
+
!r || l || (m(!0), setTimeout(() => {
|
|
802
|
+
m(!1), r();
|
|
803
803
|
}, us));
|
|
804
804
|
};
|
|
805
805
|
B(() => {
|
|
@@ -812,7 +812,7 @@ function Ks({
|
|
|
812
812
|
document.removeEventListener("keydown", d), document.removeEventListener("mousedown", x);
|
|
813
813
|
};
|
|
814
814
|
}, [r, l]);
|
|
815
|
-
const f = q.Children.toArray(s),
|
|
815
|
+
const f = q.Children.toArray(s), p = f.find((d) => (d == null ? void 0 : d.type) === Ie), h = f.filter((d) => (d == null ? void 0 : d.type) !== Ie);
|
|
816
816
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", l && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...a, children: /* @__PURE__ */ e.jsxs(
|
|
817
817
|
"div",
|
|
818
818
|
{
|
|
@@ -836,7 +836,7 @@ function Ks({
|
|
|
836
836
|
)
|
|
837
837
|
] }),
|
|
838
838
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body", children: h }),
|
|
839
|
-
|
|
839
|
+
p
|
|
840
840
|
]
|
|
841
841
|
}
|
|
842
842
|
) });
|
|
@@ -854,12 +854,12 @@ function fs({
|
|
|
854
854
|
className: o = "",
|
|
855
855
|
...l
|
|
856
856
|
}) {
|
|
857
|
-
const [
|
|
857
|
+
const [m, u] = S(r), f = i !== void 0, p = f ? i : m, h = () => {
|
|
858
858
|
f ? a == null || a(!i) : u((x) => !x);
|
|
859
859
|
}, d = [
|
|
860
860
|
"ds-code-accordion",
|
|
861
861
|
`ds-code-accordion--${n}`,
|
|
862
|
-
|
|
862
|
+
p && "ds-code-accordion--expanded",
|
|
863
863
|
o
|
|
864
864
|
].filter(Boolean).join(" ");
|
|
865
865
|
return /* @__PURE__ */ e.jsxs("div", { className: d, ...l, children: [
|
|
@@ -869,7 +869,7 @@ function fs({
|
|
|
869
869
|
type: "button",
|
|
870
870
|
className: "ds-code-accordion__header",
|
|
871
871
|
onClick: h,
|
|
872
|
-
"aria-expanded":
|
|
872
|
+
"aria-expanded": p,
|
|
873
873
|
children: [
|
|
874
874
|
/* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: t }),
|
|
875
875
|
/* @__PURE__ */ e.jsx(
|
|
@@ -877,7 +877,7 @@ function fs({
|
|
|
877
877
|
{
|
|
878
878
|
size: I[2],
|
|
879
879
|
strokeWidth: 1.5,
|
|
880
|
-
className: `ds-code-accordion__icon ${
|
|
880
|
+
className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
|
|
881
881
|
}
|
|
882
882
|
)
|
|
883
883
|
]
|
|
@@ -907,14 +907,14 @@ function Xs({ href: s, children: t, onClick: r, target: i, rel: a, ...n }) {
|
|
|
907
907
|
function Js({ children: s, size: t = "m", variant: r = "ghost", ...i }) {
|
|
908
908
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: q.Children.map(s, (a) => q.isValidElement(a) ? q.cloneElement(a, { size: t, variant: r }) : a) });
|
|
909
909
|
}
|
|
910
|
-
function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant: a = "ghost", disabled: n = !1, icon: o, href: l, ...
|
|
910
|
+
function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant: a = "ghost", disabled: n = !1, icon: o, href: l, ...m }) {
|
|
911
911
|
const u = o && !s, f = [
|
|
912
912
|
"ds-tab",
|
|
913
913
|
`ds-tab--${i}`,
|
|
914
914
|
`ds-tab--${a}`,
|
|
915
915
|
t && "ds-tab--selected",
|
|
916
916
|
u && "ds-tab--icon-only"
|
|
917
|
-
].filter(Boolean).join(" "),
|
|
917
|
+
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
918
918
|
o && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: o }),
|
|
919
919
|
s
|
|
920
920
|
] });
|
|
@@ -935,8 +935,8 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
935
935
|
className: f,
|
|
936
936
|
href: n ? void 0 : l,
|
|
937
937
|
onClick: h,
|
|
938
|
-
...
|
|
939
|
-
children:
|
|
938
|
+
...m,
|
|
939
|
+
children: p
|
|
940
940
|
}
|
|
941
941
|
);
|
|
942
942
|
}
|
|
@@ -948,18 +948,18 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
948
948
|
className: f,
|
|
949
949
|
onClick: r,
|
|
950
950
|
disabled: n,
|
|
951
|
-
...
|
|
952
|
-
children:
|
|
951
|
+
...m,
|
|
952
|
+
children: p
|
|
953
953
|
}
|
|
954
954
|
);
|
|
955
955
|
}
|
|
956
956
|
function Qs({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1 }) {
|
|
957
|
-
const n = $(null), o = $(null), [l,
|
|
957
|
+
const n = $(null), o = $(null), [l, m] = S(!1), u = $(!1), f = $(null), p = $(null), h = () => {
|
|
958
958
|
if (!n.current) return;
|
|
959
959
|
const d = n.current.querySelector(`[data-value="${t}"]`);
|
|
960
960
|
if (!d) return;
|
|
961
961
|
const x = n.current.getBoundingClientRect(), b = d.getBoundingClientRect(), R = b.left - x.left, E = b.width;
|
|
962
|
-
o.current ? (o.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = R + "px", o.current.style.width = E + "px", u.current = !1) : (
|
|
962
|
+
o.current ? (o.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = R + "px", o.current.style.width = E + "px", u.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
963
963
|
if (!o.current || !n.current) return;
|
|
964
964
|
const g = n.current.querySelector(`[data-value="${t}"]`);
|
|
965
965
|
if (!g) return;
|
|
@@ -967,13 +967,13 @@ function Qs({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
967
967
|
o.current.style.transition = "none", o.current.style.left = k.left - A.left + "px", o.current.style.width = k.width + "px";
|
|
968
968
|
}));
|
|
969
969
|
};
|
|
970
|
-
return
|
|
970
|
+
return p.current = h, Ve(() => {
|
|
971
971
|
const d = f.current !== t;
|
|
972
972
|
f.current = t, u.current = l && d, h();
|
|
973
973
|
}), B(() => {
|
|
974
974
|
if (!n.current) return;
|
|
975
975
|
const d = new ResizeObserver(() => {
|
|
976
|
-
u.current = !1,
|
|
976
|
+
u.current = !1, p.current();
|
|
977
977
|
});
|
|
978
978
|
return d.observe(n.current), () => d.disconnect();
|
|
979
979
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
@@ -1024,8 +1024,8 @@ function Fe({
|
|
|
1024
1024
|
padding: n = "m",
|
|
1025
1025
|
...o
|
|
1026
1026
|
}) {
|
|
1027
|
-
const [l,
|
|
1028
|
-
u ? a == null || a(!i) :
|
|
1027
|
+
const [l, m] = S(r), u = i !== void 0, f = u ? i : l, p = () => {
|
|
1028
|
+
u ? a == null || a(!i) : m((d) => !d);
|
|
1029
1029
|
}, h = [
|
|
1030
1030
|
"ds-accordion",
|
|
1031
1031
|
`ds-accordion--${n}`,
|
|
@@ -1037,7 +1037,7 @@ function Fe({
|
|
|
1037
1037
|
{
|
|
1038
1038
|
type: "button",
|
|
1039
1039
|
className: "ds-accordion__header",
|
|
1040
|
-
onClick:
|
|
1040
|
+
onClick: p,
|
|
1041
1041
|
"aria-expanded": f,
|
|
1042
1042
|
children: [
|
|
1043
1043
|
/* @__PURE__ */ e.jsx("span", { className: "ds-accordion__title", children: t }),
|
|
@@ -1088,9 +1088,9 @@ function ps(s, t, r) {
|
|
|
1088
1088
|
return n === s.top ? "top" : n === a - s.bottom ? "bottom" : n === i - s.right ? "right" : "left";
|
|
1089
1089
|
}
|
|
1090
1090
|
function et({ children: s, content: t, position: r, ...i }) {
|
|
1091
|
-
const [a, n] = S(!1), [o, l] = S({ visibility: "hidden" }), [
|
|
1092
|
-
if (!f.current || !
|
|
1093
|
-
const b = f.current.getBoundingClientRect(), R =
|
|
1091
|
+
const [a, n] = S(!1), [o, l] = S({ visibility: "hidden" }), [m, u] = S(r || "top"), f = $(null), p = $(null), h = $(!1), d = () => {
|
|
1092
|
+
if (!f.current || !p.current) return;
|
|
1093
|
+
const b = f.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), E = r || ps(b, R.height, R.width), { top: g, left: A, arrowOffset: k } = ms(E, b, R);
|
|
1094
1094
|
u(E), l({
|
|
1095
1095
|
position: "fixed",
|
|
1096
1096
|
top: g,
|
|
@@ -1116,8 +1116,8 @@ function et({ children: s, content: t, position: r, ...i }) {
|
|
|
1116
1116
|
const x = a && /* @__PURE__ */ e.jsx(
|
|
1117
1117
|
"div",
|
|
1118
1118
|
{
|
|
1119
|
-
ref:
|
|
1120
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1119
|
+
ref: p,
|
|
1120
|
+
className: `ds-tooltip ds-tooltip--${m}`,
|
|
1121
1121
|
role: "tooltip",
|
|
1122
1122
|
style: o,
|
|
1123
1123
|
children: t
|
|
@@ -1154,12 +1154,12 @@ function st({
|
|
|
1154
1154
|
id: n,
|
|
1155
1155
|
...o
|
|
1156
1156
|
}) {
|
|
1157
|
-
const l = n || `toggle-${q.useId()}`,
|
|
1157
|
+
const l = n || `toggle-${q.useId()}`, m = [
|
|
1158
1158
|
"ds-toggle",
|
|
1159
1159
|
`ds-toggle--${r}`,
|
|
1160
1160
|
i && "ds-toggle--disabled"
|
|
1161
1161
|
].filter(Boolean).join(" ");
|
|
1162
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1162
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1163
1163
|
/* @__PURE__ */ e.jsx(
|
|
1164
1164
|
"input",
|
|
1165
1165
|
{
|
|
@@ -1185,12 +1185,12 @@ function tt({
|
|
|
1185
1185
|
id: n,
|
|
1186
1186
|
...o
|
|
1187
1187
|
}) {
|
|
1188
|
-
const l = n || `checkbox-${q.useId()}`,
|
|
1188
|
+
const l = n || `checkbox-${q.useId()}`, m = [
|
|
1189
1189
|
"ds-checkbox",
|
|
1190
1190
|
`ds-checkbox--${r}`,
|
|
1191
1191
|
i && "ds-checkbox--disabled"
|
|
1192
1192
|
].filter(Boolean).join(" "), u = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1193
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1193
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1194
1194
|
/* @__PURE__ */ e.jsx(
|
|
1195
1195
|
"input",
|
|
1196
1196
|
{
|
|
@@ -1223,7 +1223,7 @@ function rt({
|
|
|
1223
1223
|
name: n,
|
|
1224
1224
|
value: o,
|
|
1225
1225
|
id: l,
|
|
1226
|
-
...
|
|
1226
|
+
...m
|
|
1227
1227
|
}) {
|
|
1228
1228
|
const u = l || `radio-${q.useId()}`, f = [
|
|
1229
1229
|
"ds-radio",
|
|
@@ -1238,11 +1238,11 @@ function rt({
|
|
|
1238
1238
|
id: u,
|
|
1239
1239
|
className: "ds-radio__input",
|
|
1240
1240
|
checked: s,
|
|
1241
|
-
onChange: (
|
|
1241
|
+
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1242
1242
|
disabled: i,
|
|
1243
1243
|
name: n,
|
|
1244
1244
|
value: o,
|
|
1245
|
-
...
|
|
1245
|
+
...m
|
|
1246
1246
|
}
|
|
1247
1247
|
),
|
|
1248
1248
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
@@ -1292,7 +1292,7 @@ function js(s) {
|
|
|
1292
1292
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1293
1293
|
}
|
|
1294
1294
|
function nt({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style: n = {}, ...o }) {
|
|
1295
|
-
const l = _s(s ?? ""), [
|
|
1295
|
+
const l = _s(s ?? ""), [m, u] = S(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: js(s) });
|
|
1296
1296
|
return /* @__PURE__ */ e.jsx(
|
|
1297
1297
|
"div",
|
|
1298
1298
|
{
|
|
@@ -1300,7 +1300,7 @@ function nt({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style:
|
|
|
1300
1300
|
style: { width: i, height: i, "--ds-avatar-h": l, ...n },
|
|
1301
1301
|
"aria-hidden": "true",
|
|
1302
1302
|
...o,
|
|
1303
|
-
children: r && !
|
|
1303
|
+
children: r && !m ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () => u(!0) }) : f
|
|
1304
1304
|
}
|
|
1305
1305
|
);
|
|
1306
1306
|
}
|
|
@@ -1340,19 +1340,21 @@ function it({ children: s, ...t }) {
|
|
|
1340
1340
|
function ot({ children: s, ...t }) {
|
|
1341
1341
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1342
1342
|
}
|
|
1343
|
-
function lt({ children: s, interactive: t, selected: r, subheader: i,
|
|
1343
|
+
function lt({ children: s, interactive: t, selected: r, subheader: i, exiting: a, updated: n, className: o = "", onClick: l, ...m }) {
|
|
1344
1344
|
return /* @__PURE__ */ e.jsx(
|
|
1345
1345
|
"tr",
|
|
1346
1346
|
{
|
|
1347
1347
|
className: [
|
|
1348
1348
|
"ds-table-row",
|
|
1349
|
-
t ||
|
|
1349
|
+
t || l ? "ds-table-row--interactive" : "",
|
|
1350
1350
|
r ? "ds-table-row--selected" : "",
|
|
1351
1351
|
i ? "ds-table-row--subheader" : "",
|
|
1352
|
-
a
|
|
1352
|
+
a ? "ds-table-row--exiting" : "",
|
|
1353
|
+
n ? "ds-table-row--updated" : "",
|
|
1354
|
+
o
|
|
1353
1355
|
].filter(Boolean).join(" "),
|
|
1354
|
-
onClick:
|
|
1355
|
-
...
|
|
1356
|
+
onClick: l,
|
|
1357
|
+
...m,
|
|
1356
1358
|
children: s
|
|
1357
1359
|
}
|
|
1358
1360
|
);
|
|
@@ -1361,13 +1363,13 @@ function ct({ children: s, colSpan: t = 999, ...r }) {
|
|
|
1361
1363
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1362
1364
|
}
|
|
1363
1365
|
function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, className: n = "", style: o = {}, ...l }) {
|
|
1364
|
-
const
|
|
1366
|
+
const m = !!i || r !== void 0, u = r === "asc" ? Ke : r === "desc" ? xe : Ge;
|
|
1365
1367
|
return /* @__PURE__ */ e.jsx(
|
|
1366
1368
|
"th",
|
|
1367
1369
|
{
|
|
1368
1370
|
className: [
|
|
1369
1371
|
"ds-th",
|
|
1370
|
-
|
|
1372
|
+
m ? "ds-th--sortable" : "",
|
|
1371
1373
|
r ? "ds-th--sorted" : "",
|
|
1372
1374
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1373
1375
|
n
|
|
@@ -1375,7 +1377,7 @@ function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
|
|
|
1375
1377
|
onClick: i,
|
|
1376
1378
|
style: { width: a, ...o },
|
|
1377
1379
|
...l,
|
|
1378
|
-
children:
|
|
1380
|
+
children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1379
1381
|
s,
|
|
1380
1382
|
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(u, { size: 11, strokeWidth: 2.5 }) })
|
|
1381
1383
|
] }) : s
|
|
@@ -1432,10 +1434,10 @@ function mt({
|
|
|
1432
1434
|
htmlFor: n,
|
|
1433
1435
|
children: o,
|
|
1434
1436
|
className: l = "",
|
|
1435
|
-
style:
|
|
1437
|
+
style: m,
|
|
1436
1438
|
...u
|
|
1437
1439
|
}) {
|
|
1438
|
-
const f = q.useId(),
|
|
1440
|
+
const f = q.useId(), p = n ?? f, h = `${p}-hint`, d = `${p}-error`;
|
|
1439
1441
|
return /* @__PURE__ */ e.jsxs(
|
|
1440
1442
|
"div",
|
|
1441
1443
|
{
|
|
@@ -1443,10 +1445,10 @@ function mt({
|
|
|
1443
1445
|
"data-state": r ? "error" : void 0,
|
|
1444
1446
|
"data-required": i ? "" : void 0,
|
|
1445
1447
|
"data-disabled": a ? "" : void 0,
|
|
1446
|
-
style:
|
|
1448
|
+
style: m,
|
|
1447
1449
|
...u,
|
|
1448
1450
|
children: [
|
|
1449
|
-
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor:
|
|
1451
|
+
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1450
1452
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
|
|
1451
1453
|
t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1452
1454
|
r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: d, role: "alert", children: r })
|
|
@@ -1455,7 +1457,7 @@ function mt({
|
|
|
1455
1457
|
);
|
|
1456
1458
|
}
|
|
1457
1459
|
function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
|
|
1458
|
-
const
|
|
1460
|
+
const m = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
|
|
1459
1461
|
return /* @__PURE__ */ e.jsxs(
|
|
1460
1462
|
"div",
|
|
1461
1463
|
{
|
|
@@ -1470,7 +1472,7 @@ function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
|
|
|
1470
1472
|
children: [
|
|
1471
1473
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1472
1474
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1473
|
-
r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${
|
|
1475
|
+
r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: r })
|
|
1474
1476
|
]
|
|
1475
1477
|
}
|
|
1476
1478
|
);
|
|
@@ -1491,10 +1493,10 @@ function ht({
|
|
|
1491
1493
|
"aria-label": r,
|
|
1492
1494
|
style: a,
|
|
1493
1495
|
...n,
|
|
1494
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l,
|
|
1496
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1495
1497
|
l,
|
|
1496
|
-
|
|
1497
|
-
] },
|
|
1498
|
+
m < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
1499
|
+
] }, m)) })
|
|
1498
1500
|
}
|
|
1499
1501
|
);
|
|
1500
1502
|
}
|
|
@@ -1508,7 +1510,7 @@ function xt({
|
|
|
1508
1510
|
style: o,
|
|
1509
1511
|
...l
|
|
1510
1512
|
}) {
|
|
1511
|
-
const
|
|
1513
|
+
const m = bs(s, t, i);
|
|
1512
1514
|
return /* @__PURE__ */ e.jsxs(
|
|
1513
1515
|
"nav",
|
|
1514
1516
|
{
|
|
@@ -1527,7 +1529,7 @@ function xt({
|
|
|
1527
1529
|
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1528
1530
|
}
|
|
1529
1531
|
),
|
|
1530
|
-
|
|
1532
|
+
m.map(
|
|
1531
1533
|
(u, f) => u === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
|
|
1532
1534
|
"button",
|
|
1533
1535
|
{
|
|
@@ -1569,9 +1571,9 @@ function _t({
|
|
|
1569
1571
|
side: i = "right",
|
|
1570
1572
|
...a
|
|
1571
1573
|
}) {
|
|
1572
|
-
const n = $(null), o = q.useId(), [l,
|
|
1573
|
-
!r || l || (
|
|
1574
|
-
|
|
1574
|
+
const n = $(null), o = q.useId(), [l, m] = S(!1), u = () => {
|
|
1575
|
+
!r || l || (m(!0), setTimeout(() => {
|
|
1576
|
+
m(!1), r();
|
|
1575
1577
|
}, vs));
|
|
1576
1578
|
};
|
|
1577
1579
|
B(() => {
|
|
@@ -1584,7 +1586,7 @@ function _t({
|
|
|
1584
1586
|
document.removeEventListener("keydown", d), document.removeEventListener("mousedown", x);
|
|
1585
1587
|
};
|
|
1586
1588
|
}, [r, l]);
|
|
1587
|
-
const f = q.Children.toArray(s),
|
|
1589
|
+
const f = q.Children.toArray(s), p = f.find((d) => (d == null ? void 0 : d.type) === De), h = f.filter((d) => (d == null ? void 0 : d.type) !== De);
|
|
1588
1590
|
return /* @__PURE__ */ e.jsx(
|
|
1589
1591
|
"div",
|
|
1590
1592
|
{
|
|
@@ -1605,7 +1607,7 @@ function _t({
|
|
|
1605
1607
|
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: u, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }) })
|
|
1606
1608
|
] }),
|
|
1607
1609
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1608
|
-
|
|
1610
|
+
p
|
|
1609
1611
|
]
|
|
1610
1612
|
}
|
|
1611
1613
|
)
|
|
@@ -1630,12 +1632,12 @@ function jt({
|
|
|
1630
1632
|
role: n,
|
|
1631
1633
|
...o
|
|
1632
1634
|
}) {
|
|
1633
|
-
const l = Ns[t],
|
|
1635
|
+
const l = Ns[t], m = n || (t === "error" ? "alert" : "status");
|
|
1634
1636
|
return /* @__PURE__ */ e.jsxs(
|
|
1635
1637
|
"div",
|
|
1636
1638
|
{
|
|
1637
1639
|
className: `ds-banner ds-banner--${t}`,
|
|
1638
|
-
role:
|
|
1640
|
+
role: m,
|
|
1639
1641
|
...o,
|
|
1640
1642
|
children: [
|
|
1641
1643
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
@@ -1673,20 +1675,20 @@ function bt({
|
|
|
1673
1675
|
style: o,
|
|
1674
1676
|
...l
|
|
1675
1677
|
}) {
|
|
1676
|
-
const [
|
|
1678
|
+
const [m, u] = S(!1), [f, p] = S(!1), h = r !== void 0, d = h ? r : m, x = $(null), b = $(null), R = $(null), E = $(null), [g, A] = S({}), k = $(null), O = 150, D = () => {
|
|
1677
1679
|
if (h)
|
|
1678
1680
|
i == null || i(!1);
|
|
1679
1681
|
else {
|
|
1680
1682
|
if (f) return;
|
|
1681
|
-
|
|
1682
|
-
u(!1),
|
|
1683
|
+
p(!0), k.current = setTimeout(() => {
|
|
1684
|
+
u(!1), p(!1);
|
|
1683
1685
|
}, O);
|
|
1684
1686
|
}
|
|
1685
1687
|
}, v = () => {
|
|
1686
1688
|
const _ = !d;
|
|
1687
|
-
h ? i == null || i(_) : _ ? (clearTimeout(k.current),
|
|
1689
|
+
h ? i == null || i(_) : _ ? (clearTimeout(k.current), p(!1), u(!0)) : D();
|
|
1688
1690
|
}, M = () => {
|
|
1689
|
-
d || (h ? i == null || i(!0) : (clearTimeout(k.current),
|
|
1691
|
+
d || (h ? i == null || i(!0) : (clearTimeout(k.current), p(!1), u(!0)));
|
|
1690
1692
|
};
|
|
1691
1693
|
B(() => () => clearTimeout(k.current), []), B(() => {
|
|
1692
1694
|
if (!d) return;
|
|
@@ -1833,7 +1835,7 @@ function vt({
|
|
|
1833
1835
|
min: a = 2,
|
|
1834
1836
|
animate: n = !0
|
|
1835
1837
|
}) {
|
|
1836
|
-
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o),
|
|
1838
|
+
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m = r === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : r;
|
|
1837
1839
|
return /* @__PURE__ */ e.jsxs(
|
|
1838
1840
|
"div",
|
|
1839
1841
|
{
|
|
@@ -1850,7 +1852,7 @@ function vt({
|
|
|
1850
1852
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
1851
1853
|
"div",
|
|
1852
1854
|
{
|
|
1853
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
1855
|
+
className: `ds-progress__fill ds-progress__fill--${m}`,
|
|
1854
1856
|
style: { width: `${l}%` }
|
|
1855
1857
|
}
|
|
1856
1858
|
) }),
|
|
@@ -1872,11 +1874,11 @@ function gs(s, { duration: t = 600 } = {}) {
|
|
|
1872
1874
|
}
|
|
1873
1875
|
const o = a.current, l = s - o;
|
|
1874
1876
|
if (l === 0) return;
|
|
1875
|
-
let
|
|
1877
|
+
let m = null;
|
|
1876
1878
|
const u = (f) => {
|
|
1877
|
-
|
|
1878
|
-
const
|
|
1879
|
-
i(o + l * ws(
|
|
1879
|
+
m || (m = f);
|
|
1880
|
+
const p = Math.min((f - m) / t, 1);
|
|
1881
|
+
i(o + l * ws(p)), p < 1 ? n.current = requestAnimationFrame(u) : a.current = s;
|
|
1880
1882
|
};
|
|
1881
1883
|
return n.current = requestAnimationFrame(u), () => cancelAnimationFrame(n.current);
|
|
1882
1884
|
}, [s, t]), r;
|
|
@@ -1897,8 +1899,8 @@ function ks({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
|
1897
1899
|
const o = i.current;
|
|
1898
1900
|
if (!o) return;
|
|
1899
1901
|
const l = new IntersectionObserver(
|
|
1900
|
-
([
|
|
1901
|
-
|
|
1902
|
+
([m]) => {
|
|
1903
|
+
m.isIntersecting ? (n(!0), r && l.disconnect()) : r || n(!1);
|
|
1902
1904
|
},
|
|
1903
1905
|
{ threshold: s, rootMargin: t }
|
|
1904
1906
|
);
|
|
@@ -1915,10 +1917,10 @@ function wt({
|
|
|
1915
1917
|
onLeave: o,
|
|
1916
1918
|
...l
|
|
1917
1919
|
}) {
|
|
1918
|
-
const { ref:
|
|
1920
|
+
const { ref: m, inView: u } = ks({ threshold: i, rootMargin: a, once: r }), f = $(!1);
|
|
1919
1921
|
return B(() => {
|
|
1920
1922
|
u && !f.current && (n == null || n()), !u && f.current && (o == null || o()), f.current = u;
|
|
1921
|
-
}, [u]), /* @__PURE__ */ e.jsx(t, { ref:
|
|
1923
|
+
}, [u]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(u) : s });
|
|
1922
1924
|
}
|
|
1923
1925
|
const Be = {
|
|
1924
1926
|
default: ke,
|
|
@@ -2003,10 +2005,10 @@ function kt({
|
|
|
2003
2005
|
expanded: n,
|
|
2004
2006
|
onToggle: o,
|
|
2005
2007
|
padding: l = "s",
|
|
2006
|
-
children:
|
|
2008
|
+
children: m,
|
|
2007
2009
|
...u
|
|
2008
2010
|
}) {
|
|
2009
|
-
const
|
|
2011
|
+
const p = `tc-body-${Ye().replace(/:/g, "")}`, [h, d] = S(a), x = n !== void 0, b = x ? n : h, R = () => {
|
|
2010
2012
|
x ? o == null || o(!n) : d((E) => !E);
|
|
2011
2013
|
};
|
|
2012
2014
|
return /* @__PURE__ */ e.jsxs(ls, { padding: l, ...u, children: [
|
|
@@ -2017,7 +2019,7 @@ function kt({
|
|
|
2017
2019
|
className: "ds-tool-card__header",
|
|
2018
2020
|
onClick: R,
|
|
2019
2021
|
"aria-expanded": b,
|
|
2020
|
-
"aria-controls":
|
|
2022
|
+
"aria-controls": p,
|
|
2021
2023
|
children: [
|
|
2022
2024
|
/* @__PURE__ */ e.jsx(
|
|
2023
2025
|
Oe,
|
|
@@ -2034,7 +2036,7 @@ function kt({
|
|
|
2034
2036
|
]
|
|
2035
2037
|
}
|
|
2036
2038
|
),
|
|
2037
|
-
b && /* @__PURE__ */ e.jsx("div", { id:
|
|
2039
|
+
b && /* @__PURE__ */ e.jsx("div", { id: p, className: "ds-tool-card__body", children: m })
|
|
2038
2040
|
] });
|
|
2039
2041
|
}
|
|
2040
2042
|
function Et({
|
|
@@ -2094,11 +2096,11 @@ function Tt({
|
|
|
2094
2096
|
...l
|
|
2095
2097
|
}) {
|
|
2096
2098
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
|
|
2097
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (
|
|
2098
|
-
const f = u === t,
|
|
2099
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, u) => {
|
|
2100
|
+
const f = u === t, p = r.includes(u) && !f, h = i && (u <= t || r.includes(u)), d = [
|
|
2099
2101
|
"ds-step-indicator__dot",
|
|
2100
2102
|
f && "ds-step-indicator__dot--active",
|
|
2101
|
-
|
|
2103
|
+
p && "ds-step-indicator__dot--done"
|
|
2102
2104
|
].filter(Boolean).join(" ");
|
|
2103
2105
|
return /* @__PURE__ */ e.jsx(
|
|
2104
2106
|
"button",
|
|
@@ -2110,7 +2112,7 @@ function Tt({
|
|
|
2110
2112
|
"aria-label": `Step ${u + 1}`,
|
|
2111
2113
|
disabled: !h || u === t,
|
|
2112
2114
|
onClick: () => i == null ? void 0 : i(u),
|
|
2113
|
-
children:
|
|
2115
|
+
children: p ? /* @__PURE__ */ e.jsx(he, { size: 8, strokeWidth: 3 }) : null
|
|
2114
2116
|
},
|
|
2115
2117
|
u
|
|
2116
2118
|
);
|
|
@@ -2148,17 +2150,17 @@ function St({
|
|
|
2148
2150
|
className: o = "",
|
|
2149
2151
|
...l
|
|
2150
2152
|
}) {
|
|
2151
|
-
const
|
|
2153
|
+
const m = [
|
|
2152
2154
|
"ds-chat-message",
|
|
2153
2155
|
`ds-chat-message--${s}`,
|
|
2154
2156
|
a && "ds-chat-message--streaming",
|
|
2155
2157
|
o
|
|
2156
2158
|
].filter(Boolean).join(" ");
|
|
2157
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2159
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: n }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2158
2160
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2159
2161
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: n }),
|
|
2160
2162
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2161
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2163
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2162
2164
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2163
2165
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2164
2166
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: n }),
|
|
@@ -2189,12 +2191,12 @@ function Ss({
|
|
|
2189
2191
|
betweenTime: n = 380,
|
|
2190
2192
|
manualPauseMs: o = 5e3
|
|
2191
2193
|
}) {
|
|
2192
|
-
const [l,
|
|
2194
|
+
const [l, m] = S(0), [u, f] = S(""), p = $("typing"), h = $(0), d = $(0), x = $(null), b = $(0);
|
|
2193
2195
|
B(() => {
|
|
2194
2196
|
d.current = l;
|
|
2195
2197
|
}, [l]), B(() => {
|
|
2196
2198
|
if (x.current && (clearTimeout(x.current), x.current = null), !t || s.length === 0) {
|
|
2197
|
-
f(""), h.current = 0,
|
|
2199
|
+
f(""), h.current = 0, p.current = "typing";
|
|
2198
2200
|
return;
|
|
2199
2201
|
}
|
|
2200
2202
|
const k = () => {
|
|
@@ -2204,7 +2206,7 @@ function Ss({
|
|
|
2204
2206
|
return;
|
|
2205
2207
|
}
|
|
2206
2208
|
const D = s[d.current % s.length] ?? "";
|
|
2207
|
-
|
|
2209
|
+
p.current === "typing" ? (h.current += 1, f(D.slice(0, h.current)), h.current >= D.length ? (p.current = "holding", x.current = setTimeout(k, a)) : x.current = setTimeout(k, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(k, i)) : (h.current = Math.max(0, h.current - 1), f(D.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", d.current = (d.current + 1) % s.length, m(d.current), x.current = setTimeout(k, n)) : x.current = setTimeout(k, i));
|
|
2208
2210
|
};
|
|
2209
2211
|
return x.current = setTimeout(k, 260), () => {
|
|
2210
2212
|
x.current && clearTimeout(x.current);
|
|
@@ -2213,7 +2215,7 @@ function Ss({
|
|
|
2213
2215
|
const R = (k) => {
|
|
2214
2216
|
if (s.length === 0) return;
|
|
2215
2217
|
const O = (k % s.length + s.length) % s.length, D = s[O];
|
|
2216
|
-
d.current = O, h.current = D.length,
|
|
2218
|
+
d.current = O, h.current = D.length, p.current = "holding", b.current = Date.now() + o, m(O), f(D);
|
|
2217
2219
|
}, E = () => R(d.current + 1), g = () => R(d.current - 1), A = s[l % s.length] ?? "";
|
|
2218
2220
|
return { displayed: u, currentPrompt: A, index: l, next: E, prev: g };
|
|
2219
2221
|
}
|
|
@@ -2227,10 +2229,10 @@ function It({
|
|
|
2227
2229
|
loading: n = !1,
|
|
2228
2230
|
disabled: o = !1,
|
|
2229
2231
|
placeholder: l = "Let's get things done...",
|
|
2230
|
-
animatedPlaceholders:
|
|
2232
|
+
animatedPlaceholders: m,
|
|
2231
2233
|
attachments: u,
|
|
2232
2234
|
images: f,
|
|
2233
|
-
onAttachFiles:
|
|
2235
|
+
onAttachFiles: p,
|
|
2234
2236
|
onAttachImages: h,
|
|
2235
2237
|
onRemoveAttachment: d,
|
|
2236
2238
|
onRemoveImage: x,
|
|
@@ -2256,7 +2258,7 @@ function It({
|
|
|
2256
2258
|
const { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee } = w(j);
|
|
2257
2259
|
G.length && _(`File${G.length > 1 ? "s" : ""} too large${g ? ` (max ${g / 1024 / 1024}MB)` : ""}: ${G.join(", ")}`), J.length && _(`Skipped unsupported file${J.length > 1 ? "s" : ""}: ${J.join(", ")}`), ee && _(`Max ${E} images per message`), h && T.length && h(T);
|
|
2258
2260
|
const oe = V.concat(h ? [] : T);
|
|
2259
|
-
|
|
2261
|
+
p && oe.length && p(oe);
|
|
2260
2262
|
};
|
|
2261
2263
|
B(() => {
|
|
2262
2264
|
const j = M.current;
|
|
@@ -2294,8 +2296,8 @@ function It({
|
|
|
2294
2296
|
if (V.length === 0) return;
|
|
2295
2297
|
const { imageFiles: G, tooLarge: J, skipped: ee, limitExceeded: oe } = w(V);
|
|
2296
2298
|
J.length && _(`File${J.length > 1 ? "s" : ""} too large: ${J.join(", ")}`), ee.length && _(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), oe && _(`Max ${E} images per message`), G.length && (j.preventDefault(), h(G));
|
|
2297
|
-
}, Q = !n && !o && !!(
|
|
2298
|
-
prompts:
|
|
2299
|
+
}, Q = !n && !o && !!(m != null && m.length) && s.length === 0, ie = Ss({
|
|
2300
|
+
prompts: m ?? [],
|
|
2299
2301
|
enabled: Q
|
|
2300
2302
|
}), _e = (j) => {
|
|
2301
2303
|
if (Q) {
|
|
@@ -2313,7 +2315,7 @@ function It({
|
|
|
2313
2315
|
}
|
|
2314
2316
|
}
|
|
2315
2317
|
a == null || a(j);
|
|
2316
|
-
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (u == null ? void 0 : u.length) > 0) && !o, Ee =
|
|
2318
|
+
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (u == null ? void 0 : u.length) > 0) && !o, Ee = p || h;
|
|
2317
2319
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...D, children: [
|
|
2318
2320
|
Ee && /* @__PURE__ */ e.jsx(
|
|
2319
2321
|
"input",
|
|
@@ -2446,13 +2448,13 @@ function Dt({
|
|
|
2446
2448
|
showAutoOption: n = !1,
|
|
2447
2449
|
groupByTier: o = !0,
|
|
2448
2450
|
className: l = "",
|
|
2449
|
-
...
|
|
2451
|
+
...m
|
|
2450
2452
|
}) {
|
|
2451
|
-
const [u, f] = S(!1),
|
|
2453
|
+
const [u, f] = S(!1), p = $(null), h = $(null), [d, x] = S({}), b = s.filter((v) => !a || v.name === "auto" ? !0 : (Pe[v.tier] ?? 1) >= (Pe[a] ?? 1)), R = b.find((v) => v.name === "auto"), E = b.filter((v) => v.name !== "auto"), g = s.find((v) => v.name === t);
|
|
2452
2454
|
B(() => {
|
|
2453
2455
|
var Y;
|
|
2454
2456
|
if (!u) return;
|
|
2455
|
-
const v = (Y =
|
|
2457
|
+
const v = (Y = p.current) == null ? void 0 : Y.getBoundingClientRect();
|
|
2456
2458
|
v && x({
|
|
2457
2459
|
position: "fixed",
|
|
2458
2460
|
zIndex: "var(--z-dropdown, 500)",
|
|
@@ -2461,7 +2463,7 @@ function Dt({
|
|
|
2461
2463
|
});
|
|
2462
2464
|
const M = (H) => {
|
|
2463
2465
|
var X, U;
|
|
2464
|
-
!((X =
|
|
2466
|
+
!((X = p.current) != null && X.contains(H.target)) && !((U = h.current) != null && U.contains(H.target)) && f(!1);
|
|
2465
2467
|
}, z = (H) => {
|
|
2466
2468
|
H.key === "Escape" && f(!1);
|
|
2467
2469
|
};
|
|
@@ -2518,9 +2520,9 @@ function Dt({
|
|
|
2518
2520
|
return /* @__PURE__ */ e.jsxs(
|
|
2519
2521
|
"div",
|
|
2520
2522
|
{
|
|
2521
|
-
ref:
|
|
2523
|
+
ref: p,
|
|
2522
2524
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2523
|
-
...
|
|
2525
|
+
...m,
|
|
2524
2526
|
children: [
|
|
2525
2527
|
/* @__PURE__ */ e.jsxs(
|
|
2526
2528
|
"button",
|
|
@@ -2558,8 +2560,8 @@ function Bt({
|
|
|
2558
2560
|
maxVisible: i = 5,
|
|
2559
2561
|
onSourceClick: a
|
|
2560
2562
|
}) {
|
|
2561
|
-
const [n, o] = S(!1), l = Is(s),
|
|
2562
|
-
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className:
|
|
2563
|
+
const [n, o] = S(!1), l = Is(s), m = l.length > i, u = n ? l : l.slice(0, i), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2564
|
+
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2563
2565
|
u.map((h) => {
|
|
2564
2566
|
const d = h.items.map((b) => b.page).filter(Boolean), x = !!a;
|
|
2565
2567
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -2576,12 +2578,12 @@ function Bt({
|
|
|
2576
2578
|
h.filename
|
|
2577
2579
|
);
|
|
2578
2580
|
}),
|
|
2579
|
-
|
|
2581
|
+
m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2580
2582
|
"+",
|
|
2581
2583
|
l.length - i,
|
|
2582
2584
|
" more sources"
|
|
2583
2585
|
] })
|
|
2584
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2586
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2585
2587
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
|
|
2586
2588
|
u.map((h) => {
|
|
2587
2589
|
const d = h.items.map((b) => b.page).filter(Boolean), x = !!a;
|
|
@@ -2617,7 +2619,7 @@ function Bt({
|
|
|
2617
2619
|
h.filename
|
|
2618
2620
|
);
|
|
2619
2621
|
}),
|
|
2620
|
-
|
|
2622
|
+
m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2621
2623
|
"+",
|
|
2622
2624
|
l.length - i,
|
|
2623
2625
|
" more sources"
|
|
@@ -2636,7 +2638,7 @@ function Pt({
|
|
|
2636
2638
|
warningThreshold: n = 0.8,
|
|
2637
2639
|
errorThreshold: o = 1
|
|
2638
2640
|
}) {
|
|
2639
|
-
const l = t > 0 ? s / t : 0,
|
|
2641
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), u = l >= o ? "error" : l >= n ? "warning" : "normal";
|
|
2640
2642
|
return /* @__PURE__ */ e.jsxs(
|
|
2641
2643
|
"div",
|
|
2642
2644
|
{
|
|
@@ -2649,7 +2651,7 @@ function Pt({
|
|
|
2649
2651
|
"div",
|
|
2650
2652
|
{
|
|
2651
2653
|
className: `ds-token-counter__fill ds-token-counter__fill--${u}`,
|
|
2652
|
-
style: { width: `${
|
|
2654
|
+
style: { width: `${m}%` }
|
|
2653
2655
|
}
|
|
2654
2656
|
) }),
|
|
2655
2657
|
(i || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${u}`, children: [
|
|
@@ -2685,12 +2687,12 @@ function Mt({
|
|
|
2685
2687
|
`ds-confidence-bar--${o}`,
|
|
2686
2688
|
i === "block" && "ds-confidence-bar--block"
|
|
2687
2689
|
].filter(Boolean).join(" "), children: [
|
|
2688
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Le }, (l,
|
|
2690
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Le }, (l, m) => /* @__PURE__ */ e.jsx(
|
|
2689
2691
|
"div",
|
|
2690
2692
|
{
|
|
2691
|
-
className: `ds-confidence-bar__seg${
|
|
2693
|
+
className: `ds-confidence-bar__seg${m < n ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2692
2694
|
},
|
|
2693
|
-
|
|
2695
|
+
m
|
|
2694
2696
|
)) }),
|
|
2695
2697
|
r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
|
|
2696
2698
|
] });
|
|
@@ -2717,18 +2719,18 @@ function Lt({
|
|
|
2717
2719
|
r && "ds-diff-view--wrap"
|
|
2718
2720
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2719
2721
|
if (t === "split") {
|
|
2720
|
-
const
|
|
2722
|
+
const m = s.filter((f) => f.type === "remove" || f.type === "context"), u = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2721
2723
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2722
2724
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2723
2725
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2724
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children:
|
|
2725
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: u.map((f,
|
|
2726
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, p)) }),
|
|
2727
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: u.map((f, p) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, p)) })
|
|
2726
2728
|
] })
|
|
2727
2729
|
] });
|
|
2728
2730
|
}
|
|
2729
2731
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2730
2732
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2731
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((
|
|
2733
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, u) => /* @__PURE__ */ e.jsx(be, { line: m, lineNumbers: i }, u)) })
|
|
2732
2734
|
] });
|
|
2733
2735
|
}
|
|
2734
2736
|
export {
|