@donkit-ai/design-system 1.4.57 → 1.4.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +9 -0
- package/dist/index.es.js +86 -75
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import V, { useState as A, useRef as R, useEffect as B, useLayoutEffect as Ze, useContext as Ee, createContext as Qe, useCallback as
|
|
2
|
-
import { Check as
|
|
1
|
+
import V, { useState as A, useRef as R, useEffect as B, useLayoutEffect as Ze, useContext as Ee, createContext as Qe, useCallback as $e } from "react";
|
|
2
|
+
import { Check as Te, X as ee, ChevronDown as ve, Minus as et, Plus as tt, XCircle as Re, AlertTriangle as Se, CheckCircle as Ae, Info as Ie, ChevronUp as st, ChevronsUpDown as nt, ChevronLeft as rt, ChevronRight as at, Copy as ot, Brain as it, Loader as lt, Paperclip as Pe, Square as ct, ArrowUp as dt, Zap as ut, Cpu as Me, FileText as ft, ThumbsUp as mt, ThumbsDown as pt } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const P = {
|
|
5
5
|
1: 16,
|
|
@@ -18,10 +18,10 @@ var ge = { exports: {} }, he = {};
|
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
21
|
+
var ze;
|
|
22
22
|
function ht() {
|
|
23
|
-
if (
|
|
24
|
-
|
|
23
|
+
if (ze) return he;
|
|
24
|
+
ze = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
26
26
|
function n(a, o, r) {
|
|
27
27
|
var i = null;
|
|
@@ -50,9 +50,9 @@ var xe = {};
|
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
|
-
var
|
|
53
|
+
var Oe;
|
|
54
54
|
function xt() {
|
|
55
|
-
return
|
|
55
|
+
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function t(f) {
|
|
57
57
|
if (f == null) return null;
|
|
58
58
|
if (typeof f == "function")
|
|
@@ -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", g = i === "error", y = v || _ || g, 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(
|
|
313
|
+
const c = o && !t, v = i === "loading", _ = i === "success", g = i === "error", y = v || _ || g, 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(Te, { size: S, strokeWidth: 2.5 }) }) : g ? /* @__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}`,
|
|
@@ -760,39 +760,37 @@ function de({
|
|
|
760
760
|
return /* @__PURE__ */ e.jsx("span", { className: r, role: i, ...o, children: t });
|
|
761
761
|
}
|
|
762
762
|
const jt = {
|
|
763
|
-
info:
|
|
764
|
-
success:
|
|
765
|
-
warning:
|
|
766
|
-
error:
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
i && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(i, { size: P[3], strokeWidth: 1.5 }) }),
|
|
763
|
+
info: Ie,
|
|
764
|
+
success: Ae,
|
|
765
|
+
warning: Se,
|
|
766
|
+
error: Re
|
|
767
|
+
}, xs = V.forwardRef(function({
|
|
768
|
+
children: s,
|
|
769
|
+
variant: n = "info",
|
|
770
|
+
title: a,
|
|
771
|
+
onClose: o,
|
|
772
|
+
role: r,
|
|
773
|
+
...i
|
|
774
|
+
}, l) {
|
|
775
|
+
const u = jt[n], d = r || (n === "error" ? "alert" : "status");
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: `ds-alert ds-alert--${n} ${a ? "" : "ds-alert--no-title"}`, role: d, ...i, children: [
|
|
777
|
+
u && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(u, { size: P[3], strokeWidth: 1.5 }) }),
|
|
779
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
780
|
-
|
|
781
|
-
|
|
779
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: a }),
|
|
780
|
+
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
782
781
|
] }),
|
|
783
|
-
|
|
782
|
+
o && /* @__PURE__ */ e.jsx(
|
|
784
783
|
"button",
|
|
785
784
|
{
|
|
786
785
|
type: "button",
|
|
787
786
|
className: "ds-alert__close",
|
|
788
|
-
onClick:
|
|
787
|
+
onClick: o,
|
|
789
788
|
"aria-label": "Close alert",
|
|
790
789
|
children: /* @__PURE__ */ e.jsx(ee, { size: P[3], strokeWidth: 1.5 })
|
|
791
790
|
}
|
|
792
791
|
)
|
|
793
792
|
] });
|
|
794
|
-
}
|
|
795
|
-
const Nt = 200;
|
|
793
|
+
}), Nt = 200;
|
|
796
794
|
function vs({
|
|
797
795
|
children: t,
|
|
798
796
|
title: s,
|
|
@@ -1088,7 +1086,7 @@ function gs({ options: t, value: s, onChange: n, size: a = "m", disabled: o = !1
|
|
|
1088
1086
|
}
|
|
1089
1087
|
);
|
|
1090
1088
|
}
|
|
1091
|
-
function
|
|
1089
|
+
function Be({
|
|
1092
1090
|
children: t,
|
|
1093
1091
|
title: s,
|
|
1094
1092
|
defaultExpanded: n = !1,
|
|
@@ -1278,7 +1276,7 @@ function ks({
|
|
|
1278
1276
|
}
|
|
1279
1277
|
),
|
|
1280
1278
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: t && /* @__PURE__ */ e.jsx(
|
|
1281
|
-
|
|
1279
|
+
Te,
|
|
1282
1280
|
{
|
|
1283
1281
|
size: d,
|
|
1284
1282
|
strokeWidth: 2.5,
|
|
@@ -1662,7 +1660,7 @@ function Cs({
|
|
|
1662
1660
|
document.removeEventListener("keydown", c), document.removeEventListener("mousedown", v);
|
|
1663
1661
|
};
|
|
1664
1662
|
}, [n, l]);
|
|
1665
|
-
const m = V.Children.toArray(t), p = m.find((c) => (c == null ? void 0 : c.type) ===
|
|
1663
|
+
const m = V.Children.toArray(t), p = m.find((c) => (c == null ? void 0 : c.type) === Ce), h = m.filter((c) => (c == null ? void 0 : c.type) !== Ce);
|
|
1666
1664
|
return /* @__PURE__ */ e.jsx(
|
|
1667
1665
|
"div",
|
|
1668
1666
|
{
|
|
@@ -1690,7 +1688,7 @@ function Cs({
|
|
|
1690
1688
|
}
|
|
1691
1689
|
);
|
|
1692
1690
|
}
|
|
1693
|
-
function
|
|
1691
|
+
function Ce({ children: t }) {
|
|
1694
1692
|
return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: t });
|
|
1695
1693
|
}
|
|
1696
1694
|
const It = 320;
|
|
@@ -1718,7 +1716,7 @@ function Fs({
|
|
|
1718
1716
|
document.removeEventListener("keydown", c), document.removeEventListener("mousedown", v);
|
|
1719
1717
|
};
|
|
1720
1718
|
}, [n, l]);
|
|
1721
|
-
const m = V.Children.toArray(t), p = m.find((c) => (c == null ? void 0 : c.type) ===
|
|
1719
|
+
const m = V.Children.toArray(t), p = m.find((c) => (c == null ? void 0 : c.type) === Fe || (c == null ? void 0 : c.type) === fe), h = m.filter((c) => (c == null ? void 0 : c.type) !== Fe && (c == null ? void 0 : c.type) !== fe);
|
|
1722
1720
|
return /* @__PURE__ */ e.jsx(
|
|
1723
1721
|
"div",
|
|
1724
1722
|
{
|
|
@@ -1756,7 +1754,7 @@ function Fs({
|
|
|
1756
1754
|
}
|
|
1757
1755
|
);
|
|
1758
1756
|
}
|
|
1759
|
-
function
|
|
1757
|
+
function Fe({ children: t }) {
|
|
1760
1758
|
return !t || V.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
1761
1759
|
}
|
|
1762
1760
|
const be = Qe({ collapsed: !1, side: "left" });
|
|
@@ -1869,10 +1867,10 @@ function Gs({ avatar: t, label: s, selected: n = !1, disabled: a = !1, href: o,
|
|
|
1869
1867
|
return u ? /* @__PURE__ */ e.jsx(Ke, { content: s, position: v, children: _ }) : _;
|
|
1870
1868
|
}
|
|
1871
1869
|
const Bt = {
|
|
1872
|
-
info:
|
|
1873
|
-
success:
|
|
1874
|
-
warning:
|
|
1875
|
-
error:
|
|
1870
|
+
info: Ie,
|
|
1871
|
+
success: Ae,
|
|
1872
|
+
warning: Se,
|
|
1873
|
+
error: Re
|
|
1876
1874
|
};
|
|
1877
1875
|
function Xs({
|
|
1878
1876
|
children: t,
|
|
@@ -2176,11 +2174,11 @@ function en({
|
|
|
2176
2174
|
d && !m.current && (r == null || r()), !d && m.current && (i == null || i()), m.current = d;
|
|
2177
2175
|
}, [d]), /* @__PURE__ */ e.jsx(s, { ref: u, ...l, children: typeof t == "function" ? t(d) : t });
|
|
2178
2176
|
}
|
|
2179
|
-
const
|
|
2180
|
-
default:
|
|
2181
|
-
success:
|
|
2182
|
-
warning:
|
|
2183
|
-
error:
|
|
2177
|
+
const We = {
|
|
2178
|
+
default: Ie,
|
|
2179
|
+
success: Ae,
|
|
2180
|
+
warning: Se,
|
|
2181
|
+
error: Re
|
|
2184
2182
|
};
|
|
2185
2183
|
let me = [];
|
|
2186
2184
|
const ye = /* @__PURE__ */ new Set();
|
|
@@ -2211,7 +2209,7 @@ function Ct({ data: t, onDismiss: s }) {
|
|
|
2211
2209
|
function r() {
|
|
2212
2210
|
a(!1), setTimeout(() => s(t.id), 250);
|
|
2213
2211
|
}
|
|
2214
|
-
const i =
|
|
2212
|
+
const i = We[t.type] ?? We.default;
|
|
2215
2213
|
return /* @__PURE__ */ e.jsxs(
|
|
2216
2214
|
"div",
|
|
2217
2215
|
{
|
|
@@ -2274,7 +2272,7 @@ function nn({
|
|
|
2274
2272
|
className: ["ds-tool-card", m && "ds-tool-card--running", u].filter(Boolean).join(" "),
|
|
2275
2273
|
...d,
|
|
2276
2274
|
children: /* @__PURE__ */ e.jsx(
|
|
2277
|
-
|
|
2275
|
+
Be,
|
|
2278
2276
|
{
|
|
2279
2277
|
title: p,
|
|
2280
2278
|
padding: "s",
|
|
@@ -2324,7 +2322,7 @@ function rn({ content: t, streaming: s = !1, ...n }) {
|
|
|
2324
2322
|
return B(() => {
|
|
2325
2323
|
o(!!s);
|
|
2326
2324
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2327
|
-
|
|
2325
|
+
Be,
|
|
2328
2326
|
{
|
|
2329
2327
|
expanded: a,
|
|
2330
2328
|
onToggle: o,
|
|
@@ -2368,7 +2366,7 @@ function an({
|
|
|
2368
2366
|
"aria-label": `Step ${d + 1}`,
|
|
2369
2367
|
disabled: !h || d === s,
|
|
2370
2368
|
onClick: () => a == null ? void 0 : a(d),
|
|
2371
|
-
children: p ? /* @__PURE__ */ e.jsx(
|
|
2369
|
+
children: p ? /* @__PURE__ */ e.jsx(Te, { size: 8, strokeWidth: 3 }) : null
|
|
2372
2370
|
},
|
|
2373
2371
|
d
|
|
2374
2372
|
);
|
|
@@ -2546,8 +2544,8 @@ function dn({
|
|
|
2546
2544
|
if (!I) return;
|
|
2547
2545
|
const X = [];
|
|
2548
2546
|
for (const Je of I) {
|
|
2549
|
-
const
|
|
2550
|
-
|
|
2547
|
+
const Le = Je.getAsFile();
|
|
2548
|
+
Le && X.push(Le);
|
|
2551
2549
|
}
|
|
2552
2550
|
if (X.length === 0) return;
|
|
2553
2551
|
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ce } = T(X);
|
|
@@ -2571,9 +2569,9 @@ function dn({
|
|
|
2571
2569
|
}
|
|
2572
2570
|
}
|
|
2573
2571
|
o == null || o(N);
|
|
2574
|
-
}, Xe = (t.trim() || (m == null ? void 0 : m.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i,
|
|
2572
|
+
}, Xe = (t.trim() || (m == null ? void 0 : m.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, De = p || h;
|
|
2575
2573
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", M].filter(Boolean).join(" "), ...D, children: [
|
|
2576
|
-
|
|
2574
|
+
De && /* @__PURE__ */ e.jsx(
|
|
2577
2575
|
"input",
|
|
2578
2576
|
{
|
|
2579
2577
|
ref: H,
|
|
@@ -2639,7 +2637,7 @@ function dn({
|
|
|
2639
2637
|
)
|
|
2640
2638
|
] }, N.id)) }),
|
|
2641
2639
|
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((N, I) => /* @__PURE__ */ e.jsx(de, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2642
|
-
N.uploading ? /* @__PURE__ */ e.jsx(lt, { size: P[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(
|
|
2640
|
+
N.uploading ? /* @__PURE__ */ e.jsx(lt, { size: P[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Pe, { size: P[1], strokeWidth: 1.5 }),
|
|
2643
2641
|
N.filename,
|
|
2644
2642
|
N.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2645
2643
|
"button",
|
|
@@ -2652,12 +2650,12 @@ function dn({
|
|
|
2652
2650
|
)
|
|
2653
2651
|
] }) }, I)) }),
|
|
2654
2652
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2655
|
-
|
|
2653
|
+
De && /* @__PURE__ */ e.jsx(
|
|
2656
2654
|
ae,
|
|
2657
2655
|
{
|
|
2658
2656
|
variant: "ghost",
|
|
2659
2657
|
size: "xs",
|
|
2660
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2658
|
+
icon: /* @__PURE__ */ e.jsx(Pe, { size: P[2], strokeWidth: 1.5 }),
|
|
2661
2659
|
"aria-label": "Attach files",
|
|
2662
2660
|
onClick: () => {
|
|
2663
2661
|
var N;
|
|
@@ -2694,7 +2692,7 @@ function dn({
|
|
|
2694
2692
|
)
|
|
2695
2693
|
] });
|
|
2696
2694
|
}
|
|
2697
|
-
const
|
|
2695
|
+
const Ue = { fast: 0, standard: 1, premium: 2 }, Ve = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
2698
2696
|
function un({
|
|
2699
2697
|
models: t = [],
|
|
2700
2698
|
value: s,
|
|
@@ -2706,7 +2704,7 @@ function un({
|
|
|
2706
2704
|
className: l = "",
|
|
2707
2705
|
...u
|
|
2708
2706
|
}) {
|
|
2709
|
-
const [d, m] = A(!1), p = R(null), h = R(null), c = R(null), [v, _] = A({}), g = t.filter((w) => !o || w.name === "auto" ? !0 : (
|
|
2707
|
+
const [d, m] = A(!1), p = R(null), h = R(null), c = R(null), [v, _] = A({}), g = t.filter((w) => !o || w.name === "auto" ? !0 : (Ue[w.tier] ?? 1) >= (Ue[o] ?? 1)), y = g.find((w) => w.name === "auto"), k = g.filter((w) => w.name !== "auto"), j = t.find((w) => w.name === s), M = new Set(k.map((w) => w.tier).filter(Boolean)).size > 1;
|
|
2710
2708
|
B(() => {
|
|
2711
2709
|
if (!d) return;
|
|
2712
2710
|
const w = 320, O = () => {
|
|
@@ -2744,9 +2742,9 @@ function un({
|
|
|
2744
2742
|
].filter(Boolean).join(" "),
|
|
2745
2743
|
onClick: () => D(w.name),
|
|
2746
2744
|
children: [
|
|
2747
|
-
w.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: w.icon }) : /* @__PURE__ */ e.jsx(
|
|
2745
|
+
w.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: w.icon }) : /* @__PURE__ */ e.jsx(Me, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2748
2746
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: w.displayName || w.name }),
|
|
2749
|
-
M && w.tier && /* @__PURE__ */ e.jsx(de, { size: "xs", variant:
|
|
2747
|
+
M && w.tier && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Ve[w.tier] || "default", children: w.tier })
|
|
2750
2748
|
]
|
|
2751
2749
|
},
|
|
2752
2750
|
w.name
|
|
@@ -2795,9 +2793,9 @@ function un({
|
|
|
2795
2793
|
"aria-haspopup": "listbox",
|
|
2796
2794
|
"aria-expanded": d,
|
|
2797
2795
|
children: [
|
|
2798
|
-
j != null && j.icon ? /* @__PURE__ */ e.jsx("span", { children: j.icon }) : /* @__PURE__ */ e.jsx(
|
|
2796
|
+
j != null && j.icon ? /* @__PURE__ */ e.jsx("span", { children: j.icon }) : /* @__PURE__ */ e.jsx(Me, { size: 12, strokeWidth: 1.5 }),
|
|
2799
2797
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (j == null ? void 0 : j.displayName) || (j == null ? void 0 : j.name) || s }),
|
|
2800
|
-
M && (j == null ? void 0 : j.tier) && /* @__PURE__ */ e.jsx(de, { size: "xs", variant:
|
|
2798
|
+
M && (j == null ? void 0 : j.tier) && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Ve[j.tier] || "default", children: j.tier })
|
|
2801
2799
|
]
|
|
2802
2800
|
}
|
|
2803
2801
|
),
|
|
@@ -2854,7 +2852,7 @@ function fn({
|
|
|
2854
2852
|
d.map((h) => {
|
|
2855
2853
|
const c = h.items.map((_) => _.page).filter(Boolean), v = !!o;
|
|
2856
2854
|
return m ? /* @__PURE__ */ e.jsx(
|
|
2857
|
-
|
|
2855
|
+
Be,
|
|
2858
2856
|
{
|
|
2859
2857
|
title: /* @__PURE__ */ e.jsx(Yt, { filename: h.filename, pages: c }),
|
|
2860
2858
|
padding: "s",
|
|
@@ -2889,7 +2887,7 @@ function fn({
|
|
|
2889
2887
|
] })
|
|
2890
2888
|
] });
|
|
2891
2889
|
}
|
|
2892
|
-
function
|
|
2890
|
+
function Ye(t) {
|
|
2893
2891
|
return t >= 1e6 ? (t / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : t >= 1e3 ? (t / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(t);
|
|
2894
2892
|
}
|
|
2895
2893
|
function mn({
|
|
@@ -2919,11 +2917,11 @@ function mn({
|
|
|
2919
2917
|
) }),
|
|
2920
2918
|
(a || o) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
2921
2919
|
a && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2922
|
-
|
|
2920
|
+
Ye(t),
|
|
2923
2921
|
" / ",
|
|
2924
|
-
|
|
2922
|
+
Ye(s)
|
|
2925
2923
|
] }),
|
|
2926
|
-
o && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2924
|
+
o && /* @__PURE__ */ e.jsxs("span", { style: { marginLeft: "auto" }, children: [
|
|
2927
2925
|
Math.round(l * 100),
|
|
2928
2926
|
"%"
|
|
2929
2927
|
] })
|
|
@@ -2932,7 +2930,7 @@ function mn({
|
|
|
2932
2930
|
}
|
|
2933
2931
|
);
|
|
2934
2932
|
}
|
|
2935
|
-
const
|
|
2933
|
+
const qe = 5;
|
|
2936
2934
|
function Ht(t) {
|
|
2937
2935
|
return t < 0.34 ? "low" : t < 0.67 ? "medium" : "high";
|
|
2938
2936
|
}
|
|
@@ -2942,14 +2940,14 @@ function pn({
|
|
|
2942
2940
|
showLabel: n = "none",
|
|
2943
2941
|
layout: a = "inline"
|
|
2944
2942
|
}) {
|
|
2945
|
-
const o = Math.max(0, Math.min(1, t)), r = Math.round(o *
|
|
2943
|
+
const o = Math.max(0, Math.min(1, t)), r = Math.round(o * qe), i = Ht(o);
|
|
2946
2944
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2947
2945
|
"ds-confidence-bar",
|
|
2948
2946
|
`ds-confidence-bar--${s}`,
|
|
2949
2947
|
`ds-confidence-bar--${i}`,
|
|
2950
2948
|
a === "block" && "ds-confidence-bar--block"
|
|
2951
2949
|
].filter(Boolean).join(" "), children: [
|
|
2952
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length:
|
|
2950
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: qe }, (l, u) => /* @__PURE__ */ e.jsx(
|
|
2953
2951
|
"div",
|
|
2954
2952
|
{
|
|
2955
2953
|
className: `ds-confidence-bar__seg${u < r ? " ds-confidence-bar__seg--filled" : ""}`
|
|
@@ -3202,7 +3200,7 @@ function jn({
|
|
|
3202
3200
|
}) {
|
|
3203
3201
|
const v = R(null), _ = R(t), g = R(s), y = R(l);
|
|
3204
3202
|
_.current = t, g.current = s, y.current = l;
|
|
3205
|
-
const [k, j] = A(!1), [S, M] = A({ position: "fixed", visibility: "hidden", width: we }), [D, H] = A("bottom"), [q, W] = A(null), w = R(!1), O = t[s], K = s === t.length - 1, C =
|
|
3203
|
+
const [k, j] = A(!1), [S, M] = A({ position: "fixed", visibility: "hidden", width: we }), [D, H] = A("bottom"), [q, W] = A(null), w = R(!1), O = t[s], K = s === t.length - 1, C = $e(() => {
|
|
3206
3204
|
const x = _.current[g.current];
|
|
3207
3205
|
if (!x || !v.current) return;
|
|
3208
3206
|
const b = es(x.target);
|
|
@@ -3321,7 +3319,7 @@ function jn({
|
|
|
3321
3319
|
);
|
|
3322
3320
|
}
|
|
3323
3321
|
function Nn(t, s = {}) {
|
|
3324
|
-
const { storageKey: n } = s, [a, o] = A(0), [r, i] = A(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", u =
|
|
3322
|
+
const { storageKey: n } = s, [a, o] = A(0), [r, i] = A(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", u = $e(() => {
|
|
3325
3323
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3326
3324
|
}, [n]);
|
|
3327
3325
|
return {
|
|
@@ -3336,8 +3334,20 @@ function Nn(t, s = {}) {
|
|
|
3336
3334
|
finish: u
|
|
3337
3335
|
};
|
|
3338
3336
|
}
|
|
3337
|
+
function wn() {
|
|
3338
|
+
const t = R(null), s = $e(() => {
|
|
3339
|
+
const n = t.current;
|
|
3340
|
+
if (!n) return;
|
|
3341
|
+
n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
|
|
3342
|
+
const a = () => {
|
|
3343
|
+
n.classList.remove("ds-shake"), n.removeEventListener("animationend", a);
|
|
3344
|
+
};
|
|
3345
|
+
n.addEventListener("animationend", a);
|
|
3346
|
+
}, []);
|
|
3347
|
+
return { ref: t, shake: s };
|
|
3348
|
+
}
|
|
3339
3349
|
export {
|
|
3340
|
-
|
|
3350
|
+
Be as Accordion,
|
|
3341
3351
|
xs as Alert,
|
|
3342
3352
|
Qs as AnimatedNumber,
|
|
3343
3353
|
$s as Avatar,
|
|
@@ -3356,7 +3366,7 @@ export {
|
|
|
3356
3366
|
Wt as CopyButton,
|
|
3357
3367
|
hn as DiffView,
|
|
3358
3368
|
Cs as Drawer,
|
|
3359
|
-
|
|
3369
|
+
Ce as DrawerFooter,
|
|
3360
3370
|
Js as Dropdown,
|
|
3361
3371
|
Ls as EmptyState,
|
|
3362
3372
|
_n as EngineerGrid,
|
|
@@ -3393,7 +3403,7 @@ export {
|
|
|
3393
3403
|
gs as SegmentedControl,
|
|
3394
3404
|
ls as Select,
|
|
3395
3405
|
Fs as SidePage,
|
|
3396
|
-
|
|
3406
|
+
Fe as SidePageFooter,
|
|
3397
3407
|
Et as Skeleton,
|
|
3398
3408
|
fn as SourcesPanel,
|
|
3399
3409
|
vt as Spinner,
|
|
@@ -3423,6 +3433,7 @@ export {
|
|
|
3423
3433
|
Ut as useAnimatedPlaceholder,
|
|
3424
3434
|
Nn as useCoachmark,
|
|
3425
3435
|
Mt as useInView,
|
|
3436
|
+
wn as useShake,
|
|
3426
3437
|
cn as useStreamScroll,
|
|
3427
3438
|
tn as useToast
|
|
3428
3439
|
};
|