@donkit-ai/design-system 1.4.7 → 1.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +77 -76
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import K, { useState as A, useRef as E, useEffect as M, useLayoutEffect as Ve } from "react";
|
|
2
|
-
import { Check as
|
|
2
|
+
import { Check as Ne, X as ne, ChevronDown as he, Minus as Ye, Plus as He, XCircle as we, AlertTriangle as ge, CheckCircle as ye, Info as ke, ChevronUp as qe, ChevronsUpDown as Ke, ChevronLeft as Ge, ChevronRight as Xe, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Re, Square as es, ArrowUp as ss, Zap as ts, Cpu as Se, FileText as rs, ThumbsUp as ns, ThumbsDown as as } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const I = {
|
|
5
5
|
1: 16,
|
|
6
6
|
2: 20,
|
|
7
7
|
3: 24,
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var _e = { exports: {} }, ue = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -65,7 +65,7 @@ function os() {
|
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case R:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case D:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case Y:
|
|
71
71
|
return "SuspenseList";
|
|
@@ -207,8 +207,8 @@ function os() {
|
|
|
207
207
|
else p(W);
|
|
208
208
|
if (U.call(w, "key")) {
|
|
209
209
|
W = s(c);
|
|
210
|
-
var Q = Object.keys(w).filter(function(
|
|
211
|
-
return
|
|
210
|
+
var Q = Object.keys(w).filter(function(xe) {
|
|
211
|
+
return xe !== "key";
|
|
212
212
|
});
|
|
213
213
|
F = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", g[W + F] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
function h(c) {
|
|
247
247
|
return typeof c == "object" && c !== null && c.$$typeof === b;
|
|
248
248
|
}
|
|
249
|
-
var u = K, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"),
|
|
249
|
+
var u = K, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), G = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, x = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
u = {
|
|
@@ -281,8 +281,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
281
281
|
};
|
|
282
282
|
}()), fe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
284
|
+
process.env.NODE_ENV === "production" ? _e.exports = is() : _e.exports = os();
|
|
285
|
+
var e = _e.exports;
|
|
286
286
|
function ls({ size: s = "m", color: t = "default", className: r = "", ...i }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
@@ -310,14 +310,14 @@ function me({
|
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const u = a && !s, b = o === "loading", j = o === "success", S = o === "error", R = b || j || S, B = r === "xs" ? "s" : "m", y = cs[r] ?? 16, $ = b ? /* @__PURE__ */ e.jsx(ls, { size: B }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(
|
|
313
|
+
const u = a && !s, b = o === "loading", j = o === "success", S = o === "error", R = b || j || S, B = r === "xs" ? "s" : "m", y = cs[r] ?? 16, $ = b ? /* @__PURE__ */ e.jsx(ls, { size: B }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Ne, { size: y, strokeWidth: 2.5 }) }) : S ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ne, { size: y, strokeWidth: 2.5 }) }) : null, O = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
316
|
`ds-button--${r}`,
|
|
317
317
|
i && "ds-button--full",
|
|
318
318
|
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
320
|
+
].filter(Boolean).join(" "), D = o !== "idle" ? o : void 0, Y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
321
|
R ? $ : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
322
322
|
s
|
|
323
323
|
] });
|
|
@@ -338,7 +338,7 @@ function me({
|
|
|
338
338
|
"aria-label": f,
|
|
339
339
|
"aria-disabled": n || b ? "true" : void 0,
|
|
340
340
|
"aria-busy": b ? "true" : void 0,
|
|
341
|
-
"data-state":
|
|
341
|
+
"data-state": D,
|
|
342
342
|
...h,
|
|
343
343
|
children: Y
|
|
344
344
|
}
|
|
@@ -353,7 +353,7 @@ function me({
|
|
|
353
353
|
onClick: b ? void 0 : l,
|
|
354
354
|
"aria-label": f,
|
|
355
355
|
"aria-busy": b ? "true" : void 0,
|
|
356
|
-
"data-state":
|
|
356
|
+
"data-state": D,
|
|
357
357
|
...h,
|
|
358
358
|
children: Y
|
|
359
359
|
}
|
|
@@ -448,7 +448,7 @@ function Hs({
|
|
|
448
448
|
id: d,
|
|
449
449
|
...f
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = A(!1), [u, b] = A(!1), [j, S] = A({}), [R, B] = A("down"), [y, $] = A(-1), O = E(null),
|
|
451
|
+
const [p, h] = A(!1), [u, b] = A(!1), [j, S] = A({}), [R, B] = A("down"), [y, $] = A(-1), O = E(null), D = E(null), Y = E(null), q = E(null), P = d || `select-${K.useId()}`, N = `${P}-label`, C = n ? `${P}-error` : void 0, G = 150, U = (g = !1) => {
|
|
452
452
|
u || (b(!0), $(-1), q.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
454
|
h(!1), b(!1), g && ((c = Y.current) == null || c.focus());
|
|
@@ -475,13 +475,13 @@ function Hs({
|
|
|
475
475
|
};
|
|
476
476
|
}, [p]), M(() => {
|
|
477
477
|
const g = (c) => {
|
|
478
|
-
O.current && !O.current.contains(c.target) &&
|
|
478
|
+
O.current && !O.current.contains(c.target) && D.current && !D.current.contains(c.target) && U();
|
|
479
479
|
};
|
|
480
480
|
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
481
481
|
}, [u]), M(() => {
|
|
482
482
|
var c;
|
|
483
|
-
if (!p || y < 0 || !
|
|
484
|
-
(c =
|
|
483
|
+
if (!p || y < 0 || !D.current) return;
|
|
484
|
+
(c = D.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [y, p]);
|
|
486
486
|
const k = (g) => {
|
|
487
487
|
switch (g.key) {
|
|
@@ -508,10 +508,10 @@ function Hs({
|
|
|
508
508
|
p && U(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
}, L = i.find((g) => g.value === t), H = l === "xs" ?
|
|
511
|
+
}, L = i.find((g) => g.value === t), H = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], X = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
|
-
ref:
|
|
514
|
+
ref: D,
|
|
515
515
|
role: "listbox",
|
|
516
516
|
"aria-labelledby": s ? N : void 0,
|
|
517
517
|
tabIndex: -1,
|
|
@@ -570,7 +570,7 @@ function Hs({
|
|
|
570
570
|
children: [
|
|
571
571
|
/* @__PURE__ */ e.jsx("span", { className: L ? "" : "ds-select-placeholder", children: (L == null ? void 0 : L.label) || a }),
|
|
572
572
|
/* @__PURE__ */ e.jsx(
|
|
573
|
-
|
|
573
|
+
he,
|
|
574
574
|
{
|
|
575
575
|
size: H,
|
|
576
576
|
strokeWidth: 1.5,
|
|
@@ -626,7 +626,7 @@ function qs({
|
|
|
626
626
|
"ds-stepper",
|
|
627
627
|
`ds-stepper--${o}`,
|
|
628
628
|
l && "ds-stepper--disabled"
|
|
629
|
-
].filter(Boolean).join(" "), S = o === "xs" ?
|
|
629
|
+
].filter(Boolean).join(" "), S = o === "xs" ? I[1] : o === "small" ? I[2] : I[3];
|
|
630
630
|
return /* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
631
631
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
632
632
|
/* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
@@ -774,7 +774,7 @@ function et({
|
|
|
774
774
|
}) {
|
|
775
775
|
const o = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
776
776
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${r ? "" : "ds-alert--no-title"}`, role: l, ...n, children: [
|
|
777
|
-
o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size:
|
|
777
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size: I[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
779
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
@@ -786,7 +786,7 @@ function et({
|
|
|
786
786
|
className: "ds-alert__close",
|
|
787
787
|
onClick: i,
|
|
788
788
|
"aria-label": "Close alert",
|
|
789
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
@@ -831,7 +831,7 @@ function st({
|
|
|
831
831
|
{
|
|
832
832
|
variant: "ghost",
|
|
833
833
|
size: "small",
|
|
834
|
-
icon: /* @__PURE__ */ e.jsx(ne, { size:
|
|
834
|
+
icon: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }),
|
|
835
835
|
onClick: d,
|
|
836
836
|
"aria-label": "Close modal"
|
|
837
837
|
}
|
|
@@ -875,9 +875,9 @@ function ms({
|
|
|
875
875
|
children: [
|
|
876
876
|
/* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: t }),
|
|
877
877
|
/* @__PURE__ */ e.jsx(
|
|
878
|
-
|
|
878
|
+
he,
|
|
879
879
|
{
|
|
880
|
-
size:
|
|
880
|
+
size: I[2],
|
|
881
881
|
strokeWidth: 1.5,
|
|
882
882
|
className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
|
|
883
883
|
}
|
|
@@ -1044,9 +1044,9 @@ function Ee({
|
|
|
1044
1044
|
children: [
|
|
1045
1045
|
/* @__PURE__ */ e.jsx("span", { className: "ds-accordion__title", children: t }),
|
|
1046
1046
|
/* @__PURE__ */ e.jsx(
|
|
1047
|
-
|
|
1047
|
+
he,
|
|
1048
1048
|
{
|
|
1049
|
-
size:
|
|
1049
|
+
size: I[2],
|
|
1050
1050
|
strokeWidth: 1.5,
|
|
1051
1051
|
className: `ds-accordion__icon ${f ? "ds-accordion__icon--expanded" : ""}`
|
|
1052
1052
|
}
|
|
@@ -1206,7 +1206,7 @@ function ct({
|
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
1208
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ e.jsx(
|
|
1209
|
-
|
|
1209
|
+
Ne,
|
|
1210
1210
|
{
|
|
1211
1211
|
size: d,
|
|
1212
1212
|
strokeWidth: 2.5,
|
|
@@ -1365,7 +1365,7 @@ function xt({ children: s, colSpan: t = 999, ...r }) {
|
|
|
1365
1365
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1366
1366
|
}
|
|
1367
1367
|
function bt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, className: n = "", style: o = {}, ...l }) {
|
|
1368
|
-
const m = !!i || r !== void 0, d = r === "asc" ? qe : r === "desc" ?
|
|
1368
|
+
const m = !!i || r !== void 0, d = r === "asc" ? qe : r === "desc" ? he : Ke;
|
|
1369
1369
|
return /* @__PURE__ */ e.jsx(
|
|
1370
1370
|
"th",
|
|
1371
1371
|
{
|
|
@@ -1606,7 +1606,7 @@ function yt({
|
|
|
1606
1606
|
children: [
|
|
1607
1607
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1608
1608
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
|
|
1609
|
-
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1609
|
+
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }) })
|
|
1610
1610
|
] }),
|
|
1611
1611
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1612
1612
|
p
|
|
@@ -1642,7 +1642,7 @@ function kt({
|
|
|
1642
1642
|
role: m,
|
|
1643
1643
|
...o,
|
|
1644
1644
|
children: [
|
|
1645
|
-
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size:
|
|
1645
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
1646
1646
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1647
1647
|
r && /* @__PURE__ */ e.jsx(
|
|
1648
1648
|
"button",
|
|
@@ -1660,7 +1660,7 @@ function kt({
|
|
|
1660
1660
|
className: "ds-banner-dismiss",
|
|
1661
1661
|
onClick: a,
|
|
1662
1662
|
"aria-label": "Dismiss",
|
|
1663
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1663
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 })
|
|
1664
1664
|
}
|
|
1665
1665
|
)
|
|
1666
1666
|
]
|
|
@@ -1677,7 +1677,7 @@ function Et({
|
|
|
1677
1677
|
style: o,
|
|
1678
1678
|
...l
|
|
1679
1679
|
}) {
|
|
1680
|
-
const [m, d] = A(!1), [f, p] = A(!1), h = r !== void 0, u = h ? r : m, b = E(null), j = E(null), S = E(null), R = E(null), [B, y] = A({}), $ = E(null), O = 150,
|
|
1680
|
+
const [m, d] = A(!1), [f, p] = A(!1), h = r !== void 0, u = h ? r : m, b = E(null), j = E(null), S = E(null), R = E(null), [B, y] = A({}), $ = E(null), O = 150, D = () => {
|
|
1681
1681
|
if (h)
|
|
1682
1682
|
i == null || i(!1);
|
|
1683
1683
|
else {
|
|
@@ -1688,7 +1688,7 @@ function Et({
|
|
|
1688
1688
|
}
|
|
1689
1689
|
}, Y = () => {
|
|
1690
1690
|
const x = !u;
|
|
1691
|
-
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) :
|
|
1691
|
+
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) : D();
|
|
1692
1692
|
}, q = () => {
|
|
1693
1693
|
u || (h ? i == null || i(!0) : (clearTimeout($.current), p(!1), d(!0)));
|
|
1694
1694
|
};
|
|
@@ -1718,9 +1718,9 @@ function Et({
|
|
|
1718
1718
|
if (!u) return;
|
|
1719
1719
|
const x = (k) => {
|
|
1720
1720
|
var L, H;
|
|
1721
|
-
!((L = b.current) != null && L.contains(k.target)) && !((H = j.current) != null && H.contains(k.target)) &&
|
|
1721
|
+
!((L = b.current) != null && L.contains(k.target)) && !((H = j.current) != null && H.contains(k.target)) && D();
|
|
1722
1722
|
}, v = (k) => {
|
|
1723
|
-
k.key === "Escape" && (
|
|
1723
|
+
k.key === "Escape" && (D(), P());
|
|
1724
1724
|
};
|
|
1725
1725
|
return document.addEventListener("mousedown", x), document.addEventListener("keydown", v), () => {
|
|
1726
1726
|
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", v);
|
|
@@ -1760,7 +1760,7 @@ function Et({
|
|
|
1760
1760
|
x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
|
|
1761
1761
|
break;
|
|
1762
1762
|
case "Tab":
|
|
1763
|
-
|
|
1763
|
+
D();
|
|
1764
1764
|
break;
|
|
1765
1765
|
}
|
|
1766
1766
|
}, U = u && /* @__PURE__ */ e.jsx(
|
|
@@ -1795,7 +1795,7 @@ function Et({
|
|
|
1795
1795
|
...H,
|
|
1796
1796
|
onClick: () => {
|
|
1797
1797
|
var X;
|
|
1798
|
-
(X = x.onClick) == null || X.call(x),
|
|
1798
|
+
(X = x.onClick) == null || X.call(x), D();
|
|
1799
1799
|
},
|
|
1800
1800
|
children: [
|
|
1801
1801
|
x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
@@ -1933,9 +1933,9 @@ const Me = {
|
|
|
1933
1933
|
error: we
|
|
1934
1934
|
};
|
|
1935
1935
|
let de = [];
|
|
1936
|
-
const
|
|
1936
|
+
const je = /* @__PURE__ */ new Set();
|
|
1937
1937
|
function We() {
|
|
1938
|
-
|
|
1938
|
+
je.forEach((s) => s([...de]));
|
|
1939
1939
|
}
|
|
1940
1940
|
function $s(s) {
|
|
1941
1941
|
de = [...de, s], We();
|
|
@@ -1973,7 +1973,7 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1973
1973
|
role: s.type === "error" ? "alert" : "status",
|
|
1974
1974
|
"aria-live": "polite",
|
|
1975
1975
|
children: [
|
|
1976
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(o, { size:
|
|
1976
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(o, { size: I[3], strokeWidth: 1.5 }) }),
|
|
1977
1977
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: s.message }),
|
|
1978
1978
|
/* @__PURE__ */ e.jsx(
|
|
1979
1979
|
"button",
|
|
@@ -1981,7 +1981,7 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1981
1981
|
className: "ds-toast__close",
|
|
1982
1982
|
onClick: n,
|
|
1983
1983
|
"aria-label": "Закрыть",
|
|
1984
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1984
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
|
|
1985
1985
|
}
|
|
1986
1986
|
)
|
|
1987
1987
|
]
|
|
@@ -1990,7 +1990,7 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
function At({ position: s = "bottom-right" }) {
|
|
1992
1992
|
const [t, r] = A(() => [...de]);
|
|
1993
|
-
return M(() => (
|
|
1993
|
+
return M(() => (je.add(r), () => je.delete(r)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
1994
1994
|
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(Rs, { data: i, onDismiss: Ts }, i.id)) }),
|
|
1995
1995
|
document.body
|
|
1996
1996
|
);
|
|
@@ -2054,7 +2054,8 @@ function As({
|
|
|
2054
2054
|
{
|
|
2055
2055
|
variant: "ghost",
|
|
2056
2056
|
size: t,
|
|
2057
|
-
|
|
2057
|
+
state: n ? "success" : "idle",
|
|
2058
|
+
icon: /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
|
|
2058
2059
|
"aria-label": i,
|
|
2059
2060
|
onClick: l,
|
|
2060
2061
|
...a
|
|
@@ -2072,7 +2073,7 @@ function It({ content: s, streaming: t = !1, ...r }) {
|
|
|
2072
2073
|
onToggle: a,
|
|
2073
2074
|
padding: "s",
|
|
2074
2075
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2075
|
-
/* @__PURE__ */ e.jsx(Ze, { size:
|
|
2076
|
+
/* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2076
2077
|
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2077
2078
|
] }),
|
|
2078
2079
|
...r,
|
|
@@ -2110,7 +2111,7 @@ function Bt({
|
|
|
2110
2111
|
"aria-label": `Step ${d + 1}`,
|
|
2111
2112
|
disabled: !h || d === t,
|
|
2112
2113
|
onClick: () => i == null ? void 0 : i(d),
|
|
2113
|
-
children: p ? /* @__PURE__ */ e.jsx(
|
|
2114
|
+
children: p ? /* @__PURE__ */ e.jsx(Ne, { size: 8, strokeWidth: 3 }) : null
|
|
2114
2115
|
},
|
|
2115
2116
|
d
|
|
2116
2117
|
);
|
|
@@ -2203,8 +2204,8 @@ function Ds({
|
|
|
2203
2204
|
b.current = setTimeout($, j.current - O);
|
|
2204
2205
|
return;
|
|
2205
2206
|
}
|
|
2206
|
-
const
|
|
2207
|
-
p.current === "typing" ? (h.current += 1, f(
|
|
2207
|
+
const D = s[u.current % s.length] ?? "";
|
|
2208
|
+
p.current === "typing" ? (h.current += 1, f(D.slice(0, h.current)), h.current >= D.length ? (p.current = "holding", b.current = setTimeout($, a)) : b.current = setTimeout($, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", b.current = setTimeout($, i)) : (h.current = Math.max(0, h.current - 1), f(D.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % s.length, m(u.current), b.current = setTimeout($, n)) : b.current = setTimeout($, i));
|
|
2208
2209
|
};
|
|
2209
2210
|
return b.current = setTimeout($, 260), () => {
|
|
2210
2211
|
b.current && clearTimeout(b.current);
|
|
@@ -2212,8 +2213,8 @@ function Ds({
|
|
|
2212
2213
|
}, [t, s, r, i, a, n]);
|
|
2213
2214
|
const S = ($) => {
|
|
2214
2215
|
if (s.length === 0) return;
|
|
2215
|
-
const O = ($ % s.length + s.length) % s.length,
|
|
2216
|
-
u.current = O, h.current =
|
|
2216
|
+
const O = ($ % s.length + s.length) % s.length, D = s[O];
|
|
2217
|
+
u.current = O, h.current = D.length, p.current = "holding", j.current = Date.now() + o, m(O), f(D);
|
|
2217
2218
|
}, R = () => S(u.current + 1), B = () => S(u.current - 1), y = s[l % s.length] ?? "";
|
|
2218
2219
|
return { displayed: d, currentPrompt: y, index: l, next: R, prev: B };
|
|
2219
2220
|
}
|
|
@@ -2241,7 +2242,7 @@ function zt({
|
|
|
2241
2242
|
leftSlot: y,
|
|
2242
2243
|
rightSlot: $,
|
|
2243
2244
|
className: O = "",
|
|
2244
|
-
...
|
|
2245
|
+
...D
|
|
2245
2246
|
}) {
|
|
2246
2247
|
const Y = E(null), q = E(null), P = E(0), [N, C] = A(!1), [G, U] = A([]), x = (_) => {
|
|
2247
2248
|
const T = ++Is;
|
|
@@ -2297,7 +2298,7 @@ function zt({
|
|
|
2297
2298
|
}, Q = !n && !o && !!(m != null && m.length) && s.length === 0, oe = Ds({
|
|
2298
2299
|
prompts: m ?? [],
|
|
2299
2300
|
enabled: Q
|
|
2300
|
-
}),
|
|
2301
|
+
}), xe = (_) => {
|
|
2301
2302
|
if (Q) {
|
|
2302
2303
|
if (_.key === "ArrowDown" || _.key === "ArrowRight") {
|
|
2303
2304
|
_.preventDefault(), oe.next();
|
|
@@ -2314,7 +2315,7 @@ function zt({
|
|
|
2314
2315
|
}
|
|
2315
2316
|
a == null || a(_);
|
|
2316
2317
|
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (d == null ? void 0 : d.length) > 0) && !o, $e = p || h;
|
|
2317
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...
|
|
2318
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...D, children: [
|
|
2318
2319
|
$e && /* @__PURE__ */ e.jsx(
|
|
2319
2320
|
"input",
|
|
2320
2321
|
{
|
|
@@ -2342,7 +2343,7 @@ function zt({
|
|
|
2342
2343
|
ref: q,
|
|
2343
2344
|
value: s,
|
|
2344
2345
|
onChange: (_) => t == null ? void 0 : t(_.target.value),
|
|
2345
|
-
onKeyDown:
|
|
2346
|
+
onKeyDown: xe,
|
|
2346
2347
|
onPaste: W,
|
|
2347
2348
|
placeholder: Q ? "" : l,
|
|
2348
2349
|
disabled: n || o,
|
|
@@ -2376,12 +2377,12 @@ function zt({
|
|
|
2376
2377
|
className: "ds-prompt-input__warning-close",
|
|
2377
2378
|
onClick: () => v(_.id),
|
|
2378
2379
|
"aria-label": "Dismiss",
|
|
2379
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
2380
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
|
|
2380
2381
|
}
|
|
2381
2382
|
)
|
|
2382
2383
|
] }, _.id)) }),
|
|
2383
2384
|
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((_, T) => /* @__PURE__ */ e.jsx(ae, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2384
|
-
_.uploading ? /* @__PURE__ */ e.jsx(Qe, { size:
|
|
2385
|
+
_.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: I[1], strokeWidth: 1.5 }),
|
|
2385
2386
|
_.filename,
|
|
2386
2387
|
_.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2387
2388
|
"button",
|
|
@@ -2389,7 +2390,7 @@ function zt({
|
|
|
2389
2390
|
type: "button",
|
|
2390
2391
|
className: "ds-prompt-input__remove-btn",
|
|
2391
2392
|
onClick: () => u == null ? void 0 : u(T),
|
|
2392
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
2393
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
|
|
2393
2394
|
}
|
|
2394
2395
|
)
|
|
2395
2396
|
] }) }, T)) }),
|
|
@@ -2399,7 +2400,7 @@ function zt({
|
|
|
2399
2400
|
{
|
|
2400
2401
|
variant: "ghost",
|
|
2401
2402
|
size: "xs",
|
|
2402
|
-
icon: /* @__PURE__ */ e.jsx(Re, { size:
|
|
2403
|
+
icon: /* @__PURE__ */ e.jsx(Re, { size: I[2], strokeWidth: 1.5 }),
|
|
2403
2404
|
"aria-label": "Attach files",
|
|
2404
2405
|
onClick: () => {
|
|
2405
2406
|
var _;
|
|
@@ -2415,7 +2416,7 @@ function zt({
|
|
|
2415
2416
|
{
|
|
2416
2417
|
variant: "primary",
|
|
2417
2418
|
size: "xs",
|
|
2418
|
-
icon: /* @__PURE__ */ e.jsx(es, { size:
|
|
2419
|
+
icon: /* @__PURE__ */ e.jsx(es, { size: I[2], strokeWidth: 1.5 }),
|
|
2419
2420
|
onClick: i,
|
|
2420
2421
|
"aria-label": "Stop"
|
|
2421
2422
|
}
|
|
@@ -2424,7 +2425,7 @@ function zt({
|
|
|
2424
2425
|
{
|
|
2425
2426
|
variant: "primary",
|
|
2426
2427
|
size: "xs",
|
|
2427
|
-
icon: /* @__PURE__ */ e.jsx(ss, { size:
|
|
2428
|
+
icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
|
|
2428
2429
|
onClick: r,
|
|
2429
2430
|
disabled: !Ce,
|
|
2430
2431
|
"aria-label": "Send"
|
|
@@ -2474,7 +2475,7 @@ function Ot({
|
|
|
2474
2475
|
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", G), document.removeEventListener("keydown", U);
|
|
2475
2476
|
};
|
|
2476
2477
|
}, [d]);
|
|
2477
|
-
const
|
|
2478
|
+
const D = (N) => {
|
|
2478
2479
|
r == null || r(N), f(!1);
|
|
2479
2480
|
}, Y = (N) => /* @__PURE__ */ e.jsxs(
|
|
2480
2481
|
"button",
|
|
@@ -2484,7 +2485,7 @@ function Ot({
|
|
|
2484
2485
|
"ds-model-picker__item",
|
|
2485
2486
|
N.name === t && "ds-model-picker__item--active"
|
|
2486
2487
|
].filter(Boolean).join(" "),
|
|
2487
|
-
onClick: () =>
|
|
2488
|
+
onClick: () => D(N.name),
|
|
2488
2489
|
children: [
|
|
2489
2490
|
N.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: N.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2490
2491
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: N.displayName || N.name }),
|
|
@@ -2509,7 +2510,7 @@ function Ot({
|
|
|
2509
2510
|
"ds-model-picker__item--auto",
|
|
2510
2511
|
t === "auto" && "ds-model-picker__item--active"
|
|
2511
2512
|
].filter(Boolean).join(" "),
|
|
2512
|
-
onClick: () =>
|
|
2513
|
+
onClick: () => D("auto"),
|
|
2513
2514
|
children: [
|
|
2514
2515
|
/* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2515
2516
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
@@ -2550,9 +2551,9 @@ function Ot({
|
|
|
2550
2551
|
}
|
|
2551
2552
|
const Bs = ({ filename: s, pages: t }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
2552
2553
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: s }),
|
|
2553
|
-
t.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2554
|
+
t.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(t) })
|
|
2554
2555
|
] });
|
|
2555
|
-
function
|
|
2556
|
+
function ve(s) {
|
|
2556
2557
|
return s != null && s.length ? "p. " + s.join(", ") : null;
|
|
2557
2558
|
}
|
|
2558
2559
|
function Ms(s) {
|
|
@@ -2578,9 +2579,9 @@ function Ft({
|
|
|
2578
2579
|
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2579
2580
|
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2580
2581
|
children: [
|
|
2581
|
-
/* @__PURE__ */ e.jsx(rs, { size:
|
|
2582
|
+
/* @__PURE__ */ e.jsx(rs, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2582
2583
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2583
|
-
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2584
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(u) })
|
|
2584
2585
|
]
|
|
2585
2586
|
},
|
|
2586
2587
|
h.filename
|
|
@@ -2618,7 +2619,7 @@ function Ft({
|
|
|
2618
2619
|
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2619
2620
|
children: [
|
|
2620
2621
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2621
|
-
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2622
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(u) })
|
|
2622
2623
|
]
|
|
2623
2624
|
},
|
|
2624
2625
|
h.filename
|
|
@@ -2703,7 +2704,7 @@ function Ct({
|
|
|
2703
2704
|
] });
|
|
2704
2705
|
}
|
|
2705
2706
|
const Ls = { add: "+", remove: "-", context: " " };
|
|
2706
|
-
function
|
|
2707
|
+
function be({ line: s, lineNumbers: t }) {
|
|
2707
2708
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
|
|
2708
2709
|
t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
|
|
2709
2710
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Ls[s.type] }),
|
|
@@ -2728,14 +2729,14 @@ function Ut({
|
|
|
2728
2729
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2729
2730
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2730
2731
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2731
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(
|
|
2732
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(
|
|
2732
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, p)) }),
|
|
2733
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: i }, p)) })
|
|
2733
2734
|
] })
|
|
2734
2735
|
] });
|
|
2735
2736
|
}
|
|
2736
2737
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2737
2738
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2738
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(
|
|
2739
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(be, { line: m, lineNumbers: i }, d)) })
|
|
2739
2740
|
] });
|
|
2740
2741
|
}
|
|
2741
2742
|
const zs = {
|
|
@@ -2797,7 +2798,7 @@ function Os({
|
|
|
2797
2798
|
children: /* @__PURE__ */ e.jsx(
|
|
2798
2799
|
ns,
|
|
2799
2800
|
{
|
|
2800
|
-
size:
|
|
2801
|
+
size: I[1],
|
|
2801
2802
|
strokeWidth: 1.5,
|
|
2802
2803
|
fill: s === "liked" ? "currentColor" : "none"
|
|
2803
2804
|
}
|
|
@@ -2818,7 +2819,7 @@ function Os({
|
|
|
2818
2819
|
children: /* @__PURE__ */ e.jsx(
|
|
2819
2820
|
as,
|
|
2820
2821
|
{
|
|
2821
|
-
size:
|
|
2822
|
+
size: I[1],
|
|
2822
2823
|
strokeWidth: 1.5,
|
|
2823
2824
|
fill: s === "disliked" ? "currentColor" : "none"
|
|
2824
2825
|
}
|
|
@@ -2930,7 +2931,7 @@ export {
|
|
|
2930
2931
|
Vt as ToolCallBubble,
|
|
2931
2932
|
Dt as ToolCallCard,
|
|
2932
2933
|
ot as Tooltip,
|
|
2933
|
-
|
|
2934
|
+
I as iconSizes,
|
|
2934
2935
|
ks as useAnimatedNumber,
|
|
2935
2936
|
Ds as useAnimatedPlaceholder,
|
|
2936
2937
|
Es as useInView,
|