@donkit-ai/design-system 1.4.57 → 1.4.58
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 +1 -1
- package/dist/index.es.js +88 -88
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -8,7 +8,7 @@ const P = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var we = { exports: {} }, he = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -59,7 +59,7 @@ function xt() {
|
|
|
59
59
|
return f.$$typeof === O ? null : f.displayName || f.name || null;
|
|
60
60
|
if (typeof f == "string") return f;
|
|
61
61
|
switch (f) {
|
|
62
|
-
case
|
|
62
|
+
case w:
|
|
63
63
|
return "Fragment";
|
|
64
64
|
case k:
|
|
65
65
|
return "Profiler";
|
|
@@ -69,7 +69,7 @@ function xt() {
|
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case H:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case g:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof f == "object")
|
|
@@ -117,7 +117,7 @@ function xt() {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function a(f) {
|
|
120
|
-
if (f ===
|
|
120
|
+
if (f === w) return "<>";
|
|
121
121
|
if (typeof f == "object" && f !== null && f.$$typeof === W)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
function h(f) {
|
|
247
247
|
return typeof f == "object" && f !== null && f.$$typeof === v;
|
|
248
248
|
}
|
|
249
|
-
var c = V, v = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"),
|
|
249
|
+
var c = V, v = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), w = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), j = Symbol.for("react.consumer"), S = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), g = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), K = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, x = Array.isArray, b = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
c = {
|
|
@@ -258,7 +258,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
258
258
|
c,
|
|
259
259
|
r
|
|
260
260
|
)(), G = b(a(r)), T = {};
|
|
261
|
-
xe.Fragment =
|
|
261
|
+
xe.Fragment = w, xe.jsx = function(f, $, z) {
|
|
262
262
|
var F = 1e4 > K.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return m(
|
|
264
264
|
f,
|
|
@@ -281,8 +281,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
281
281
|
};
|
|
282
282
|
}()), xe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
284
|
+
process.env.NODE_ENV === "production" ? we.exports = ht() : we.exports = xt();
|
|
285
|
+
var e = we.exports;
|
|
286
286
|
function vt({ size: t = "m", color: s = "default", className: n = "", ...a }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
@@ -310,7 +310,7 @@ function ae({
|
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const c = o && !t, v = i === "loading", _ = i === "success",
|
|
313
|
+
const c = o && !t, v = i === "loading", _ = i === "success", w = i === "error", y = v || _ || w, k = n === "xs" ? "s" : "m", j = s === "danger" ? "on-accent" : "default", S = _t[n] ?? 16, M = v ? /* @__PURE__ */ e.jsx(vt, { size: k, color: j }) : _ ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx($e, { size: S, strokeWidth: 2.5 }) }) : w ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ee, { size: S, strokeWidth: 2.5 }) }) : null, D = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${s}`,
|
|
316
316
|
`ds-button--${n}`,
|
|
@@ -322,12 +322,12 @@ function ae({
|
|
|
322
322
|
t
|
|
323
323
|
] });
|
|
324
324
|
if (d) {
|
|
325
|
-
const W = (
|
|
325
|
+
const W = (g) => {
|
|
326
326
|
if (r || v) {
|
|
327
|
-
|
|
327
|
+
g.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
g.metaKey || g.ctrlKey || g.button === 1 || (g.preventDefault(), l == null || l(g));
|
|
331
331
|
};
|
|
332
332
|
return /* @__PURE__ */ e.jsx(
|
|
333
333
|
"a",
|
|
@@ -448,7 +448,7 @@ function ls({
|
|
|
448
448
|
id: d,
|
|
449
449
|
...m
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = A(!1), [c, v] = A(!1), [_,
|
|
451
|
+
const [p, h] = A(!1), [c, v] = A(!1), [_, w] = A({}), [y, k] = A("down"), [j, S] = A(-1), M = R(null), D = R(null), H = R(null), q = R(null), W = d || `select-${V.useId()}`, g = `${W}-label`, O = r ? `${W}-error` : void 0, K = 150, C = (T = !1) => {
|
|
452
452
|
c || (v(!0), S(-1), q.current = setTimeout(() => {
|
|
453
453
|
var f;
|
|
454
454
|
h(!1), v(!1), T && ((f = H.current) == null || f.focus());
|
|
@@ -464,7 +464,7 @@ function ls({
|
|
|
464
464
|
const T = (oe = M.current) == null ? void 0 : oe.getBoundingClientRect();
|
|
465
465
|
if (!T) return;
|
|
466
466
|
const f = window.innerHeight, $ = f - T.bottom, z = T.top, ne = $ < 300 && z > $;
|
|
467
|
-
k(ne ? "up" : "down"),
|
|
467
|
+
k(ne ? "up" : "down"), w(
|
|
468
468
|
ne ? { bottom: f - T.top + 4, left: T.left, width: T.width } : { top: T.bottom + 4, left: T.left, width: T.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
@@ -514,7 +514,7 @@ function ls({
|
|
|
514
514
|
ref: D,
|
|
515
515
|
"data-ds-portal": "",
|
|
516
516
|
role: "listbox",
|
|
517
|
-
"aria-labelledby": t ?
|
|
517
|
+
"aria-labelledby": t ? g : void 0,
|
|
518
518
|
tabIndex: -1,
|
|
519
519
|
className: [
|
|
520
520
|
"ds-select-dropdown ds-scrollable",
|
|
@@ -547,7 +547,7 @@ function ls({
|
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
549
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${u ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
550
|
-
t && /* @__PURE__ */ e.jsx("label", { id:
|
|
550
|
+
t && /* @__PURE__ */ e.jsx("label", { id: g, className: "ds-select-label", children: t }),
|
|
551
551
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: M, children: /* @__PURE__ */ e.jsxs(
|
|
552
552
|
"button",
|
|
553
553
|
{
|
|
@@ -558,7 +558,7 @@ function ls({
|
|
|
558
558
|
"aria-haspopup": "listbox",
|
|
559
559
|
"aria-expanded": p,
|
|
560
560
|
"aria-activedescendant": p && j >= 0 ? `${W}-opt-${j}` : void 0,
|
|
561
|
-
"aria-labelledby": t ?
|
|
561
|
+
"aria-labelledby": t ? g : void 0,
|
|
562
562
|
"aria-invalid": r ? "true" : "false",
|
|
563
563
|
"aria-describedby": O,
|
|
564
564
|
className: `ds-select-trigger ds-select-trigger--${l} ${r ? "ds-select-trigger--error" : ""}`,
|
|
@@ -627,7 +627,7 @@ function cs({
|
|
|
627
627
|
"ds-stepper",
|
|
628
628
|
`ds-stepper--${i}`,
|
|
629
629
|
l && "ds-stepper--disabled"
|
|
630
|
-
].filter(Boolean).join(" "),
|
|
630
|
+
].filter(Boolean).join(" "), w = i === "xs" ? P[1] : i === "small" ? P[2] : P[3];
|
|
631
631
|
return /* @__PURE__ */ e.jsxs("div", { className: v, children: [
|
|
632
632
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
633
633
|
/* @__PURE__ */ e.jsxs("div", { className: _, children: [
|
|
@@ -639,7 +639,7 @@ function cs({
|
|
|
639
639
|
onClick: h,
|
|
640
640
|
disabled: l || s <= a,
|
|
641
641
|
"aria-label": "Decrease",
|
|
642
|
-
children: /* @__PURE__ */ e.jsx(et, { size:
|
|
642
|
+
children: /* @__PURE__ */ e.jsx(et, { size: w, strokeWidth: 1.5 })
|
|
643
643
|
}
|
|
644
644
|
),
|
|
645
645
|
/* @__PURE__ */ e.jsx(
|
|
@@ -664,7 +664,7 @@ function cs({
|
|
|
664
664
|
onClick: p,
|
|
665
665
|
disabled: l || s >= o,
|
|
666
666
|
"aria-label": "Increase",
|
|
667
|
-
children: /* @__PURE__ */ e.jsx(tt, { size:
|
|
667
|
+
children: /* @__PURE__ */ e.jsx(tt, { size: w, strokeWidth: 1.5 })
|
|
668
668
|
}
|
|
669
669
|
)
|
|
670
670
|
] }),
|
|
@@ -810,13 +810,13 @@ function vs({
|
|
|
810
810
|
B(() => {
|
|
811
811
|
const _ = (y) => {
|
|
812
812
|
y.key === "Escape" && p();
|
|
813
|
-
},
|
|
813
|
+
}, w = (y) => {
|
|
814
814
|
var j, S, M;
|
|
815
815
|
const k = ((S = (j = y.composedPath) == null ? void 0 : j.call(y)) == null ? void 0 : S[0]) ?? y.target;
|
|
816
816
|
l.current && !l.current.contains(k) && !((M = k.closest) != null && M.call(k, "[data-ds-portal]")) && p();
|
|
817
817
|
};
|
|
818
|
-
return document.addEventListener("keydown", _), document.addEventListener("mousedown",
|
|
819
|
-
document.removeEventListener("keydown", _), document.removeEventListener("mousedown",
|
|
818
|
+
return document.addEventListener("keydown", _), document.addEventListener("mousedown", w), () => {
|
|
819
|
+
document.removeEventListener("keydown", _), document.removeEventListener("mousedown", w);
|
|
820
820
|
};
|
|
821
821
|
}, [n, d]);
|
|
822
822
|
const h = V.Children.toArray(t), c = h.find((_) => (_ == null ? void 0 : _.type) === fe), v = h.filter((_) => (_ == null ? void 0 : _.type) !== fe);
|
|
@@ -853,7 +853,7 @@ function vs({
|
|
|
853
853
|
function fe({ children: t }) {
|
|
854
854
|
return !t || V.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
|
|
855
855
|
}
|
|
856
|
-
const
|
|
856
|
+
const gt = 320;
|
|
857
857
|
function _s({
|
|
858
858
|
children: t,
|
|
859
859
|
title: s,
|
|
@@ -864,15 +864,15 @@ function _s({
|
|
|
864
864
|
const r = R(null), i = V.useId(), [l, u] = A(!1), d = () => {
|
|
865
865
|
!n || l || (u(!0), setTimeout(() => {
|
|
866
866
|
u(!1), n();
|
|
867
|
-
},
|
|
867
|
+
}, gt));
|
|
868
868
|
};
|
|
869
869
|
B(() => {
|
|
870
870
|
const c = (_) => {
|
|
871
871
|
_.key === "Escape" && d();
|
|
872
872
|
}, v = (_) => {
|
|
873
873
|
var y, k, j;
|
|
874
|
-
const
|
|
875
|
-
r.current && !r.current.contains(
|
|
874
|
+
const w = ((k = (y = _.composedPath) == null ? void 0 : y.call(_)) == null ? void 0 : k[0]) ?? _.target;
|
|
875
|
+
r.current && !r.current.contains(w) && !((j = w.closest) != null && j.call(w, "[data-ds-portal]")) && d();
|
|
876
876
|
};
|
|
877
877
|
return document.addEventListener("keydown", c), document.addEventListener("mousedown", v), () => {
|
|
878
878
|
document.removeEventListener("keydown", c), document.removeEventListener("mousedown", v);
|
|
@@ -917,7 +917,7 @@ function _s({
|
|
|
917
917
|
}
|
|
918
918
|
);
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function wt({
|
|
921
921
|
children: t,
|
|
922
922
|
title: s = "Code",
|
|
923
923
|
defaultExpanded: n = !1,
|
|
@@ -960,7 +960,7 @@ function gt({
|
|
|
960
960
|
] });
|
|
961
961
|
}
|
|
962
962
|
function bs({ children: t, block: s = !1, collapsible: n = !1, title: a = "Code", defaultExpanded: o = !1, ...r }) {
|
|
963
|
-
return s ? n ? /* @__PURE__ */ e.jsx(
|
|
963
|
+
return s ? n ? /* @__PURE__ */ e.jsx(wt, { title: a, defaultExpanded: o, ...r, children: t }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...r, children: /* @__PURE__ */ e.jsx("code", { children: t }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...r, children: t });
|
|
964
964
|
}
|
|
965
965
|
function js({ href: t, children: s, onClick: n, target: a, rel: o, ...r }) {
|
|
966
966
|
const l = a === "_blank" ? o ? `${o} noopener noreferrer` : "noopener noreferrer" : o;
|
|
@@ -980,7 +980,7 @@ function js({ href: t, children: s, onClick: n, target: a, rel: o, ...r }) {
|
|
|
980
980
|
function Ns({ children: t, size: s = "m", variant: n = "ghost", ...a }) {
|
|
981
981
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...a, children: V.Children.map(t, (o) => V.isValidElement(o) ? V.cloneElement(o, { size: s, variant: n }) : o) });
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function gs({ children: t, selected: s = !1, onClick: n, size: a = "m", variant: o = "ghost", disabled: r = !1, icon: i, href: l, ...u }) {
|
|
984
984
|
const d = i && !t, m = [
|
|
985
985
|
"ds-tab",
|
|
986
986
|
`ds-tab--${a}`,
|
|
@@ -1026,13 +1026,13 @@ function ws({ children: t, selected: s = !1, onClick: n, size: a = "m", variant:
|
|
|
1026
1026
|
}
|
|
1027
1027
|
);
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1029
|
+
function ws({ options: t, value: s, onChange: n, size: a = "m", disabled: o = !1 }) {
|
|
1030
1030
|
const r = R(null), i = R(null), [l, u] = A(!1), d = R(!1), m = R(null), p = R(null), h = () => {
|
|
1031
1031
|
if (!r.current) return;
|
|
1032
1032
|
const c = r.current.querySelector(`[data-value="${s}"]`);
|
|
1033
1033
|
if (!c) return;
|
|
1034
|
-
const v = r.current.getBoundingClientRect(), _ = c.getBoundingClientRect(),
|
|
1035
|
-
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left =
|
|
1034
|
+
const v = r.current.getBoundingClientRect(), _ = c.getBoundingClientRect(), w = _.left - v.left, y = _.width;
|
|
1035
|
+
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = w + "px", i.current.style.width = y + "px", d.current = !1) : (u(!0), requestAnimationFrame(() => {
|
|
1036
1036
|
if (!i.current || !r.current) return;
|
|
1037
1037
|
const k = r.current.querySelector(`[data-value="${s}"]`);
|
|
1038
1038
|
if (!k) return;
|
|
@@ -1163,7 +1163,7 @@ function kt(t, s, n) {
|
|
|
1163
1163
|
function Ke({ children: t, content: s, position: n, ...a }) {
|
|
1164
1164
|
const [o, r] = A(!1), [i, l] = A({ visibility: "hidden" }), [u, d] = A(n || "top"), m = R(null), p = R(null), h = R(!1), c = () => {
|
|
1165
1165
|
if (!m.current || !p.current) return;
|
|
1166
|
-
const _ = m.current.getBoundingClientRect(),
|
|
1166
|
+
const _ = m.current.getBoundingClientRect(), w = p.current.getBoundingClientRect(), y = n || kt(_, w.height, w.width), { top: k, left: j, arrowOffset: S } = yt(y, _, w);
|
|
1167
1167
|
d(y), l({
|
|
1168
1168
|
position: "fixed",
|
|
1169
1169
|
top: k,
|
|
@@ -1181,8 +1181,8 @@ function Ke({ children: t, content: s, position: n, ...a }) {
|
|
|
1181
1181
|
};
|
|
1182
1182
|
}, [o, n]), B(() => {
|
|
1183
1183
|
if (!o) return;
|
|
1184
|
-
const _ = (
|
|
1185
|
-
m.current && !m.current.contains(
|
|
1184
|
+
const _ = (w) => {
|
|
1185
|
+
m.current && !m.current.contains(w.target) && r(!1);
|
|
1186
1186
|
};
|
|
1187
1187
|
return document.addEventListener("touchstart", _), () => document.removeEventListener("touchstart", _);
|
|
1188
1188
|
}, [o]), !s) return t;
|
|
@@ -1655,8 +1655,8 @@ function Cs({
|
|
|
1655
1655
|
_.key === "Escape" && d();
|
|
1656
1656
|
}, v = (_) => {
|
|
1657
1657
|
var y, k, j;
|
|
1658
|
-
const
|
|
1659
|
-
r.current && !r.current.contains(
|
|
1658
|
+
const w = ((k = (y = _.composedPath) == null ? void 0 : y.call(_)) == null ? void 0 : k[0]) ?? _.target;
|
|
1659
|
+
r.current && !r.current.contains(w) && !((j = w.closest) != null && j.call(w, "[data-ds-portal]")) && d();
|
|
1660
1660
|
};
|
|
1661
1661
|
return document.addEventListener("keydown", c), document.addEventListener("mousedown", v), () => {
|
|
1662
1662
|
document.removeEventListener("keydown", c), document.removeEventListener("mousedown", v);
|
|
@@ -1711,8 +1711,8 @@ function Fs({
|
|
|
1711
1711
|
_.key === "Escape" && d();
|
|
1712
1712
|
}, v = (_) => {
|
|
1713
1713
|
var y, k, j;
|
|
1714
|
-
const
|
|
1715
|
-
r.current && !r.current.contains(
|
|
1714
|
+
const w = ((k = (y = _.composedPath) == null ? void 0 : y.call(_)) == null ? void 0 : k[0]) ?? _.target;
|
|
1715
|
+
r.current && !r.current.contains(w) && !((j = w.closest) != null && j.call(w, "[data-ds-portal]")) && d();
|
|
1716
1716
|
};
|
|
1717
1717
|
return document.addEventListener("keydown", c), document.addEventListener("mousedown", v), () => {
|
|
1718
1718
|
document.removeEventListener("keydown", c), document.removeEventListener("mousedown", v);
|
|
@@ -1789,7 +1789,7 @@ function Us({
|
|
|
1789
1789
|
className: m = "",
|
|
1790
1790
|
...p
|
|
1791
1791
|
}) {
|
|
1792
|
-
const { collapsed: h, side: c } = Ee(be),
|
|
1792
|
+
const { collapsed: h, side: c } = Ee(be), w = {
|
|
1793
1793
|
className: [
|
|
1794
1794
|
"ds-nav-rail__item",
|
|
1795
1795
|
m
|
|
@@ -1812,7 +1812,7 @@ function Us({
|
|
|
1812
1812
|
!h && l && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
|
|
1813
1813
|
!h && y && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
|
|
1814
1814
|
h && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
1815
|
-
] }), S = o ? /* @__PURE__ */ e.jsx("a", { href: a ? void 0 : o, ...
|
|
1815
|
+
] }), S = o ? /* @__PURE__ */ e.jsx("a", { href: a ? void 0 : o, ...w, children: j }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...w, children: j });
|
|
1816
1816
|
return h ? /* @__PURE__ */ e.jsx(Ke, { content: s, position: k, children: S }) : S;
|
|
1817
1817
|
}
|
|
1818
1818
|
function Vs({ children: t, className: s = "", ...n }) {
|
|
@@ -1926,7 +1926,7 @@ function Js({
|
|
|
1926
1926
|
style: i,
|
|
1927
1927
|
...l
|
|
1928
1928
|
}) {
|
|
1929
|
-
const [u, d] = A(!1), [m, p] = A(!1), h = n !== void 0, c = h ? n : u, v = R(null), _ = R(null),
|
|
1929
|
+
const [u, d] = A(!1), [m, p] = A(!1), h = n !== void 0, c = h ? n : u, v = R(null), _ = R(null), w = R(null), y = R(null), [k, j] = A({}), S = R(null), M = 150, D = () => {
|
|
1930
1930
|
if (h)
|
|
1931
1931
|
a == null || a(!1);
|
|
1932
1932
|
else {
|
|
@@ -1958,7 +1958,7 @@ function Js({
|
|
|
1958
1958
|
}, [c, o]);
|
|
1959
1959
|
const W = () => {
|
|
1960
1960
|
var b;
|
|
1961
|
-
const x = (b =
|
|
1961
|
+
const x = (b = w.current) == null ? void 0 : b.querySelector(
|
|
1962
1962
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
1963
1963
|
);
|
|
1964
1964
|
x == null || x.focus();
|
|
@@ -1976,25 +1976,25 @@ function Js({
|
|
|
1976
1976
|
};
|
|
1977
1977
|
}, [c]), B(() => {
|
|
1978
1978
|
if (!c || !y.current || !_.current) return;
|
|
1979
|
-
const x =
|
|
1979
|
+
const x = g(), b = y.current === "last" ? x[x.length - 1] : x[0];
|
|
1980
1980
|
b == null || b.focus(), y.current = null;
|
|
1981
1981
|
}, [c]);
|
|
1982
|
-
const
|
|
1982
|
+
const g = () => _.current ? [..._.current.querySelectorAll(
|
|
1983
1983
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1984
1984
|
)] : [], O = (x) => {
|
|
1985
1985
|
var b, E;
|
|
1986
1986
|
if (x.key === "ArrowDown")
|
|
1987
|
-
x.preventDefault(), c ? (b =
|
|
1987
|
+
x.preventDefault(), c ? (b = g()[0]) == null || b.focus() : (y.current = "first", q());
|
|
1988
1988
|
else if (x.key === "ArrowUp")
|
|
1989
1989
|
if (x.preventDefault(), !c)
|
|
1990
1990
|
y.current = "last", q();
|
|
1991
1991
|
else {
|
|
1992
|
-
const L =
|
|
1992
|
+
const L = g();
|
|
1993
1993
|
(E = L[L.length - 1]) == null || E.focus();
|
|
1994
1994
|
}
|
|
1995
1995
|
}, K = (x) => {
|
|
1996
1996
|
var L, U, G, T;
|
|
1997
|
-
const b =
|
|
1997
|
+
const b = g(), E = b.findIndex((f) => f === document.activeElement);
|
|
1998
1998
|
switch (x.key) {
|
|
1999
1999
|
case "ArrowDown":
|
|
2000
2000
|
x.preventDefault(), (L = b[Math.min(E + 1, b.length - 1)]) == null || L.focus();
|
|
@@ -2069,7 +2069,7 @@ function Js({
|
|
|
2069
2069
|
/* @__PURE__ */ e.jsx(
|
|
2070
2070
|
"div",
|
|
2071
2071
|
{
|
|
2072
|
-
ref:
|
|
2072
|
+
ref: w,
|
|
2073
2073
|
className: "ds-dropdown__trigger",
|
|
2074
2074
|
onClick: H,
|
|
2075
2075
|
onKeyDown: O,
|
|
@@ -2468,11 +2468,11 @@ function Ut({
|
|
|
2468
2468
|
v.current && clearTimeout(v.current);
|
|
2469
2469
|
};
|
|
2470
2470
|
}, [s, t, n, a, o, r]);
|
|
2471
|
-
const
|
|
2471
|
+
const w = (S) => {
|
|
2472
2472
|
if (t.length === 0) return;
|
|
2473
2473
|
const M = (S % t.length + t.length) % t.length, D = t[M];
|
|
2474
2474
|
c.current = M, h.current = D.length, p.current = "holding", _.current = Date.now() + i, u(M), m(D);
|
|
2475
|
-
}, y = () =>
|
|
2475
|
+
}, y = () => w(c.current + 1), k = () => w(c.current - 1), j = t[l % t.length] ?? "";
|
|
2476
2476
|
return { displayed: d, currentPrompt: j, index: l, next: y, prev: k };
|
|
2477
2477
|
}
|
|
2478
2478
|
let Vt = 0;
|
|
@@ -2493,7 +2493,7 @@ function dn({
|
|
|
2493
2493
|
onRemoveAttachment: c,
|
|
2494
2494
|
onRemoveImage: v,
|
|
2495
2495
|
acceptImage: _,
|
|
2496
|
-
acceptFile:
|
|
2496
|
+
acceptFile: w,
|
|
2497
2497
|
maxImages: y,
|
|
2498
2498
|
maxImageSize: k,
|
|
2499
2499
|
leftSlot: j,
|
|
@@ -2501,10 +2501,10 @@ function dn({
|
|
|
2501
2501
|
className: M = "",
|
|
2502
2502
|
...D
|
|
2503
2503
|
}) {
|
|
2504
|
-
const H = R(null), q = R(null), W = R(0), [
|
|
2504
|
+
const H = R(null), q = R(null), W = R(0), [g, O] = A(!1), [K, C] = A([]), x = (N) => {
|
|
2505
2505
|
const I = ++Vt;
|
|
2506
2506
|
C((X) => [...X, { id: I, msg: N }]), setTimeout(() => C((X) => X.filter((J) => J.id !== I)), 6e3);
|
|
2507
|
-
}, b = (N) => C((I) => I.filter((X) => X.id !== N)), E = (N) => N.type.startsWith("image/"), L = () => !0, U = _ ?? E, G =
|
|
2507
|
+
}, b = (N) => C((I) => I.filter((X) => X.id !== N)), E = (N) => N.type.startsWith("image/"), L = () => !0, U = _ ?? E, G = w ?? L, T = (N) => {
|
|
2508
2508
|
const I = [], X = [], J = [], Z = [];
|
|
2509
2509
|
let te = 0, ce = y != null ? y - ((m == null ? void 0 : m.length) ?? 0) : 1 / 0;
|
|
2510
2510
|
for (const se of N)
|
|
@@ -2587,13 +2587,13 @@ function dn({
|
|
|
2587
2587
|
/* @__PURE__ */ e.jsxs(
|
|
2588
2588
|
"div",
|
|
2589
2589
|
{
|
|
2590
|
-
className: ["ds-prompt-input__box",
|
|
2590
|
+
className: ["ds-prompt-input__box", g && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2591
2591
|
onDragEnter: $,
|
|
2592
2592
|
onDragLeave: z,
|
|
2593
2593
|
onDragOver: F,
|
|
2594
2594
|
onDrop: ne,
|
|
2595
2595
|
children: [
|
|
2596
|
-
|
|
2596
|
+
g && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2597
2597
|
/* @__PURE__ */ e.jsx(
|
|
2598
2598
|
"textarea",
|
|
2599
2599
|
{
|
|
@@ -2706,14 +2706,14 @@ function un({
|
|
|
2706
2706
|
className: l = "",
|
|
2707
2707
|
...u
|
|
2708
2708
|
}) {
|
|
2709
|
-
const [d, m] = A(!1), p = R(null), h = R(null), c = R(null), [v, _] = A({}),
|
|
2709
|
+
const [d, m] = A(!1), p = R(null), h = R(null), c = R(null), [v, _] = A({}), w = t.filter((g) => !o || g.name === "auto" ? !0 : (We[g.tier] ?? 1) >= (We[o] ?? 1)), y = w.find((g) => g.name === "auto"), k = w.filter((g) => g.name !== "auto"), j = t.find((g) => g.name === s), M = new Set(k.map((g) => g.tier).filter(Boolean)).size > 1;
|
|
2710
2710
|
B(() => {
|
|
2711
2711
|
if (!d) return;
|
|
2712
|
-
const
|
|
2712
|
+
const g = 320, O = () => {
|
|
2713
2713
|
var L;
|
|
2714
2714
|
const x = (L = h.current) == null ? void 0 : L.getBoundingClientRect();
|
|
2715
2715
|
if (!x) return;
|
|
2716
|
-
const b = window.innerHeight - x.bottom, E = b <
|
|
2716
|
+
const b = window.innerHeight - x.bottom, E = b < g + 8 && x.top > b;
|
|
2717
2717
|
_({
|
|
2718
2718
|
position: "fixed",
|
|
2719
2719
|
zIndex: "var(--z-dropdown, 500)",
|
|
@@ -2732,28 +2732,28 @@ function un({
|
|
|
2732
2732
|
window.removeEventListener("scroll", O, !0), window.removeEventListener("resize", O), document.removeEventListener("mousedown", K), document.removeEventListener("keydown", C);
|
|
2733
2733
|
};
|
|
2734
2734
|
}, [d]);
|
|
2735
|
-
const D = (
|
|
2736
|
-
n == null || n(
|
|
2737
|
-
}, H = (
|
|
2735
|
+
const D = (g) => {
|
|
2736
|
+
n == null || n(g), m(!1);
|
|
2737
|
+
}, H = (g) => /* @__PURE__ */ e.jsxs(
|
|
2738
2738
|
"button",
|
|
2739
2739
|
{
|
|
2740
2740
|
type: "button",
|
|
2741
2741
|
className: [
|
|
2742
2742
|
"ds-model-picker__item",
|
|
2743
|
-
|
|
2743
|
+
g.name === s && "ds-model-picker__item--active"
|
|
2744
2744
|
].filter(Boolean).join(" "),
|
|
2745
|
-
onClick: () => D(
|
|
2745
|
+
onClick: () => D(g.name),
|
|
2746
2746
|
children: [
|
|
2747
|
-
|
|
2748
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
2749
|
-
M &&
|
|
2747
|
+
g.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: g.icon }) : /* @__PURE__ */ e.jsx(Pe, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2748
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: g.displayName || g.name }),
|
|
2749
|
+
M && g.tier && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Ue[g.tier] || "default", children: g.tier })
|
|
2750
2750
|
]
|
|
2751
2751
|
},
|
|
2752
|
-
|
|
2753
|
-
), q = () => !i || !M ? k.map(H) : ["fast", "standard", "premium"].flatMap((
|
|
2754
|
-
const O = k.filter((K) => K.tier ===
|
|
2752
|
+
g.name
|
|
2753
|
+
), q = () => !i || !M ? k.map(H) : ["fast", "standard", "premium"].flatMap((g) => {
|
|
2754
|
+
const O = k.filter((K) => K.tier === g);
|
|
2755
2755
|
return O.length ? [
|
|
2756
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
2756
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": g, children: g.charAt(0).toUpperCase() + g.slice(1) }, `lbl-${g}`),
|
|
2757
2757
|
...O.map(H)
|
|
2758
2758
|
] : [];
|
|
2759
2759
|
}), W = d && /* @__PURE__ */ e.jsxs("div", { ref: c, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: v, children: [
|
|
@@ -2791,7 +2791,7 @@ function un({
|
|
|
2791
2791
|
ref: h,
|
|
2792
2792
|
type: "button",
|
|
2793
2793
|
className: "ds-model-picker__trigger",
|
|
2794
|
-
onClick: () => m((
|
|
2794
|
+
onClick: () => m((g) => !g),
|
|
2795
2795
|
"aria-haspopup": "listbox",
|
|
2796
2796
|
"aria-expanded": d,
|
|
2797
2797
|
children: [
|
|
@@ -2858,14 +2858,14 @@ function fn({
|
|
|
2858
2858
|
{
|
|
2859
2859
|
title: /* @__PURE__ */ e.jsx(Yt, { filename: h.filename, pages: c }),
|
|
2860
2860
|
padding: "s",
|
|
2861
|
-
children: h.items.map((_,
|
|
2861
|
+
children: h.items.map((_, w) => /* @__PURE__ */ e.jsx(
|
|
2862
2862
|
"div",
|
|
2863
2863
|
{
|
|
2864
2864
|
className: `ds-sources-panel__snippet${v ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2865
2865
|
onClick: v ? () => o(_) : void 0,
|
|
2866
2866
|
children: _.snippet ?? `p. ${_.page}`
|
|
2867
2867
|
},
|
|
2868
|
-
|
|
2868
|
+
w
|
|
2869
2869
|
))
|
|
2870
2870
|
},
|
|
2871
2871
|
h.filename
|
|
@@ -2923,7 +2923,7 @@ function mn({
|
|
|
2923
2923
|
" / ",
|
|
2924
2924
|
Ve(s)
|
|
2925
2925
|
] }),
|
|
2926
|
-
o && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2926
|
+
o && /* @__PURE__ */ e.jsxs("span", { style: { marginLeft: "auto" }, children: [
|
|
2927
2927
|
Math.round(l * 100),
|
|
2928
2928
|
"%"
|
|
2929
2929
|
] })
|
|
@@ -3152,7 +3152,7 @@ function bn({ children: t, axis: s = "y", style: n, className: a = "", ...o }) {
|
|
|
3152
3152
|
}
|
|
3153
3153
|
);
|
|
3154
3154
|
}
|
|
3155
|
-
const
|
|
3155
|
+
const ge = 280, Jt = 22, Zt = 14, le = 8, _e = 6, Qt = 200;
|
|
3156
3156
|
function es(t) {
|
|
3157
3157
|
return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
|
|
3158
3158
|
}
|
|
@@ -3200,19 +3200,19 @@ function jn({
|
|
|
3200
3200
|
statePrimary: h = "idle",
|
|
3201
3201
|
stateBack: c = "idle"
|
|
3202
3202
|
}) {
|
|
3203
|
-
const v = R(null), _ = R(t),
|
|
3204
|
-
_.current = t,
|
|
3205
|
-
const [k, j] = A(!1), [S, M] = A({ position: "fixed", visibility: "hidden", width:
|
|
3206
|
-
const x = _.current[
|
|
3203
|
+
const v = R(null), _ = R(t), w = R(s), y = R(l);
|
|
3204
|
+
_.current = t, w.current = s, y.current = l;
|
|
3205
|
+
const [k, j] = A(!1), [S, M] = A({ position: "fixed", visibility: "hidden", width: ge }), [D, H] = A("bottom"), [q, W] = A(null), g = R(!1), O = t[s], K = s === t.length - 1, C = qe(() => {
|
|
3206
|
+
const x = _.current[w.current];
|
|
3207
3207
|
if (!x || !v.current) return;
|
|
3208
3208
|
const b = es(x.target);
|
|
3209
3209
|
if (!b) return;
|
|
3210
|
-
const E = b.getBoundingClientRect(), U = v.current.getBoundingClientRect().height || 160, G =
|
|
3210
|
+
const E = b.getBoundingClientRect(), U = v.current.getBoundingClientRect().height || 160, G = ge, T = y.current ? Jt : Zt, f = x.position || ts(E, U, G, T), { top: $, left: z, arrowOffset: F } = ss(f, E, U, G, T);
|
|
3211
3211
|
H(f), M({
|
|
3212
3212
|
position: "fixed",
|
|
3213
3213
|
top: $,
|
|
3214
3214
|
left: z,
|
|
3215
|
-
width:
|
|
3215
|
+
width: ge,
|
|
3216
3216
|
visibility: "visible",
|
|
3217
3217
|
"--arrow-offset": `${F}px`
|
|
3218
3218
|
}), W({
|
|
@@ -3225,13 +3225,13 @@ function jn({
|
|
|
3225
3225
|
return B(() => {
|
|
3226
3226
|
window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
3227
3227
|
const x = requestAnimationFrame(() => {
|
|
3228
|
-
C(), j(!0),
|
|
3228
|
+
C(), j(!0), g.current = !0;
|
|
3229
3229
|
});
|
|
3230
3230
|
return () => {
|
|
3231
3231
|
cancelAnimationFrame(x), window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C);
|
|
3232
3232
|
};
|
|
3233
3233
|
}, []), B(() => {
|
|
3234
|
-
if (!
|
|
3234
|
+
if (!g.current) return;
|
|
3235
3235
|
j(!1);
|
|
3236
3236
|
const x = setTimeout(() => {
|
|
3237
3237
|
M((b) => ({ ...b, visibility: "hidden" })), requestAnimationFrame(() => {
|
|
@@ -3351,7 +3351,7 @@ export {
|
|
|
3351
3351
|
ks as Checkbox,
|
|
3352
3352
|
jn as Coachmark,
|
|
3353
3353
|
bs as Code,
|
|
3354
|
-
|
|
3354
|
+
wt as CodeAccordion,
|
|
3355
3355
|
pn as ConfidenceBar,
|
|
3356
3356
|
Wt as CopyButton,
|
|
3357
3357
|
hn as DiffView,
|
|
@@ -3390,7 +3390,7 @@ export {
|
|
|
3390
3390
|
Es as Radio,
|
|
3391
3391
|
rn as ReasoningBlock,
|
|
3392
3392
|
bn as Scrollable,
|
|
3393
|
-
|
|
3393
|
+
ws as SegmentedControl,
|
|
3394
3394
|
ls as Select,
|
|
3395
3395
|
Fs as SidePage,
|
|
3396
3396
|
Ce as SidePageFooter,
|
|
@@ -3401,7 +3401,7 @@ export {
|
|
|
3401
3401
|
an as StepIndicator,
|
|
3402
3402
|
cs as Stepper,
|
|
3403
3403
|
on as StreamingText,
|
|
3404
|
-
|
|
3404
|
+
gs as Tab,
|
|
3405
3405
|
Ts as Table,
|
|
3406
3406
|
Ss as TableBody,
|
|
3407
3407
|
Rs as TableHead,
|