@donkit-ai/design-system 1.3.13 → 1.3.15
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 +4 -4
- package/dist/index.es.js +218 -218
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import q, { useState as S, useRef as $, useEffect as B, useLayoutEffect as
|
|
2
|
-
import { Check as he, X as ne, ChevronDown as xe, Minus as
|
|
1
|
+
import q, { useState as S, useRef as $, useEffect as B, useLayoutEffect as ze, useId as We } from "react";
|
|
2
|
+
import { Check as he, X as ne, ChevronDown as xe, Minus as Fe, Plus as Ce, XCircle as ve, AlertTriangle as Ne, CheckCircle as we, Info as ye, ChevronUp as Ue, ChevronsUpDown as Ve, ChevronLeft as Ye, ChevronRight as Be, Copy as qe, Brain as He, Loader as Ke, Paperclip as Ee, Square as Ge, ArrowUp as Xe, Zap as Je, Cpu as $e } from "lucide-react";
|
|
3
3
|
import me from "react-dom";
|
|
4
4
|
const D = {
|
|
5
5
|
1: 16,
|
|
@@ -8,7 +8,7 @@ const D = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var je = { exports: {} }, de = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -19,7 +19,7 @@ var _e = { exports: {} }, de = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var Te;
|
|
22
|
-
function
|
|
22
|
+
function Ze() {
|
|
23
23
|
if (Te) return de;
|
|
24
24
|
Te = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
@@ -51,7 +51,7 @@ var ue = {};
|
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
53
|
var Re;
|
|
54
|
-
function
|
|
54
|
+
function Qe() {
|
|
55
55
|
return Re || (Re = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function s(c) {
|
|
57
57
|
if (c == null) return null;
|
|
@@ -159,7 +159,7 @@ function Ze() {
|
|
|
159
159
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
160
160
|
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
161
161
|
}
|
|
162
|
-
function u(c, N, P, W,
|
|
162
|
+
function u(c, N, P, W, se, ae) {
|
|
163
163
|
var F = P.ref;
|
|
164
164
|
return c = {
|
|
165
165
|
$$typeof: b,
|
|
@@ -184,7 +184,7 @@ function Ze() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: se
|
|
188
188
|
}), Object.defineProperty(c, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
@@ -192,7 +192,7 @@ function Ze() {
|
|
|
192
192
|
value: ae
|
|
193
193
|
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
194
194
|
}
|
|
195
|
-
function m(c, N, P, W,
|
|
195
|
+
function m(c, N, P, W, se, ae) {
|
|
196
196
|
var F = N.children;
|
|
197
197
|
if (F !== void 0)
|
|
198
198
|
if (W)
|
|
@@ -236,7 +236,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
236
|
F,
|
|
237
237
|
P,
|
|
238
238
|
a(),
|
|
239
|
-
|
|
239
|
+
se,
|
|
240
240
|
ae
|
|
241
241
|
);
|
|
242
242
|
}
|
|
@@ -281,9 +281,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
281
281
|
};
|
|
282
282
|
}()), ue;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
286
|
-
function
|
|
284
|
+
process.env.NODE_ENV === "production" ? je.exports = Ze() : je.exports = Qe();
|
|
285
|
+
var e = je.exports;
|
|
286
|
+
function et({ size: s = "m", color: t = "default", className: r = "", ...o }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
@@ -294,7 +294,7 @@ function Qe({ size: s = "m", color: t = "default", className: r = "", ...o }) {
|
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
const
|
|
297
|
+
const tt = { xs: 12, s: 14, m: 16, l: 20 };
|
|
298
298
|
function fe({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
@@ -309,7 +309,7 @@ function fe({
|
|
|
309
309
|
"aria-label": m,
|
|
310
310
|
...f
|
|
311
311
|
}) {
|
|
312
|
-
const h = a && !s, d = i === "loading", b = i === "success", _ = i === "error", R = d || b || _, E = r === "xs" ? "s" : "m", g =
|
|
312
|
+
const h = a && !s, d = i === "loading", b = i === "success", _ = i === "error", R = d || b || _, E = r === "xs" ? "s" : "m", g = tt[r] ?? 16, A = d ? /* @__PURE__ */ e.jsx(et, { size: E }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(he, { size: g, strokeWidth: 2.5 }) }) : _ ? /* @__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",
|
|
314
314
|
`ds-button--${t}`,
|
|
315
315
|
`ds-button--${r}`,
|
|
@@ -357,7 +357,7 @@ function fe({
|
|
|
357
357
|
}
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function St({
|
|
361
361
|
label: s,
|
|
362
362
|
error: t,
|
|
363
363
|
hint: r,
|
|
@@ -402,7 +402,7 @@ function Rt({
|
|
|
402
402
|
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: d, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
403
403
|
] });
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function At({
|
|
406
406
|
label: s,
|
|
407
407
|
error: t,
|
|
408
408
|
hint: r,
|
|
@@ -433,7 +433,7 @@ function St({
|
|
|
433
433
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
434
434
|
] });
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function It({
|
|
437
437
|
label: s,
|
|
438
438
|
value: t,
|
|
439
439
|
onChange: r,
|
|
@@ -461,9 +461,9 @@ function At({
|
|
|
461
461
|
var ae;
|
|
462
462
|
const w = (ae = M.current) == null ? void 0 : ae.getBoundingClientRect();
|
|
463
463
|
if (!w) return;
|
|
464
|
-
const c = window.innerHeight, N = c - w.bottom, P = w.top,
|
|
465
|
-
g(
|
|
466
|
-
|
|
464
|
+
const c = window.innerHeight, N = c - w.bottom, P = w.top, se = N < 300 && P > N;
|
|
465
|
+
g(se ? "up" : "down"), R(
|
|
466
|
+
se ? { bottom: c - w.top + 4, left: w.left, width: w.width } : { top: w.bottom + 4, left: w.left, width: w.width }
|
|
467
467
|
);
|
|
468
468
|
};
|
|
469
469
|
B(() => {
|
|
@@ -583,7 +583,7 @@ function At({
|
|
|
583
583
|
typeof document < "u" && me.createPortal(Z, document.body)
|
|
584
584
|
] });
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function Dt({
|
|
587
587
|
label: s,
|
|
588
588
|
value: t = 0,
|
|
589
589
|
onChange: r,
|
|
@@ -636,7 +636,7 @@ function It({
|
|
|
636
636
|
onClick: h,
|
|
637
637
|
disabled: l || t <= o,
|
|
638
638
|
"aria-label": "Decrease",
|
|
639
|
-
children: /* @__PURE__ */ e.jsx(
|
|
639
|
+
children: /* @__PURE__ */ e.jsx(Fe, { size: R, strokeWidth: 1.5 })
|
|
640
640
|
}
|
|
641
641
|
),
|
|
642
642
|
/* @__PURE__ */ e.jsx(
|
|
@@ -661,7 +661,7 @@ function It({
|
|
|
661
661
|
onClick: f,
|
|
662
662
|
disabled: l || t >= a,
|
|
663
663
|
"aria-label": "Increase",
|
|
664
|
-
children: /* @__PURE__ */ e.jsx(
|
|
664
|
+
children: /* @__PURE__ */ e.jsx(Ce, { size: R, strokeWidth: 1.5 })
|
|
665
665
|
}
|
|
666
666
|
)
|
|
667
667
|
] }),
|
|
@@ -669,7 +669,7 @@ function It({
|
|
|
669
669
|
u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: u })
|
|
670
670
|
] });
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function st({
|
|
673
673
|
children: s,
|
|
674
674
|
padding: t = "m",
|
|
675
675
|
variant: r = "info",
|
|
@@ -721,22 +721,22 @@ function tt({
|
|
|
721
721
|
}
|
|
722
722
|
);
|
|
723
723
|
}
|
|
724
|
-
function
|
|
724
|
+
function Bt({ children: s, ...t }) {
|
|
725
725
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...t, children: s });
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Pt({ children: s, ...t }) {
|
|
728
728
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...t, children: s });
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function Lt({ children: s, ...t }) {
|
|
731
731
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...t, children: s });
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Ot({ children: s, ...t }) {
|
|
734
734
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function Mt({ children: s, secondary: t = !1, ...r }) {
|
|
737
737
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...r, children: s });
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function rt({ children: s, secondary: t = !1, ...r }) {
|
|
740
740
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...r, children: s });
|
|
741
741
|
}
|
|
742
742
|
function Pe({ children: s, secondary: t = !1, ...r }) {
|
|
@@ -756,13 +756,13 @@ function pe({
|
|
|
756
756
|
].filter(Boolean).join(" "), i = o || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
757
757
|
return /* @__PURE__ */ e.jsx("span", { className: n, role: i, ...a, children: s });
|
|
758
758
|
}
|
|
759
|
-
const
|
|
760
|
-
info:
|
|
761
|
-
success:
|
|
762
|
-
warning:
|
|
763
|
-
error:
|
|
759
|
+
const nt = {
|
|
760
|
+
info: ye,
|
|
761
|
+
success: we,
|
|
762
|
+
warning: Ne,
|
|
763
|
+
error: ve
|
|
764
764
|
};
|
|
765
|
-
function
|
|
765
|
+
function zt({
|
|
766
766
|
children: s,
|
|
767
767
|
variant: t = "info",
|
|
768
768
|
title: r,
|
|
@@ -770,7 +770,7 @@ function Mt({
|
|
|
770
770
|
role: a,
|
|
771
771
|
...n
|
|
772
772
|
}) {
|
|
773
|
-
const i =
|
|
773
|
+
const i = nt[t], l = a || (t === "error" ? "alert" : "status");
|
|
774
774
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${r ? "" : "ds-alert--no-title"}`, role: l, ...n, children: [
|
|
775
775
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(i, { size: D[3], strokeWidth: 1.5 }) }),
|
|
776
776
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
@@ -789,8 +789,8 @@ function Mt({
|
|
|
789
789
|
)
|
|
790
790
|
] });
|
|
791
791
|
}
|
|
792
|
-
const
|
|
793
|
-
function
|
|
792
|
+
const at = 200;
|
|
793
|
+
function Wt({
|
|
794
794
|
children: s,
|
|
795
795
|
title: t,
|
|
796
796
|
onClose: r,
|
|
@@ -800,7 +800,7 @@ function zt({
|
|
|
800
800
|
const n = $(null), i = q.useId(), [l, p] = S(!1), u = () => {
|
|
801
801
|
!r || l || (p(!0), setTimeout(() => {
|
|
802
802
|
p(!1), r();
|
|
803
|
-
},
|
|
803
|
+
}, at));
|
|
804
804
|
};
|
|
805
805
|
B(() => {
|
|
806
806
|
const d = (_) => {
|
|
@@ -844,7 +844,7 @@ function zt({
|
|
|
844
844
|
function Se({ children: s }) {
|
|
845
845
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: s });
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function ot({
|
|
848
848
|
children: s,
|
|
849
849
|
title: t = "Code",
|
|
850
850
|
defaultExpanded: r = !1,
|
|
@@ -886,10 +886,10 @@ function at({
|
|
|
886
886
|
/* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__inner", children: /* @__PURE__ */ e.jsx("pre", { className: "ds-code-accordion__pre", children: /* @__PURE__ */ e.jsx("code", { children: s }) }) }) })
|
|
887
887
|
] });
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
return t ? r ? /* @__PURE__ */ e.jsx(
|
|
889
|
+
function Ft({ children: s, block: t = !1, collapsible: r = !1, title: o = "Code", defaultExpanded: a = !1, ...n }) {
|
|
890
|
+
return t ? r ? /* @__PURE__ */ e.jsx(ot, { title: o, defaultExpanded: a, ...n, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block", ...n, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...n, children: s });
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function Ct({ href: s, children: t, onClick: r, target: o, rel: a, ...n }) {
|
|
893
893
|
const l = o === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
894
894
|
return /* @__PURE__ */ e.jsx(
|
|
895
895
|
"a",
|
|
@@ -904,10 +904,10 @@ function Ft({ href: s, children: t, onClick: r, target: o, rel: a, ...n }) {
|
|
|
904
904
|
}
|
|
905
905
|
);
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function Ut({ children: s, size: t = "m", variant: r = "ghost", ...o }) {
|
|
908
908
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...o, children: q.Children.map(s, (a) => q.isValidElement(a) ? q.cloneElement(a, { size: t, variant: r }) : a) });
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function Vt({ children: s, selected: t = !1, onClick: r, size: o = "m", variant: a = "ghost", disabled: n = !1, icon: i, href: l, ...p }) {
|
|
911
911
|
const u = i && !s, m = [
|
|
912
912
|
"ds-tab",
|
|
913
913
|
`ds-tab--${o}`,
|
|
@@ -953,7 +953,7 @@ function Ut({ children: s, selected: t = !1, onClick: r, size: o = "m", variant:
|
|
|
953
953
|
}
|
|
954
954
|
);
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Yt({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1 }) {
|
|
957
957
|
const n = $(null), i = $(null), [l, p] = S(!1), u = $(!1), m = $(null), f = $(null), h = () => {
|
|
958
958
|
if (!n.current) return;
|
|
959
959
|
const d = n.current.querySelector(`[data-value="${t}"]`);
|
|
@@ -967,7 +967,7 @@ function Vt({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1
|
|
|
967
967
|
i.current.style.transition = "none", i.current.style.left = k.left - A.left + "px", i.current.style.width = k.width + "px";
|
|
968
968
|
}));
|
|
969
969
|
};
|
|
970
|
-
return f.current = h,
|
|
970
|
+
return f.current = h, ze(() => {
|
|
971
971
|
const d = m.current !== t;
|
|
972
972
|
m.current = t, u.current = l && d, h();
|
|
973
973
|
}), B(() => {
|
|
@@ -1015,7 +1015,7 @@ function Vt({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1
|
|
|
1015
1015
|
}
|
|
1016
1016
|
);
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function it({
|
|
1019
1019
|
children: s,
|
|
1020
1020
|
title: t,
|
|
1021
1021
|
defaultExpanded: r = !1,
|
|
@@ -1056,7 +1056,7 @@ function ot({
|
|
|
1056
1056
|
] });
|
|
1057
1057
|
}
|
|
1058
1058
|
const re = 8, le = 8;
|
|
1059
|
-
function
|
|
1059
|
+
function lt(s, t, r) {
|
|
1060
1060
|
const o = window.innerWidth;
|
|
1061
1061
|
let a, n;
|
|
1062
1062
|
switch (s) {
|
|
@@ -1078,7 +1078,7 @@ function it(s, t, r) {
|
|
|
1078
1078
|
const i = Math.max(le, Math.min(o - r.width - le, n)), l = n - i;
|
|
1079
1079
|
return { top: a, left: i, arrowOffset: l };
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function ct(s, t, r) {
|
|
1082
1082
|
const o = window.innerWidth, a = window.innerHeight;
|
|
1083
1083
|
if (s.top >= t + re + le) return "top";
|
|
1084
1084
|
if (a - s.bottom >= t + re + le) return "bottom";
|
|
@@ -1087,10 +1087,10 @@ function lt(s, t, r) {
|
|
|
1087
1087
|
const n = Math.max(s.top, a - s.bottom, s.left, o - s.right);
|
|
1088
1088
|
return n === s.top ? "top" : n === a - s.bottom ? "bottom" : n === o - s.right ? "right" : "left";
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function qt({ children: s, content: t, position: r, ...o }) {
|
|
1091
1091
|
const [a, n] = S(!1), [i, l] = S({ visibility: "hidden" }), [p, u] = S(r || "top"), m = $(null), f = $(null), h = $(!1), d = () => {
|
|
1092
1092
|
if (!m.current || !f.current) return;
|
|
1093
|
-
const _ = m.current.getBoundingClientRect(), R = f.current.getBoundingClientRect(), E = r ||
|
|
1093
|
+
const _ = m.current.getBoundingClientRect(), R = f.current.getBoundingClientRect(), E = r || ct(_, R.height, R.width), { top: g, left: A, arrowOffset: k } = lt(E, _, R);
|
|
1094
1094
|
u(E), l({
|
|
1095
1095
|
position: "fixed",
|
|
1096
1096
|
top: g,
|
|
@@ -1145,7 +1145,7 @@ function Yt({ children: s, content: t, position: r, ...o }) {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
);
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Ht({
|
|
1149
1149
|
checked: s = !1,
|
|
1150
1150
|
onChange: t,
|
|
1151
1151
|
size: r = "m",
|
|
@@ -1176,7 +1176,7 @@ function qt({
|
|
|
1176
1176
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
|
|
1177
1177
|
] });
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function Kt({
|
|
1180
1180
|
checked: s = !1,
|
|
1181
1181
|
onChange: t,
|
|
1182
1182
|
size: r = "m",
|
|
@@ -1214,7 +1214,7 @@ function Ht({
|
|
|
1214
1214
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
|
|
1215
1215
|
] });
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function Gt({
|
|
1218
1218
|
checked: s = !1,
|
|
1219
1219
|
onChange: t,
|
|
1220
1220
|
size: r = "m",
|
|
@@ -1249,7 +1249,7 @@ function Kt({
|
|
|
1249
1249
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1250
1250
|
] });
|
|
1251
1251
|
}
|
|
1252
|
-
function
|
|
1252
|
+
function dt({ width: s, height: t, shape: r = "rect", aspectRatio: o, className: a = "", style: n = {}, ...i }) {
|
|
1253
1253
|
return /* @__PURE__ */ e.jsx(
|
|
1254
1254
|
"span",
|
|
1255
1255
|
{
|
|
@@ -1260,7 +1260,7 @@ function ct({ width: s, height: t, shape: r = "rect", aspectRatio: o, className:
|
|
|
1260
1260
|
}
|
|
1261
1261
|
);
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1263
|
+
function ut({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: o = "", style: a = {}, ...n }) {
|
|
1264
1264
|
return /* @__PURE__ */ e.jsx(
|
|
1265
1265
|
"span",
|
|
1266
1266
|
{
|
|
@@ -1279,20 +1279,20 @@ function dt({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: o = "",
|
|
|
1279
1279
|
}
|
|
1280
1280
|
);
|
|
1281
1281
|
}
|
|
1282
|
-
|
|
1283
|
-
function
|
|
1282
|
+
dt.Text = ut;
|
|
1283
|
+
function ft(s) {
|
|
1284
1284
|
let t = 2166136261;
|
|
1285
1285
|
for (let r = 0; r < s.length; r++)
|
|
1286
1286
|
t ^= s.charCodeAt(r), t = Math.imul(t, 16777619) >>> 0;
|
|
1287
1287
|
return t % 360;
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function mt(s) {
|
|
1290
1290
|
if (!s) return "";
|
|
1291
1291
|
const t = s.trim().split(/\s+/);
|
|
1292
1292
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1295
|
-
const l =
|
|
1294
|
+
function Xt({ seed: s, icon: t, src: r, size: o = 32, className: a = "", style: n = {}, ...i }) {
|
|
1295
|
+
const l = ft(s ?? ""), [p, u] = S(!1), m = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: mt(s) });
|
|
1296
1296
|
return /* @__PURE__ */ e.jsx(
|
|
1297
1297
|
"div",
|
|
1298
1298
|
{
|
|
@@ -1304,7 +1304,7 @@ function Gt({ seed: s, icon: t, src: r, size: o = 32, className: a = "", style:
|
|
|
1304
1304
|
}
|
|
1305
1305
|
);
|
|
1306
1306
|
}
|
|
1307
|
-
function
|
|
1307
|
+
function Jt({
|
|
1308
1308
|
children: s,
|
|
1309
1309
|
size: t = "compact",
|
|
1310
1310
|
stickyTop: r,
|
|
@@ -1334,13 +1334,13 @@ function Xt({
|
|
|
1334
1334
|
}
|
|
1335
1335
|
);
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function Zt({ children: s, ...t }) {
|
|
1338
1338
|
return /* @__PURE__ */ e.jsx("thead", { ...t, children: s });
|
|
1339
1339
|
}
|
|
1340
|
-
function
|
|
1340
|
+
function Qt({ children: s, ...t }) {
|
|
1341
1341
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function es({ children: s, interactive: t, selected: r, subheader: o, className: a = "", onClick: n, ...i }) {
|
|
1344
1344
|
return /* @__PURE__ */ e.jsx(
|
|
1345
1345
|
"tr",
|
|
1346
1346
|
{
|
|
@@ -1357,11 +1357,11 @@ function Qt({ children: s, interactive: t, selected: r, subheader: o, className:
|
|
|
1357
1357
|
}
|
|
1358
1358
|
);
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function ts({ children: s, colSpan: t = 999, ...r }) {
|
|
1361
1361
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1364
|
-
const p = !!o || r !== void 0, u = r === "asc" ?
|
|
1363
|
+
function ss({ children: s, align: t = "left", sortDir: r, onSort: o, width: a, className: n = "", style: i = {}, ...l }) {
|
|
1364
|
+
const p = !!o || r !== void 0, u = r === "asc" ? Ue : r === "desc" ? xe : Ve;
|
|
1365
1365
|
return /* @__PURE__ */ e.jsx(
|
|
1366
1366
|
"th",
|
|
1367
1367
|
{
|
|
@@ -1382,7 +1382,7 @@ function ts({ children: s, align: t = "left", sortDir: r, onSort: o, width: a, c
|
|
|
1382
1382
|
}
|
|
1383
1383
|
);
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function rs({ children: s, align: t = "left", secondary: r, muted: o, truncate: a, nowrap: n, className: i = "", ...l }) {
|
|
1386
1386
|
return /* @__PURE__ */ e.jsx(
|
|
1387
1387
|
"td",
|
|
1388
1388
|
{
|
|
@@ -1400,7 +1400,7 @@ function ss({ children: s, align: t = "left", secondary: r, muted: o, truncate:
|
|
|
1400
1400
|
}
|
|
1401
1401
|
);
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function ns({
|
|
1404
1404
|
icon: s,
|
|
1405
1405
|
title: t,
|
|
1406
1406
|
description: r,
|
|
@@ -1423,7 +1423,7 @@ function rs({
|
|
|
1423
1423
|
}
|
|
1424
1424
|
);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function as({
|
|
1427
1427
|
label: s,
|
|
1428
1428
|
hint: t,
|
|
1429
1429
|
error: r,
|
|
@@ -1454,7 +1454,7 @@ function ns({
|
|
|
1454
1454
|
}
|
|
1455
1455
|
);
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1457
|
+
function os({ label: s, value: t, delta: r, size: o = "m", inline: a = !1, className: n = "", style: i, ...l }) {
|
|
1458
1458
|
const p = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
|
|
1459
1459
|
return /* @__PURE__ */ e.jsxs(
|
|
1460
1460
|
"div",
|
|
@@ -1475,7 +1475,7 @@ function as({ label: s, value: t, delta: r, size: o = "m", inline: a = !1, class
|
|
|
1475
1475
|
}
|
|
1476
1476
|
);
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function is({
|
|
1479
1479
|
children: s,
|
|
1480
1480
|
separator: t = "/",
|
|
1481
1481
|
"aria-label": r = "Breadcrumb",
|
|
@@ -1498,7 +1498,7 @@ function os({
|
|
|
1498
1498
|
}
|
|
1499
1499
|
);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function ls({
|
|
1502
1502
|
page: s,
|
|
1503
1503
|
total: t,
|
|
1504
1504
|
onChange: r,
|
|
@@ -1508,7 +1508,7 @@ function is({
|
|
|
1508
1508
|
style: i,
|
|
1509
1509
|
...l
|
|
1510
1510
|
}) {
|
|
1511
|
-
const p =
|
|
1511
|
+
const p = pt(s, t, o);
|
|
1512
1512
|
return /* @__PURE__ */ e.jsxs(
|
|
1513
1513
|
"nav",
|
|
1514
1514
|
{
|
|
@@ -1524,7 +1524,7 @@ function is({
|
|
|
1524
1524
|
onClick: () => r == null ? void 0 : r(s - 1),
|
|
1525
1525
|
disabled: s <= 1,
|
|
1526
1526
|
"aria-label": "Previous page",
|
|
1527
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1527
|
+
children: /* @__PURE__ */ e.jsx(Ye, { size: 16 })
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
1530
1530
|
p.map(
|
|
@@ -1554,15 +1554,15 @@ function is({
|
|
|
1554
1554
|
}
|
|
1555
1555
|
);
|
|
1556
1556
|
}
|
|
1557
|
-
function
|
|
1557
|
+
function pt(s, t, r) {
|
|
1558
1558
|
if (t <= 7) return Array.from({ length: t }, (i, l) => l + 1);
|
|
1559
1559
|
const o = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
|
|
1560
1560
|
o > 2 && n.push("…");
|
|
1561
1561
|
for (let i = o; i <= a; i++) n.push(i);
|
|
1562
1562
|
return a < t - 1 && n.push("…"), n.push(t), n;
|
|
1563
1563
|
}
|
|
1564
|
-
const
|
|
1565
|
-
function
|
|
1564
|
+
const ht = 200;
|
|
1565
|
+
function cs({
|
|
1566
1566
|
children: s,
|
|
1567
1567
|
title: t,
|
|
1568
1568
|
onClose: r,
|
|
@@ -1572,7 +1572,7 @@ function ls({
|
|
|
1572
1572
|
const n = $(null), i = q.useId(), [l, p] = S(!1), u = () => {
|
|
1573
1573
|
!r || l || (p(!0), setTimeout(() => {
|
|
1574
1574
|
p(!1), r();
|
|
1575
|
-
},
|
|
1575
|
+
}, ht));
|
|
1576
1576
|
};
|
|
1577
1577
|
B(() => {
|
|
1578
1578
|
const d = (_) => {
|
|
@@ -1615,13 +1615,13 @@ function ls({
|
|
|
1615
1615
|
function Ae({ children: s }) {
|
|
1616
1616
|
return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: s });
|
|
1617
1617
|
}
|
|
1618
|
-
const
|
|
1619
|
-
info:
|
|
1620
|
-
success:
|
|
1621
|
-
warning:
|
|
1622
|
-
error:
|
|
1618
|
+
const xt = {
|
|
1619
|
+
info: ye,
|
|
1620
|
+
success: we,
|
|
1621
|
+
warning: Ne,
|
|
1622
|
+
error: ve
|
|
1623
1623
|
};
|
|
1624
|
-
function
|
|
1624
|
+
function ds({
|
|
1625
1625
|
children: s,
|
|
1626
1626
|
variant: t = "info",
|
|
1627
1627
|
action: r,
|
|
@@ -1630,7 +1630,7 @@ function cs({
|
|
|
1630
1630
|
role: n,
|
|
1631
1631
|
...i
|
|
1632
1632
|
}) {
|
|
1633
|
-
const l =
|
|
1633
|
+
const l = xt[t], p = n || (t === "error" ? "alert" : "status");
|
|
1634
1634
|
return /* @__PURE__ */ e.jsxs(
|
|
1635
1635
|
"div",
|
|
1636
1636
|
{
|
|
@@ -1663,7 +1663,7 @@ function cs({
|
|
|
1663
1663
|
}
|
|
1664
1664
|
);
|
|
1665
1665
|
}
|
|
1666
|
-
function
|
|
1666
|
+
function us({
|
|
1667
1667
|
trigger: s,
|
|
1668
1668
|
items: t = [],
|
|
1669
1669
|
open: r,
|
|
@@ -1825,7 +1825,7 @@ function ds({
|
|
|
1825
1825
|
}
|
|
1826
1826
|
);
|
|
1827
1827
|
}
|
|
1828
|
-
function
|
|
1828
|
+
function fs({
|
|
1829
1829
|
value: s = 0,
|
|
1830
1830
|
size: t = "m",
|
|
1831
1831
|
variant: r = "default",
|
|
@@ -1862,11 +1862,11 @@ function us({
|
|
|
1862
1862
|
}
|
|
1863
1863
|
);
|
|
1864
1864
|
}
|
|
1865
|
-
const
|
|
1866
|
-
function
|
|
1865
|
+
const bt = (s) => 1 - Math.pow(1 - s, 3), jt = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1866
|
+
function _t(s, { duration: t = 600 } = {}) {
|
|
1867
1867
|
const [r, o] = S(s), a = $(s), n = $(null);
|
|
1868
1868
|
return B(() => {
|
|
1869
|
-
if (
|
|
1869
|
+
if (jt()) {
|
|
1870
1870
|
o(s), a.current = s;
|
|
1871
1871
|
return;
|
|
1872
1872
|
}
|
|
@@ -1876,22 +1876,22 @@ function jt(s, { duration: t = 600 } = {}) {
|
|
|
1876
1876
|
const u = (m) => {
|
|
1877
1877
|
p || (p = m);
|
|
1878
1878
|
const f = Math.min((m - p) / t, 1);
|
|
1879
|
-
o(i + l *
|
|
1879
|
+
o(i + l * bt(f)), f < 1 ? n.current = requestAnimationFrame(u) : a.current = s;
|
|
1880
1880
|
};
|
|
1881
1881
|
return n.current = requestAnimationFrame(u), () => cancelAnimationFrame(n.current);
|
|
1882
1882
|
}, [s, t]), r;
|
|
1883
1883
|
}
|
|
1884
|
-
function
|
|
1884
|
+
function ms({
|
|
1885
1885
|
value: s,
|
|
1886
1886
|
duration: t = 600,
|
|
1887
1887
|
decimals: r = 0,
|
|
1888
1888
|
prefix: o = "",
|
|
1889
1889
|
suffix: a = ""
|
|
1890
1890
|
}) {
|
|
1891
|
-
const i =
|
|
1891
|
+
const i = _t(s, { duration: t }).toFixed(r);
|
|
1892
1892
|
return `${o}${i}${a}`;
|
|
1893
1893
|
}
|
|
1894
|
-
function
|
|
1894
|
+
function vt({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
1895
1895
|
const o = $(null), [a, n] = S(!1);
|
|
1896
1896
|
return B(() => {
|
|
1897
1897
|
const i = o.current;
|
|
@@ -1905,7 +1905,7 @@ function _t({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
|
1905
1905
|
return l.observe(i), () => l.disconnect();
|
|
1906
1906
|
}, [s, t, r]), { ref: o, inView: a };
|
|
1907
1907
|
}
|
|
1908
|
-
function
|
|
1908
|
+
function ps({
|
|
1909
1909
|
children: s,
|
|
1910
1910
|
as: t = "div",
|
|
1911
1911
|
once: r = !1,
|
|
@@ -1915,31 +1915,31 @@ function ms({
|
|
|
1915
1915
|
onLeave: i,
|
|
1916
1916
|
...l
|
|
1917
1917
|
}) {
|
|
1918
|
-
const { ref: p, inView: u } =
|
|
1918
|
+
const { ref: p, inView: u } = vt({ threshold: o, rootMargin: a, once: r }), m = $(!1);
|
|
1919
1919
|
return B(() => {
|
|
1920
1920
|
u && !m.current && (n == null || n()), !u && m.current && (i == null || i()), m.current = u;
|
|
1921
1921
|
}, [u]), /* @__PURE__ */ e.jsx(t, { ref: p, ...l, children: typeof s == "function" ? s(u) : s });
|
|
1922
1922
|
}
|
|
1923
1923
|
const Ie = {
|
|
1924
|
-
default:
|
|
1925
|
-
success:
|
|
1926
|
-
warning:
|
|
1927
|
-
error:
|
|
1924
|
+
default: ye,
|
|
1925
|
+
success: we,
|
|
1926
|
+
warning: Ne,
|
|
1927
|
+
error: ve
|
|
1928
1928
|
};
|
|
1929
1929
|
let ce = [];
|
|
1930
|
-
const
|
|
1930
|
+
const _e = /* @__PURE__ */ new Set();
|
|
1931
1931
|
function Le() {
|
|
1932
|
-
|
|
1932
|
+
_e.forEach((s) => s([...ce]));
|
|
1933
1933
|
}
|
|
1934
|
-
function
|
|
1934
|
+
function Nt(s) {
|
|
1935
1935
|
ce = [...ce, s], Le();
|
|
1936
1936
|
}
|
|
1937
|
-
function
|
|
1937
|
+
function wt(s) {
|
|
1938
1938
|
ce = ce.filter((t) => t.id !== s), Le();
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function hs() {
|
|
1941
1941
|
const s = (t, r = {}) => {
|
|
1942
|
-
|
|
1942
|
+
Nt({
|
|
1943
1943
|
id: `${Date.now()}-${Math.random()}`,
|
|
1944
1944
|
message: t,
|
|
1945
1945
|
type: "default",
|
|
@@ -1949,7 +1949,7 @@ function ps() {
|
|
|
1949
1949
|
};
|
|
1950
1950
|
return s.success = (t, r) => s(t, { ...r, type: "success" }), s.error = (t, r) => s(t, { ...r, type: "error" }), s.warning = (t, r) => s(t, { ...r, type: "warning" }), { toast: s };
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1952
|
+
function yt({ data: s, onDismiss: t }) {
|
|
1953
1953
|
const [r, o] = S(!1), a = $(null);
|
|
1954
1954
|
B(() => (requestAnimationFrame(() => o(!0)), s.duration > 0 && (a.current = setTimeout(() => n(), s.duration)), () => clearTimeout(a.current)), []);
|
|
1955
1955
|
function n() {
|
|
@@ -1982,19 +1982,19 @@ function wt({ data: s, onDismiss: t }) {
|
|
|
1982
1982
|
}
|
|
1983
1983
|
);
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function xs({ position: s = "bottom-right" }) {
|
|
1986
1986
|
const [t, r] = S(() => [...ce]);
|
|
1987
|
-
return B(() => (
|
|
1988
|
-
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(
|
|
1987
|
+
return B(() => (_e.add(r), () => _e.delete(r)), []), !t.length || typeof document > "u" ? null : me.createPortal(
|
|
1988
|
+
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(yt, { data: o, onDismiss: wt }, o.id)) }),
|
|
1989
1989
|
document.body
|
|
1990
1990
|
);
|
|
1991
1991
|
}
|
|
1992
|
-
const
|
|
1992
|
+
const gt = {
|
|
1993
1993
|
running: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "info", children: "Running..." }),
|
|
1994
1994
|
success: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "success", children: "Done" }),
|
|
1995
1995
|
error: /* @__PURE__ */ e.jsx(pe, { size: "xs", variant: "error", children: "Error" })
|
|
1996
1996
|
};
|
|
1997
|
-
function
|
|
1997
|
+
function bs({
|
|
1998
1998
|
label: s,
|
|
1999
1999
|
status: t = "idle",
|
|
2000
2000
|
icon: r,
|
|
@@ -2006,10 +2006,10 @@ function xs({
|
|
|
2006
2006
|
children: p,
|
|
2007
2007
|
...u
|
|
2008
2008
|
}) {
|
|
2009
|
-
const f = `tc-body-${
|
|
2009
|
+
const f = `tc-body-${We().replace(/:/g, "")}`, [h, d] = S(a), b = n !== void 0, _ = b ? n : h, R = () => {
|
|
2010
2010
|
b ? i == null || i(!n) : d((E) => !E);
|
|
2011
2011
|
};
|
|
2012
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2012
|
+
return /* @__PURE__ */ e.jsxs(st, { padding: l, ...u, children: [
|
|
2013
2013
|
/* @__PURE__ */ e.jsxs(
|
|
2014
2014
|
"button",
|
|
2015
2015
|
{
|
|
@@ -2029,7 +2029,7 @@ function xs({
|
|
|
2029
2029
|
),
|
|
2030
2030
|
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
|
|
2031
2031
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2032
|
-
|
|
2032
|
+
gt[t],
|
|
2033
2033
|
o
|
|
2034
2034
|
]
|
|
2035
2035
|
}
|
|
@@ -2037,7 +2037,7 @@ function xs({
|
|
|
2037
2037
|
_ && /* @__PURE__ */ e.jsx("div", { id: f, className: "ds-tool-card__body", children: p })
|
|
2038
2038
|
] });
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function js({
|
|
2041
2041
|
text: s,
|
|
2042
2042
|
size: t = "xs",
|
|
2043
2043
|
timeout: r = 2e3,
|
|
@@ -2054,26 +2054,26 @@ function bs({
|
|
|
2054
2054
|
{
|
|
2055
2055
|
variant: "ghost",
|
|
2056
2056
|
size: t,
|
|
2057
|
-
icon: n ? /* @__PURE__ */ e.jsx(he, { size: D[1], strokeWidth: 1.5 }) : /* @__PURE__ */ e.jsx(
|
|
2057
|
+
icon: n ? /* @__PURE__ */ e.jsx(he, { size: D[1], strokeWidth: 1.5 }) : /* @__PURE__ */ e.jsx(qe, { size: D[1], strokeWidth: 1.5 }),
|
|
2058
2058
|
"aria-label": o,
|
|
2059
2059
|
onClick: l,
|
|
2060
2060
|
...a
|
|
2061
2061
|
}
|
|
2062
2062
|
);
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2064
|
+
function _s({ content: s, streaming: t = !1, ...r }) {
|
|
2065
2065
|
const [o, a] = S(t);
|
|
2066
2066
|
return B(() => {
|
|
2067
2067
|
a(!!t);
|
|
2068
2068
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
2069
|
-
|
|
2069
|
+
it,
|
|
2070
2070
|
{
|
|
2071
2071
|
expanded: o,
|
|
2072
2072
|
onToggle: a,
|
|
2073
2073
|
padding: "s",
|
|
2074
2074
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2075
|
-
/* @__PURE__ */ e.jsx(
|
|
2076
|
-
/* @__PURE__ */ e.jsx(
|
|
2075
|
+
/* @__PURE__ */ e.jsx(He, { size: D[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2076
|
+
/* @__PURE__ */ e.jsx(rt, { secondary: !0, children: "Thinking" })
|
|
2077
2077
|
] }),
|
|
2078
2078
|
...r,
|
|
2079
2079
|
children: /* @__PURE__ */ e.jsxs(Pe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
@@ -2083,7 +2083,7 @@ function js({ content: s, streaming: t = !1, ...r }) {
|
|
|
2083
2083
|
}
|
|
2084
2084
|
);
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function vs({
|
|
2087
2087
|
count: s,
|
|
2088
2088
|
current: t = 0,
|
|
2089
2089
|
done: r = [],
|
|
@@ -2122,7 +2122,7 @@ function _s({
|
|
|
2122
2122
|
] })
|
|
2123
2123
|
] });
|
|
2124
2124
|
}
|
|
2125
|
-
function
|
|
2125
|
+
function Ns({
|
|
2126
2126
|
content: s,
|
|
2127
2127
|
isStreaming: t = !1,
|
|
2128
2128
|
cursor: r = "line",
|
|
@@ -2138,7 +2138,7 @@ function vs({
|
|
|
2138
2138
|
t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
|
|
2139
2139
|
] });
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function ws({
|
|
2142
2142
|
role: s = "assistant",
|
|
2143
2143
|
header: t,
|
|
2144
2144
|
footer: r,
|
|
@@ -2165,7 +2165,7 @@ function Ns({
|
|
|
2165
2165
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2166
2166
|
] });
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2168
|
+
function ys(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
2169
2169
|
const o = $(!1), a = $(0);
|
|
2170
2170
|
B(() => {
|
|
2171
2171
|
const n = t == null ? void 0 : t.current;
|
|
@@ -2180,7 +2180,7 @@ function ws(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
|
2180
2180
|
n && (r && o.current || (n.scrollTop = n.scrollHeight));
|
|
2181
2181
|
}, s);
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2183
|
+
function kt({
|
|
2184
2184
|
prompts: s,
|
|
2185
2185
|
enabled: t,
|
|
2186
2186
|
typingSpeed: r = 38,
|
|
@@ -2217,8 +2217,8 @@ function gt({
|
|
|
2217
2217
|
}, E = () => R(d.current + 1), g = () => R(d.current - 1), A = s[l % s.length] ?? "";
|
|
2218
2218
|
return { displayed: u, currentPrompt: A, index: l, next: E, prev: g };
|
|
2219
2219
|
}
|
|
2220
|
-
let
|
|
2221
|
-
function
|
|
2220
|
+
let Et = 0;
|
|
2221
|
+
function gs({
|
|
2222
2222
|
value: s = "",
|
|
2223
2223
|
onChange: t,
|
|
2224
2224
|
onSubmit: r,
|
|
@@ -2244,17 +2244,17 @@ function ys({
|
|
|
2244
2244
|
...I
|
|
2245
2245
|
}) {
|
|
2246
2246
|
const v = $(null), L = $(null), z = $(0), [Y, H] = S(!1), [X, U] = S([]), x = (j) => {
|
|
2247
|
-
const T = ++
|
|
2247
|
+
const T = ++Et;
|
|
2248
2248
|
U((V) => [...V, { id: T, msg: j }]), setTimeout(() => U((V) => V.filter((G) => G.id !== T)), 6e3);
|
|
2249
2249
|
}, y = (j) => U((T) => T.filter((V) => V.id !== j)), O = (j) => j.type.startsWith("image/"), C = () => !0, K = _ ?? O, Z = R ?? C, w = (j) => {
|
|
2250
2250
|
const T = [], V = [], G = [], J = [];
|
|
2251
|
-
let
|
|
2252
|
-
for (const
|
|
2253
|
-
K(
|
|
2254
|
-
return { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded:
|
|
2251
|
+
let ee = 0, ie = E != null ? E - ((m == null ? void 0 : m.length) ?? 0) : 1 / 0;
|
|
2252
|
+
for (const te of j)
|
|
2253
|
+
K(te) ? g && te.size > g ? G.push(te.name) : ie > 0 ? (T.push(te), ie--) : ee++ : Z(te) ? V.push(te) : J.push(te.name);
|
|
2254
|
+
return { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee };
|
|
2255
2255
|
}, c = (j) => {
|
|
2256
|
-
const { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded:
|
|
2257
|
-
G.length && x(`File${G.length > 1 ? "s" : ""} too large${g ? ` (max ${g / 1024 / 1024}MB)` : ""}: ${G.join(", ")}`), J.length && x(`Skipped unsupported file${J.length > 1 ? "s" : ""}: ${J.join(", ")}`),
|
|
2256
|
+
const { imageFiles: T, docFiles: V, tooLarge: G, skipped: J, limitExceeded: ee } = w(j);
|
|
2257
|
+
G.length && x(`File${G.length > 1 ? "s" : ""} too large${g ? ` (max ${g / 1024 / 1024}MB)` : ""}: ${G.join(", ")}`), J.length && x(`Skipped unsupported file${J.length > 1 ? "s" : ""}: ${J.join(", ")}`), ee && x(`Max ${E} images per message`), h && T.length && h(T);
|
|
2258
2258
|
const ie = V.concat(h ? [] : T);
|
|
2259
2259
|
f && ie.length && f(ie);
|
|
2260
2260
|
};
|
|
@@ -2263,10 +2263,10 @@ function ys({
|
|
|
2263
2263
|
j && (j.style.height = "auto", j.style.height = `${Math.min(j.scrollHeight, 200)}px`);
|
|
2264
2264
|
}, [s]), B(() => {
|
|
2265
2265
|
const j = (T) => {
|
|
2266
|
-
var G, J,
|
|
2266
|
+
var G, J, ee;
|
|
2267
2267
|
if (n || i) return;
|
|
2268
2268
|
const V = (G = T.target) == null ? void 0 : G.tagName;
|
|
2269
|
-
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (J = T.target) != null && J.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (
|
|
2269
|
+
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (J = T.target) != null && J.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (ee = L.current) == null || ee.focus();
|
|
2270
2270
|
};
|
|
2271
2271
|
return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
|
|
2272
2272
|
}, [n, i]);
|
|
@@ -2274,7 +2274,7 @@ function ys({
|
|
|
2274
2274
|
j.preventDefault(), z.current++, j.dataTransfer.types.includes("Files") && H(!0);
|
|
2275
2275
|
}, P = (j) => {
|
|
2276
2276
|
j.preventDefault(), z.current--, z.current === 0 && H(!1);
|
|
2277
|
-
}, W = (j) => j.preventDefault(),
|
|
2277
|
+
}, W = (j) => j.preventDefault(), se = (j) => {
|
|
2278
2278
|
j.preventDefault(), z.current = 0, H(!1);
|
|
2279
2279
|
const T = Array.from(j.dataTransfer.files);
|
|
2280
2280
|
T.length && c(T);
|
|
@@ -2282,19 +2282,19 @@ function ys({
|
|
|
2282
2282
|
const T = Array.from(j.target.files || []);
|
|
2283
2283
|
v.current && (v.current.value = ""), T.length && c(T);
|
|
2284
2284
|
}, F = (j) => {
|
|
2285
|
-
var
|
|
2285
|
+
var te;
|
|
2286
2286
|
if (!h) return;
|
|
2287
|
-
const T = (
|
|
2287
|
+
const T = (te = j.clipboardData) == null ? void 0 : te.items;
|
|
2288
2288
|
if (!T) return;
|
|
2289
2289
|
const V = [];
|
|
2290
|
-
for (const
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2290
|
+
for (const Me of T) {
|
|
2291
|
+
const ke = Me.getAsFile();
|
|
2292
|
+
ke && V.push(ke);
|
|
2293
2293
|
}
|
|
2294
2294
|
if (V.length === 0) return;
|
|
2295
|
-
const { imageFiles: G, tooLarge: J, limitExceeded:
|
|
2296
|
-
J.length && x(`File${J.length > 1 ? "s" : ""} too large: ${J.join(", ")}`),
|
|
2297
|
-
}, Q = !n && !i && !!(p != null && p.length) && s.length === 0, oe =
|
|
2295
|
+
const { imageFiles: G, tooLarge: J, skipped: ee, limitExceeded: ie } = w(V);
|
|
2296
|
+
J.length && x(`File${J.length > 1 ? "s" : ""} too large: ${J.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), ie && x(`Max ${E} images per message`), G.length && (j.preventDefault(), h(G));
|
|
2297
|
+
}, Q = !n && !i && !!(p != null && p.length) && s.length === 0, oe = kt({
|
|
2298
2298
|
prompts: p ?? [],
|
|
2299
2299
|
enabled: Q
|
|
2300
2300
|
}), be = (j) => {
|
|
@@ -2313,9 +2313,9 @@ function ys({
|
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
2315
|
a == null || a(j);
|
|
2316
|
-
}, Oe = (s.trim() || (m == null ? void 0 : m.length) > 0 || (u == null ? void 0 : u.length) > 0) && !i,
|
|
2316
|
+
}, Oe = (s.trim() || (m == null ? void 0 : m.length) > 0 || (u == null ? void 0 : u.length) > 0) && !i, ge = f || h;
|
|
2317
2317
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", M].filter(Boolean).join(" "), ...I, children: [
|
|
2318
|
-
|
|
2318
|
+
ge && /* @__PURE__ */ e.jsx(
|
|
2319
2319
|
"input",
|
|
2320
2320
|
{
|
|
2321
2321
|
ref: v,
|
|
@@ -2333,7 +2333,7 @@ function ys({
|
|
|
2333
2333
|
onDragEnter: N,
|
|
2334
2334
|
onDragLeave: P,
|
|
2335
2335
|
onDragOver: W,
|
|
2336
|
-
onDrop:
|
|
2336
|
+
onDrop: se,
|
|
2337
2337
|
children: [
|
|
2338
2338
|
Y && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2339
2339
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2381,7 +2381,7 @@ function ys({
|
|
|
2381
2381
|
)
|
|
2382
2382
|
] }, j.id)) }),
|
|
2383
2383
|
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((j, T) => /* @__PURE__ */ e.jsx(pe, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2384
|
-
j.uploading ? /* @__PURE__ */ e.jsx(
|
|
2384
|
+
j.uploading ? /* @__PURE__ */ e.jsx(Ke, { size: D[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Ee, { size: D[1], strokeWidth: 1.5 }),
|
|
2385
2385
|
j.filename,
|
|
2386
2386
|
j.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2387
2387
|
"button",
|
|
@@ -2394,7 +2394,7 @@ function ys({
|
|
|
2394
2394
|
)
|
|
2395
2395
|
] }) }, T)) }),
|
|
2396
2396
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2397
|
-
|
|
2397
|
+
ge && /* @__PURE__ */ e.jsx(
|
|
2398
2398
|
fe,
|
|
2399
2399
|
{
|
|
2400
2400
|
variant: "ghost",
|
|
@@ -2415,7 +2415,7 @@ function ys({
|
|
|
2415
2415
|
{
|
|
2416
2416
|
variant: "primary",
|
|
2417
2417
|
size: "xs",
|
|
2418
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2418
|
+
icon: /* @__PURE__ */ e.jsx(Ge, { size: D[2], strokeWidth: 1.5 }),
|
|
2419
2419
|
onClick: o,
|
|
2420
2420
|
"aria-label": "Stop"
|
|
2421
2421
|
}
|
|
@@ -2424,7 +2424,7 @@ function ys({
|
|
|
2424
2424
|
{
|
|
2425
2425
|
variant: "primary",
|
|
2426
2426
|
size: "xs",
|
|
2427
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2427
|
+
icon: /* @__PURE__ */ e.jsx(Xe, { size: D[2], strokeWidth: 1.5 }),
|
|
2428
2428
|
onClick: r,
|
|
2429
2429
|
disabled: !Oe,
|
|
2430
2430
|
"aria-label": "Send"
|
|
@@ -2437,7 +2437,7 @@ function ys({
|
|
|
2437
2437
|
] });
|
|
2438
2438
|
}
|
|
2439
2439
|
const De = { fast: 0, standard: 1, premium: 2 };
|
|
2440
|
-
function
|
|
2440
|
+
function ks({
|
|
2441
2441
|
models: s = [],
|
|
2442
2442
|
value: t,
|
|
2443
2443
|
onChange: r,
|
|
@@ -2506,7 +2506,7 @@ function gs({
|
|
|
2506
2506
|
].filter(Boolean).join(" "),
|
|
2507
2507
|
onClick: () => A("auto"),
|
|
2508
2508
|
children: [
|
|
2509
|
-
/* @__PURE__ */ e.jsx(
|
|
2509
|
+
/* @__PURE__ */ e.jsx(Je, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2510
2510
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
2511
2511
|
]
|
|
2512
2512
|
}
|
|
@@ -2543,69 +2543,69 @@ function gs({
|
|
|
2543
2543
|
);
|
|
2544
2544
|
}
|
|
2545
2545
|
export {
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2546
|
+
it as Accordion,
|
|
2547
|
+
zt as Alert,
|
|
2548
|
+
ms as AnimatedNumber,
|
|
2549
|
+
Xt as Avatar,
|
|
2550
2550
|
pe as Badge,
|
|
2551
|
-
|
|
2552
|
-
|
|
2551
|
+
ds as Banner,
|
|
2552
|
+
is as Breadcrumb,
|
|
2553
2553
|
fe as Button,
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2554
|
+
st as Card,
|
|
2555
|
+
ws as ChatMessage,
|
|
2556
|
+
Kt as Checkbox,
|
|
2557
|
+
Ft as Code,
|
|
2558
|
+
ot as CodeAccordion,
|
|
2559
|
+
js as CopyButton,
|
|
2560
|
+
cs as Drawer,
|
|
2561
2561
|
Ae as DrawerFooter,
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2562
|
+
us as Dropdown,
|
|
2563
|
+
ns as EmptyState,
|
|
2564
|
+
as as FormField,
|
|
2565
|
+
Bt as H1,
|
|
2566
|
+
Pt as H2,
|
|
2567
|
+
Lt as H3,
|
|
2568
|
+
Ot as H4,
|
|
2569
|
+
ps as InView,
|
|
2570
|
+
St as Input,
|
|
2571
|
+
Ct as Link,
|
|
2572
|
+
Wt as Modal,
|
|
2573
2573
|
Se as ModalFooter,
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2574
|
+
ks as ModelPicker,
|
|
2575
|
+
Mt as P1,
|
|
2576
|
+
rt as P2,
|
|
2577
2577
|
Pe as P3,
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2578
|
+
ls as Pagination,
|
|
2579
|
+
fs as ProgressBar,
|
|
2580
|
+
gs as PromptInput,
|
|
2581
|
+
Gt as Radio,
|
|
2582
|
+
_s as ReasoningBlock,
|
|
2583
|
+
Yt as SegmentedControl,
|
|
2584
|
+
It as Select,
|
|
2585
|
+
dt as Skeleton,
|
|
2586
|
+
et as Spinner,
|
|
2587
|
+
os as Stat,
|
|
2588
|
+
vs as StepIndicator,
|
|
2589
|
+
Dt as Stepper,
|
|
2590
|
+
Ns as StreamingText,
|
|
2591
|
+
Vt as Tab,
|
|
2592
|
+
Jt as Table,
|
|
2593
|
+
Qt as TableBody,
|
|
2594
|
+
Zt as TableHead,
|
|
2595
|
+
es as TableRow,
|
|
2596
|
+
ts as TableSubheaderRow,
|
|
2597
|
+
Ut as Tabs,
|
|
2598
|
+
rs as Td,
|
|
2599
|
+
At as Textarea,
|
|
2600
|
+
ss as Th,
|
|
2601
|
+
xs as ToastContainer,
|
|
2602
|
+
Ht as Toggle,
|
|
2603
|
+
bs as ToolCallCard,
|
|
2604
|
+
qt as Tooltip,
|
|
2605
2605
|
D as iconSizes,
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2606
|
+
_t as useAnimatedNumber,
|
|
2607
|
+
kt as useAnimatedPlaceholder,
|
|
2608
|
+
vt as useInView,
|
|
2609
|
+
ys as useStreamScroll,
|
|
2610
|
+
hs as useToast
|
|
2611
2611
|
};
|