@donkit-ai/design-system 1.4.68 → 1.4.70
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 +346 -344
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import H, { useState as I, useRef as R, useEffect as
|
|
1
|
+
import H, { useState as I, useRef as R, useEffect as P, useLayoutEffect as rt, forwardRef as Ze, useCallback as le, useContext as de, createContext as Qe } from "react";
|
|
2
2
|
import { Check as Re, X as Q, ChevronDown as je, Minus as at, Plus as ot, XCircle as Se, AlertTriangle as Ae, CheckCircle as Ie, Info as De, ChevronUp as it, ChevronsUpDown as lt, ChevronLeft as ct, ChevronRight as dt, Copy as ut, Brain as ft, Loader as mt, Paperclip as ze, Square as pt, ArrowUp as ht, Zap as xt, Cpu as Fe, FileText as vt, ThumbsUp as _t, ThumbsDown as bt } from "lucide-react";
|
|
3
3
|
import me from "react-dom";
|
|
4
4
|
const F = {
|
|
@@ -56,18 +56,18 @@ function Nt() {
|
|
|
56
56
|
function t(f) {
|
|
57
57
|
if (f == null) return null;
|
|
58
58
|
if (typeof f == "function")
|
|
59
|
-
return f.$$typeof ===
|
|
59
|
+
return f.$$typeof === z ? null : f.displayName || f.name || null;
|
|
60
60
|
if (typeof f == "string") return f;
|
|
61
61
|
switch (f) {
|
|
62
|
-
case
|
|
62
|
+
case v:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case b:
|
|
65
|
-
return "Profiler";
|
|
66
64
|
case j:
|
|
65
|
+
return "Profiler";
|
|
66
|
+
case y:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case B:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case
|
|
70
|
+
case L:
|
|
71
71
|
return "SuspenseList";
|
|
72
72
|
case w:
|
|
73
73
|
return "Activity";
|
|
@@ -76,7 +76,7 @@ function Nt() {
|
|
|
76
76
|
switch (typeof f.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), f.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case b:
|
|
80
80
|
return "Portal";
|
|
81
81
|
case k:
|
|
82
82
|
return f.displayName || "Context";
|
|
@@ -117,7 +117,7 @@ function Nt() {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function r(f) {
|
|
120
|
-
if (f ===
|
|
120
|
+
if (f === v) return "<>";
|
|
121
121
|
if (typeof f == "object" && f !== null && f.$$typeof === C)
|
|
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 === x;
|
|
248
248
|
}
|
|
249
|
-
var m = H, x = Symbol.for("react.transitional.element"),
|
|
249
|
+
var m = H, x = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), k = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), z = Symbol.for("react.client.reference"), K = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, D = Array.isArray, _ = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
m = {
|
|
@@ -258,7 +258,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
258
258
|
m,
|
|
259
259
|
o
|
|
260
260
|
)(), G = _(r(o)), $ = {};
|
|
261
|
-
be.Fragment =
|
|
261
|
+
be.Fragment = v, be.jsx = function(f, T, W) {
|
|
262
262
|
var Y = 1e4 > K.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return u(
|
|
264
264
|
f,
|
|
@@ -310,15 +310,15 @@ function ae({
|
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const m = a && !t, x = i === "loading",
|
|
313
|
+
const m = a && !t, x = i === "loading", b = i === "success", v = i === "error", y = x || b || v, j = n === "xs" ? "s" : "m", N = s === "danger" ? "on-accent" : "default", k = gt[n] ?? 16, S = x ? /* @__PURE__ */ e.jsx(wt, { size: j, color: N }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Re, { size: k, strokeWidth: 2.5 }) }) : v ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Q, { size: k, strokeWidth: 2.5 }) }) : null, B = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${s}`,
|
|
316
316
|
`ds-button--${n}`,
|
|
317
317
|
r && "ds-button--full",
|
|
318
318
|
m && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
321
|
-
|
|
320
|
+
].filter(Boolean).join(" "), L = i !== "idle" ? i : void 0, O = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
|
+
y ? S : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
322
322
|
t
|
|
323
323
|
] });
|
|
324
324
|
if (c) {
|
|
@@ -332,13 +332,13 @@ function ae({
|
|
|
332
332
|
return /* @__PURE__ */ e.jsx(
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
|
-
className:
|
|
335
|
+
className: B,
|
|
336
336
|
href: o || x ? void 0 : c,
|
|
337
337
|
onClick: C,
|
|
338
338
|
"aria-label": u,
|
|
339
339
|
"aria-disabled": o || x ? "true" : void 0,
|
|
340
340
|
"aria-busy": x ? "true" : void 0,
|
|
341
|
-
"data-state":
|
|
341
|
+
"data-state": L,
|
|
342
342
|
...h,
|
|
343
343
|
children: O
|
|
344
344
|
}
|
|
@@ -348,12 +348,12 @@ function ae({
|
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
350
|
type: d,
|
|
351
|
-
className:
|
|
351
|
+
className: B,
|
|
352
352
|
disabled: o,
|
|
353
353
|
onClick: x ? void 0 : l,
|
|
354
354
|
"aria-label": u,
|
|
355
355
|
"aria-busy": x ? "true" : void 0,
|
|
356
|
-
"data-state":
|
|
356
|
+
"data-state": L,
|
|
357
357
|
...h,
|
|
358
358
|
children: O
|
|
359
359
|
}
|
|
@@ -448,40 +448,40 @@ function ms({
|
|
|
448
448
|
id: c,
|
|
449
449
|
...u
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = I(!1), [m, x] = I(!1), [
|
|
451
|
+
const [p, h] = I(!1), [m, x] = I(!1), [b, v] = I({}), [y, j] = I("down"), [N, k] = I(-1), S = R(null), B = R(null), L = R(null), O = R(null), C = c || `select-${H.useId()}`, w = `${C}-label`, z = o ? `${C}-error` : void 0, K = 150, V = ($ = !1) => {
|
|
452
452
|
m || (x(!0), k(-1), O.current = setTimeout(() => {
|
|
453
453
|
var f;
|
|
454
|
-
h(!1), x(!1), $ && ((f =
|
|
454
|
+
h(!1), x(!1), $ && ((f = L.current) == null || f.focus());
|
|
455
455
|
}, K));
|
|
456
456
|
}, D = ($) => {
|
|
457
457
|
clearTimeout(O.current), x(!1);
|
|
458
458
|
const f = $ !== void 0 ? $ : Math.max(r.findIndex((T) => T.value === s), 0);
|
|
459
459
|
k(f), h(!0);
|
|
460
460
|
};
|
|
461
|
-
|
|
461
|
+
P(() => () => clearTimeout(O.current), []);
|
|
462
462
|
const _ = () => {
|
|
463
463
|
var oe;
|
|
464
464
|
const $ = (oe = S.current) == null ? void 0 : oe.getBoundingClientRect();
|
|
465
465
|
if (!$) return;
|
|
466
466
|
const f = window.innerHeight, T = f - $.bottom, W = $.top, ne = T < 300 && W > T;
|
|
467
|
-
|
|
467
|
+
j(ne ? "up" : "down"), v(
|
|
468
468
|
ne ? { bottom: f - $.top + 4, left: $.left, width: $.width } : { top: $.bottom + 4, left: $.left, width: $.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
471
|
-
|
|
471
|
+
P(() => {
|
|
472
472
|
if (p)
|
|
473
473
|
return _(), window.addEventListener("scroll", _, !0), window.addEventListener("resize", _), () => {
|
|
474
474
|
window.removeEventListener("scroll", _, !0), window.removeEventListener("resize", _);
|
|
475
475
|
};
|
|
476
|
-
}, [p]),
|
|
476
|
+
}, [p]), P(() => {
|
|
477
477
|
const $ = (f) => {
|
|
478
|
-
S.current && !S.current.contains(f.target) &&
|
|
478
|
+
S.current && !S.current.contains(f.target) && B.current && !B.current.contains(f.target) && V();
|
|
479
479
|
};
|
|
480
480
|
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
481
|
-
}, [m]),
|
|
481
|
+
}, [m]), P(() => {
|
|
482
482
|
var f;
|
|
483
|
-
if (!p || N < 0 || !
|
|
484
|
-
(f =
|
|
483
|
+
if (!p || N < 0 || !B.current) return;
|
|
484
|
+
(f = B.current.querySelectorAll(".ds-select-option")[N]) == null || f.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [N, p]);
|
|
486
486
|
const E = ($) => {
|
|
487
487
|
switch ($.key) {
|
|
@@ -511,7 +511,7 @@ function ms({
|
|
|
511
511
|
}, A = r.find(($) => $.value === s), U = l === "xs" ? F[1] : l === "small" ? F[2] : F[3], G = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
|
-
ref:
|
|
514
|
+
ref: B,
|
|
515
515
|
"data-ds-portal": "",
|
|
516
516
|
role: "listbox",
|
|
517
517
|
"aria-labelledby": t ? w : void 0,
|
|
@@ -519,10 +519,10 @@ function ms({
|
|
|
519
519
|
className: [
|
|
520
520
|
"ds-select-dropdown ds-scrollable",
|
|
521
521
|
`ds-select-dropdown--${l}`,
|
|
522
|
-
`ds-select-dropdown--${
|
|
522
|
+
`ds-select-dropdown--${y}`,
|
|
523
523
|
m && "ds-select-dropdown--closing"
|
|
524
524
|
].filter(Boolean).join(" "),
|
|
525
|
-
style:
|
|
525
|
+
style: b,
|
|
526
526
|
children: r.map(($, f) => /* @__PURE__ */ e.jsx(
|
|
527
527
|
"button",
|
|
528
528
|
{
|
|
@@ -551,7 +551,7 @@ function ms({
|
|
|
551
551
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: S, children: /* @__PURE__ */ e.jsxs(
|
|
552
552
|
"button",
|
|
553
553
|
{
|
|
554
|
-
ref:
|
|
554
|
+
ref: L,
|
|
555
555
|
type: "button",
|
|
556
556
|
id: C,
|
|
557
557
|
role: "combobox",
|
|
@@ -560,7 +560,7 @@ function ms({
|
|
|
560
560
|
"aria-activedescendant": p && N >= 0 ? `${C}-opt-${N}` : void 0,
|
|
561
561
|
"aria-labelledby": t ? w : void 0,
|
|
562
562
|
"aria-invalid": o ? "true" : "false",
|
|
563
|
-
"aria-describedby":
|
|
563
|
+
"aria-describedby": z,
|
|
564
564
|
className: `ds-select-trigger ds-select-trigger--${l} ${o ? "ds-select-trigger--error" : ""}`,
|
|
565
565
|
onClick: () => {
|
|
566
566
|
d || (p ? V() : D());
|
|
@@ -575,14 +575,14 @@ function ms({
|
|
|
575
575
|
{
|
|
576
576
|
size: U,
|
|
577
577
|
strokeWidth: 1.5,
|
|
578
|
-
className: `ds-select-icon ${p &&
|
|
578
|
+
className: `ds-select-icon ${p && y === "down" ? "ds-select-icon--open" : ""} ${p && y === "up" ? "ds-select-icon--up" : ""}`,
|
|
579
579
|
"aria-hidden": "true"
|
|
580
580
|
}
|
|
581
581
|
)
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
) }),
|
|
585
|
-
o && /* @__PURE__ */ e.jsx("span", { id:
|
|
585
|
+
o && /* @__PURE__ */ e.jsx("span", { id: z, className: "ds-select-error", role: "alert", children: o }),
|
|
586
586
|
typeof document < "u" && me.createPortal(G, document.body)
|
|
587
587
|
] });
|
|
588
588
|
}
|
|
@@ -601,20 +601,20 @@ function ps({
|
|
|
601
601
|
}) {
|
|
602
602
|
const p = () => {
|
|
603
603
|
if (l) return;
|
|
604
|
-
const
|
|
605
|
-
n == null || n(
|
|
604
|
+
const y = Math.min(Number(s) + o, a);
|
|
605
|
+
n == null || n(y);
|
|
606
606
|
}, h = () => {
|
|
607
607
|
if (l) return;
|
|
608
|
-
const
|
|
609
|
-
n == null || n(
|
|
610
|
-
}, m = (
|
|
608
|
+
const y = Math.max(Number(s) - o, r);
|
|
609
|
+
n == null || n(y);
|
|
610
|
+
}, m = (y) => {
|
|
611
611
|
if (l) return;
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
612
|
+
const j = y.target.value;
|
|
613
|
+
if (j === "") {
|
|
614
614
|
n == null || n(r);
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
|
-
const N = Number(
|
|
617
|
+
const N = Number(j);
|
|
618
618
|
if (!isNaN(N)) {
|
|
619
619
|
const k = Math.min(Math.max(N, r), a);
|
|
620
620
|
n == null || n(k);
|
|
@@ -623,14 +623,14 @@ function ps({
|
|
|
623
623
|
"ds-stepper-wrapper",
|
|
624
624
|
l && "ds-stepper-wrapper--disabled",
|
|
625
625
|
c && "ds-stepper-wrapper--error"
|
|
626
|
-
].filter(Boolean).join(" "),
|
|
626
|
+
].filter(Boolean).join(" "), b = [
|
|
627
627
|
"ds-stepper",
|
|
628
628
|
`ds-stepper--${i}`,
|
|
629
629
|
l && "ds-stepper--disabled"
|
|
630
|
-
].filter(Boolean).join(" "),
|
|
630
|
+
].filter(Boolean).join(" "), v = i === "xs" ? F[1] : i === "small" ? F[2] : F[3];
|
|
631
631
|
return /* @__PURE__ */ e.jsxs("div", { className: x, children: [
|
|
632
632
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
633
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
633
|
+
/* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
634
634
|
/* @__PURE__ */ e.jsx(
|
|
635
635
|
"button",
|
|
636
636
|
{
|
|
@@ -639,7 +639,7 @@ function ps({
|
|
|
639
639
|
onClick: h,
|
|
640
640
|
disabled: l || s <= r,
|
|
641
641
|
"aria-label": "Decrease",
|
|
642
|
-
children: /* @__PURE__ */ e.jsx(at, { size:
|
|
642
|
+
children: /* @__PURE__ */ e.jsx(at, { size: v, strokeWidth: 1.5 })
|
|
643
643
|
}
|
|
644
644
|
),
|
|
645
645
|
/* @__PURE__ */ e.jsx(
|
|
@@ -664,7 +664,7 @@ function ps({
|
|
|
664
664
|
onClick: p,
|
|
665
665
|
disabled: l || s >= a,
|
|
666
666
|
"aria-label": "Increase",
|
|
667
|
-
children: /* @__PURE__ */ e.jsx(ot, { size:
|
|
667
|
+
children: /* @__PURE__ */ e.jsx(ot, { size: v, strokeWidth: 1.5 })
|
|
668
668
|
}
|
|
669
669
|
)
|
|
670
670
|
] }),
|
|
@@ -742,7 +742,7 @@ function js({ children: t, secondary: s = !1, ...n }) {
|
|
|
742
742
|
function yt({ children: t, secondary: s = !1, ...n }) {
|
|
743
743
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${s ? "ds-p2--secondary" : ""}`, ...n, children: t });
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function et({ children: t, secondary: s = !1, ...n }) {
|
|
746
746
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${s ? "ds-p3--secondary" : ""}`, ...n, children: t });
|
|
747
747
|
}
|
|
748
748
|
function fe({
|
|
@@ -805,19 +805,19 @@ function ws({
|
|
|
805
805
|
u(!1), n();
|
|
806
806
|
}, Et));
|
|
807
807
|
};
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
},
|
|
808
|
+
P(() => {
|
|
809
|
+
const b = (y) => {
|
|
810
|
+
y.key === "Escape" && p();
|
|
811
|
+
}, v = (y) => {
|
|
812
812
|
var N, k, S;
|
|
813
|
-
const
|
|
814
|
-
l.current && !l.current.contains(
|
|
813
|
+
const j = ((k = (N = y.composedPath) == null ? void 0 : N.call(y)) == null ? void 0 : k[0]) ?? y.target;
|
|
814
|
+
l.current && !l.current.contains(j) && !((S = j.closest) != null && S.call(j, "[data-ds-portal]")) && p();
|
|
815
815
|
};
|
|
816
|
-
return document.addEventListener("keydown",
|
|
817
|
-
document.removeEventListener("keydown",
|
|
816
|
+
return document.addEventListener("keydown", b), document.addEventListener("mousedown", v), () => {
|
|
817
|
+
document.removeEventListener("keydown", b), document.removeEventListener("mousedown", v);
|
|
818
818
|
};
|
|
819
819
|
}, [n, c]);
|
|
820
|
-
const h = H.Children.toArray(t), m = h.find((
|
|
820
|
+
const h = H.Children.toArray(t), m = h.find((b) => (b == null ? void 0 : b.type) === he), x = h.filter((b) => (b == null ? void 0 : b.type) !== he);
|
|
821
821
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", c && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
@@ -864,13 +864,13 @@ function gs({
|
|
|
864
864
|
d(!1), n();
|
|
865
865
|
}, $t));
|
|
866
866
|
};
|
|
867
|
-
|
|
868
|
-
const m = (
|
|
869
|
-
|
|
870
|
-
}, x = (
|
|
871
|
-
var
|
|
872
|
-
const
|
|
873
|
-
o.current && !o.current.contains(
|
|
867
|
+
P(() => {
|
|
868
|
+
const m = (b) => {
|
|
869
|
+
b.key === "Escape" && c();
|
|
870
|
+
}, x = (b) => {
|
|
871
|
+
var y, j, N;
|
|
872
|
+
const v = ((j = (y = b.composedPath) == null ? void 0 : y.call(b)) == null ? void 0 : j[0]) ?? b.target;
|
|
873
|
+
o.current && !o.current.contains(v) && !((N = v.closest) != null && N.call(v, "[data-ds-portal]")) && c();
|
|
874
874
|
};
|
|
875
875
|
return document.addEventListener("keydown", m), document.addEventListener("mousedown", x), () => {
|
|
876
876
|
document.removeEventListener("keydown", m), document.removeEventListener("mousedown", x);
|
|
@@ -1029,19 +1029,19 @@ function Ts({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1
|
|
|
1029
1029
|
if (!o.current) return;
|
|
1030
1030
|
const m = o.current.querySelector(`[data-value="${s}"]`);
|
|
1031
1031
|
if (!m) return;
|
|
1032
|
-
const x = o.current.getBoundingClientRect(),
|
|
1033
|
-
i.current ? (i.current.style.transition = c.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left =
|
|
1032
|
+
const x = o.current.getBoundingClientRect(), b = m.getBoundingClientRect(), v = b.left - x.left, y = b.width;
|
|
1033
|
+
i.current ? (i.current.style.transition = c.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = v + "px", i.current.style.width = y + "px", c.current = !1) : (d(!0), requestAnimationFrame(() => {
|
|
1034
1034
|
if (!i.current || !o.current) return;
|
|
1035
|
-
const
|
|
1036
|
-
if (!
|
|
1037
|
-
const N = o.current.getBoundingClientRect(), k =
|
|
1035
|
+
const j = o.current.querySelector(`[data-value="${s}"]`);
|
|
1036
|
+
if (!j) return;
|
|
1037
|
+
const N = o.current.getBoundingClientRect(), k = j.getBoundingClientRect();
|
|
1038
1038
|
i.current.style.transition = "none", i.current.style.left = k.left - N.left + "px", i.current.style.width = k.width + "px";
|
|
1039
1039
|
}));
|
|
1040
1040
|
};
|
|
1041
|
-
return p.current = h,
|
|
1041
|
+
return p.current = h, rt(() => {
|
|
1042
1042
|
const m = u.current !== s;
|
|
1043
1043
|
u.current = s, c.current = l && m, h();
|
|
1044
|
-
}),
|
|
1044
|
+
}), P(() => {
|
|
1045
1045
|
if (!o.current) return;
|
|
1046
1046
|
const m = new ResizeObserver(() => {
|
|
1047
1047
|
c.current = !1, p.current();
|
|
@@ -1161,28 +1161,28 @@ function St(t, s, n) {
|
|
|
1161
1161
|
function Le({ children: t, content: s, position: n, ...r }) {
|
|
1162
1162
|
const [a, o] = I(!1), [i, l] = I({ visibility: "hidden" }), [d, c] = I(n || "top"), u = R(null), p = R(null), h = R(!1), m = () => {
|
|
1163
1163
|
if (!u.current || !p.current) return;
|
|
1164
|
-
const
|
|
1165
|
-
c(
|
|
1164
|
+
const b = u.current.getBoundingClientRect(), v = p.current.getBoundingClientRect(), y = n || St(b, v.height, v.width), { top: j, left: N, arrowOffset: k } = Rt(y, b, v);
|
|
1165
|
+
c(y), l({
|
|
1166
1166
|
position: "fixed",
|
|
1167
|
-
top:
|
|
1167
|
+
top: j,
|
|
1168
1168
|
left: N,
|
|
1169
1169
|
visibility: "visible",
|
|
1170
1170
|
"--arrow-offset": `${k}px`
|
|
1171
1171
|
});
|
|
1172
1172
|
};
|
|
1173
|
-
if (
|
|
1173
|
+
if (P(() => {
|
|
1174
1174
|
if (!a) return;
|
|
1175
1175
|
l({ position: "fixed", visibility: "hidden" });
|
|
1176
|
-
const
|
|
1176
|
+
const b = requestAnimationFrame(m);
|
|
1177
1177
|
return window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1178
|
-
cancelAnimationFrame(
|
|
1178
|
+
cancelAnimationFrame(b), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1179
1179
|
};
|
|
1180
|
-
}, [a, n]),
|
|
1180
|
+
}, [a, n]), P(() => {
|
|
1181
1181
|
if (!a) return;
|
|
1182
|
-
const
|
|
1183
|
-
u.current && !u.current.contains(
|
|
1182
|
+
const b = (v) => {
|
|
1183
|
+
u.current && !u.current.contains(v.target) && o(!1);
|
|
1184
1184
|
};
|
|
1185
|
-
return document.addEventListener("touchstart",
|
|
1185
|
+
return document.addEventListener("touchstart", b), () => document.removeEventListener("touchstart", b);
|
|
1186
1186
|
}, [a]), !s) return t;
|
|
1187
1187
|
const x = a && /* @__PURE__ */ e.jsx(
|
|
1188
1188
|
"div",
|
|
@@ -1207,7 +1207,7 @@ function Le({ children: t, content: s, position: n, ...r }) {
|
|
|
1207
1207
|
h.current || o(!1);
|
|
1208
1208
|
},
|
|
1209
1209
|
onTouchStart: () => {
|
|
1210
|
-
h.current = !0, o((
|
|
1210
|
+
h.current = !0, o((b) => !b);
|
|
1211
1211
|
},
|
|
1212
1212
|
...r,
|
|
1213
1213
|
children: [
|
|
@@ -1643,48 +1643,49 @@ function Ys({
|
|
|
1643
1643
|
side: r = "right",
|
|
1644
1644
|
offsetLeft: a = 0,
|
|
1645
1645
|
offsetRight: o = 0,
|
|
1646
|
-
|
|
1646
|
+
keepOpenRef: i,
|
|
1647
|
+
...l
|
|
1647
1648
|
}) {
|
|
1648
|
-
const
|
|
1649
|
-
!n ||
|
|
1650
|
-
|
|
1649
|
+
const d = R(null), c = H.useId(), [u, p] = I(!1), h = () => {
|
|
1650
|
+
!n || u || (p(!0), setTimeout(() => {
|
|
1651
|
+
p(!1), n();
|
|
1651
1652
|
}, Pt));
|
|
1652
1653
|
};
|
|
1653
|
-
|
|
1654
|
+
P(() => {
|
|
1654
1655
|
const v = (j) => {
|
|
1655
|
-
j.key === "Escape" &&
|
|
1656
|
-
},
|
|
1657
|
-
var
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1656
|
+
j.key === "Escape" && h();
|
|
1657
|
+
}, y = (j) => {
|
|
1658
|
+
var k, S, B, L;
|
|
1659
|
+
const N = ((S = (k = j.composedPath) == null ? void 0 : k.call(j)) == null ? void 0 : S[0]) ?? j.target;
|
|
1660
|
+
(B = i == null ? void 0 : i.current) != null && B.contains(N) || d.current && !d.current.contains(N) && !((L = N.closest) != null && L.call(N, "[data-ds-portal]")) && h();
|
|
1660
1661
|
};
|
|
1661
|
-
return document.addEventListener("keydown", v), document.addEventListener("mousedown",
|
|
1662
|
-
document.removeEventListener("keydown", v), document.removeEventListener("mousedown",
|
|
1662
|
+
return document.addEventListener("keydown", v), document.addEventListener("mousedown", y), () => {
|
|
1663
|
+
document.removeEventListener("keydown", v), document.removeEventListener("mousedown", y);
|
|
1663
1664
|
};
|
|
1664
|
-
}, [n,
|
|
1665
|
-
const
|
|
1665
|
+
}, [n, u, i]);
|
|
1666
|
+
const m = H.Children.toArray(t), x = m.find((v) => (v == null ? void 0 : v.type) === Oe), b = m.filter((v) => (v == null ? void 0 : v.type) !== Oe);
|
|
1666
1667
|
return /* @__PURE__ */ e.jsx(
|
|
1667
1668
|
"div",
|
|
1668
1669
|
{
|
|
1669
|
-
className: ["ds-drawer-overlay",
|
|
1670
|
+
className: ["ds-drawer-overlay", u && "ds-drawer-overlay--closing"].filter(Boolean).join(" "),
|
|
1670
1671
|
style: { "--ds-drawer-offset-left": `${a}px`, "--ds-drawer-offset-right": `${o}px` },
|
|
1671
|
-
...
|
|
1672
|
+
...l,
|
|
1672
1673
|
children: /* @__PURE__ */ e.jsxs(
|
|
1673
1674
|
"aside",
|
|
1674
1675
|
{
|
|
1675
|
-
className: ["ds-drawer",
|
|
1676
|
+
className: ["ds-drawer", u && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1676
1677
|
"data-side": r,
|
|
1677
|
-
ref:
|
|
1678
|
+
ref: d,
|
|
1678
1679
|
role: "dialog",
|
|
1679
1680
|
"aria-modal": "true",
|
|
1680
|
-
"aria-labelledby": s ?
|
|
1681
|
+
"aria-labelledby": s ? c : void 0,
|
|
1681
1682
|
children: [
|
|
1682
1683
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1683
|
-
s && /* @__PURE__ */ e.jsx("h3", { id:
|
|
1684
|
-
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick:
|
|
1684
|
+
s && /* @__PURE__ */ e.jsx("h3", { id: c, className: "ds-drawer-title", children: s }),
|
|
1685
|
+
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: h, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(Q, { size: F[2], strokeWidth: 1.5 }) })
|
|
1685
1686
|
] }),
|
|
1686
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children:
|
|
1687
|
-
|
|
1687
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children: b }),
|
|
1688
|
+
x
|
|
1688
1689
|
]
|
|
1689
1690
|
}
|
|
1690
1691
|
)
|
|
@@ -1702,40 +1703,41 @@ function Hs({
|
|
|
1702
1703
|
subHeader: r,
|
|
1703
1704
|
offsetLeft: a = 0,
|
|
1704
1705
|
offsetRight: o = 0,
|
|
1705
|
-
|
|
1706
|
+
keepOpenRef: i,
|
|
1707
|
+
...l
|
|
1706
1708
|
}) {
|
|
1707
|
-
const
|
|
1708
|
-
!n ||
|
|
1709
|
-
|
|
1709
|
+
const d = R(null), c = H.useId(), [u, p] = I(!1), h = () => {
|
|
1710
|
+
!n || u || (p(!0), setTimeout(() => {
|
|
1711
|
+
p(!1), n();
|
|
1710
1712
|
}, Mt));
|
|
1711
1713
|
};
|
|
1712
|
-
|
|
1714
|
+
P(() => {
|
|
1713
1715
|
const v = (j) => {
|
|
1714
|
-
j.key === "Escape" &&
|
|
1715
|
-
},
|
|
1716
|
-
var
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1716
|
+
j.key === "Escape" && h();
|
|
1717
|
+
}, y = (j) => {
|
|
1718
|
+
var k, S, B, L;
|
|
1719
|
+
const N = ((S = (k = j.composedPath) == null ? void 0 : k.call(j)) == null ? void 0 : S[0]) ?? j.target;
|
|
1720
|
+
(B = i == null ? void 0 : i.current) != null && B.contains(N) || d.current && !d.current.contains(N) && !((L = N.closest) != null && L.call(N, "[data-ds-portal]")) && h();
|
|
1719
1721
|
};
|
|
1720
|
-
return document.addEventListener("keydown", v), document.addEventListener("mousedown",
|
|
1721
|
-
document.removeEventListener("keydown", v), document.removeEventListener("mousedown",
|
|
1722
|
+
return document.addEventListener("keydown", v), document.addEventListener("mousedown", y), () => {
|
|
1723
|
+
document.removeEventListener("keydown", v), document.removeEventListener("mousedown", y);
|
|
1722
1724
|
};
|
|
1723
|
-
}, [n,
|
|
1724
|
-
const
|
|
1725
|
+
}, [n, u, i]);
|
|
1726
|
+
const m = H.Children.toArray(t), x = m.find((v) => (v == null ? void 0 : v.type) === Ue || (v == null ? void 0 : v.type) === he), b = m.filter((v) => (v == null ? void 0 : v.type) !== Ue && (v == null ? void 0 : v.type) !== he);
|
|
1725
1727
|
return /* @__PURE__ */ e.jsx(
|
|
1726
1728
|
"div",
|
|
1727
1729
|
{
|
|
1728
|
-
className: ["ds-side-page-overlay",
|
|
1730
|
+
className: ["ds-side-page-overlay", u && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
|
|
1729
1731
|
style: { "--ds-side-page-offset-left": `${a}px`, "--ds-side-page-offset-right": `${o}px` },
|
|
1730
|
-
...
|
|
1732
|
+
...l,
|
|
1731
1733
|
children: /* @__PURE__ */ e.jsxs(
|
|
1732
1734
|
"div",
|
|
1733
1735
|
{
|
|
1734
|
-
ref:
|
|
1735
|
-
className: ["ds-side-page",
|
|
1736
|
+
ref: d,
|
|
1737
|
+
className: ["ds-side-page", u && "ds-side-page--closing"].filter(Boolean).join(" "),
|
|
1736
1738
|
role: "dialog",
|
|
1737
1739
|
"aria-modal": "true",
|
|
1738
|
-
"aria-labelledby": s ?
|
|
1740
|
+
"aria-labelledby": s ? c : void 0,
|
|
1739
1741
|
children: [
|
|
1740
1742
|
n && /* @__PURE__ */ e.jsx(
|
|
1741
1743
|
ae,
|
|
@@ -1744,16 +1746,16 @@ function Hs({
|
|
|
1744
1746
|
variant: "ghost",
|
|
1745
1747
|
size: "small",
|
|
1746
1748
|
icon: /* @__PURE__ */ e.jsx(Q, { size: F[2], strokeWidth: 1.5 }),
|
|
1747
|
-
onClick:
|
|
1749
|
+
onClick: h,
|
|
1748
1750
|
"aria-label": "Close"
|
|
1749
1751
|
}
|
|
1750
1752
|
),
|
|
1751
1753
|
(s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-side-page__header", children: [
|
|
1752
|
-
s && /* @__PURE__ */ e.jsx("h3", { id:
|
|
1754
|
+
s && /* @__PURE__ */ e.jsx("h3", { id: c, className: "ds-side-page__title", children: s }),
|
|
1753
1755
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
|
|
1754
1756
|
] }),
|
|
1755
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children:
|
|
1756
|
-
|
|
1757
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: b }),
|
|
1758
|
+
x
|
|
1757
1759
|
]
|
|
1758
1760
|
}
|
|
1759
1761
|
)
|
|
@@ -1763,34 +1765,34 @@ function Hs({
|
|
|
1763
1765
|
function Ue({ children: t }) {
|
|
1764
1766
|
return !t || H.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
1765
1767
|
}
|
|
1766
|
-
const ve =
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
const i = [
|
|
1768
|
+
const ve = Qe({ collapsed: !1, side: "left" }), we = Qe(!1), qs = Ze(function({
|
|
1769
|
+
children: s,
|
|
1770
|
+
collapsed: n = !1,
|
|
1771
|
+
side: r = "left",
|
|
1772
|
+
onExpand: a,
|
|
1773
|
+
className: o = "",
|
|
1774
|
+
...i
|
|
1775
|
+
}, l) {
|
|
1776
|
+
const d = [
|
|
1776
1777
|
"ds-nav-rail",
|
|
1777
|
-
|
|
1778
|
-
`ds-nav-rail--${
|
|
1779
|
-
|
|
1780
|
-
].filter(Boolean).join(" "),
|
|
1781
|
-
!
|
|
1782
|
-
}, [
|
|
1783
|
-
return /* @__PURE__ */ e.jsx(ve.Provider, { value: { collapsed:
|
|
1778
|
+
n && "ds-nav-rail--collapsed",
|
|
1779
|
+
`ds-nav-rail--${r}`,
|
|
1780
|
+
o
|
|
1781
|
+
].filter(Boolean).join(" "), c = le((u) => {
|
|
1782
|
+
!n || !a || u.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]') || a();
|
|
1783
|
+
}, [n, a]);
|
|
1784
|
+
return /* @__PURE__ */ e.jsx(ve.Provider, { value: { collapsed: n, side: r }, children: /* @__PURE__ */ e.jsx(
|
|
1784
1785
|
"nav",
|
|
1785
1786
|
{
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1787
|
+
ref: l,
|
|
1788
|
+
className: d,
|
|
1789
|
+
onClick: c,
|
|
1790
|
+
"data-expandable": n && a ? "" : void 0,
|
|
1791
|
+
...i,
|
|
1792
|
+
children: s
|
|
1791
1793
|
}
|
|
1792
1794
|
) });
|
|
1793
|
-
}
|
|
1795
|
+
});
|
|
1794
1796
|
function Gs({
|
|
1795
1797
|
icon: t,
|
|
1796
1798
|
label: s,
|
|
@@ -1805,7 +1807,7 @@ function Gs({
|
|
|
1805
1807
|
className: u = "",
|
|
1806
1808
|
...p
|
|
1807
1809
|
}) {
|
|
1808
|
-
const { collapsed: h, side: m } = de(ve), x = de(we),
|
|
1810
|
+
const { collapsed: h, side: m } = de(ve), x = de(we), y = {
|
|
1809
1811
|
className: [
|
|
1810
1812
|
"ds-nav-rail__item",
|
|
1811
1813
|
u
|
|
@@ -1822,13 +1824,13 @@ function Gs({
|
|
|
1822
1824
|
"data-onboarding": c || void 0
|
|
1823
1825
|
},
|
|
1824
1826
|
...p
|
|
1825
|
-
},
|
|
1827
|
+
}, j = i != null, N = m === "left" ? "right" : "left", k = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1826
1828
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1827
1829
|
!h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
|
|
1828
1830
|
!h && l && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
|
|
1829
|
-
!h &&
|
|
1831
|
+
!h && j && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
|
|
1830
1832
|
h && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
1831
|
-
] }), S = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...
|
|
1833
|
+
] }), S = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...y, children: k }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...y, children: k });
|
|
1832
1834
|
return h && !x ? /* @__PURE__ */ e.jsx(Le, { content: s, position: N, children: S }) : S;
|
|
1833
1835
|
}
|
|
1834
1836
|
function Ks({ children: t, className: s = "", ...n }) {
|
|
@@ -1862,7 +1864,7 @@ function Qs({ children: t, label: s = "Recents", defaultOpen: n = !0, className:
|
|
|
1862
1864
|
(i || o) && /* @__PURE__ */ e.jsx("div", { className: "ds-nav-rail__recents-body", children: t })
|
|
1863
1865
|
] });
|
|
1864
1866
|
}
|
|
1865
|
-
const en =
|
|
1867
|
+
const en = Ze(function({
|
|
1866
1868
|
as: s = "button",
|
|
1867
1869
|
avatar: n,
|
|
1868
1870
|
label: r,
|
|
@@ -1908,8 +1910,8 @@ function tn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a,
|
|
|
1908
1910
|
}, x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1909
1911
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1910
1912
|
!d && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
1911
|
-
] }),
|
|
1912
|
-
return d && !u ? /* @__PURE__ */ e.jsx(Le, { content: s, position:
|
|
1913
|
+
] }), b = c === "left" ? "right" : "left", v = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...m, children: x }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...m, children: x });
|
|
1914
|
+
return d && !u ? /* @__PURE__ */ e.jsx(Le, { content: s, position: b, children: v }) : v;
|
|
1913
1915
|
}
|
|
1914
1916
|
const Ve = 240, Ye = 6, He = 8;
|
|
1915
1917
|
function sn({
|
|
@@ -1920,28 +1922,28 @@ function sn({
|
|
|
1920
1922
|
onOpenChange: a,
|
|
1921
1923
|
defaultOpen: o = !1
|
|
1922
1924
|
}) {
|
|
1923
|
-
const { side: i } = de(ve), [l, d] = I(o), c = r !== void 0, u = c ? r : l, [p, h] = I(!1), m = R(null), x = R(null), [
|
|
1925
|
+
const { side: i } = de(ve), [l, d] = I(o), c = r !== void 0, u = c ? r : l, [p, h] = I(!1), m = R(null), x = R(null), [b, v] = I({}), y = le(() => {
|
|
1924
1926
|
c ? a == null || a(!0) : d(!0);
|
|
1925
|
-
}, [c, a]),
|
|
1927
|
+
}, [c, a]), j = le(() => {
|
|
1926
1928
|
c ? a == null || a(!1) : d(!1);
|
|
1927
|
-
}, [c, a]), N = le(() => u ?
|
|
1928
|
-
var
|
|
1929
|
-
const
|
|
1930
|
-
if (!
|
|
1931
|
-
const
|
|
1932
|
-
|
|
1929
|
+
}, [c, a]), N = le(() => u ? j() : y(), [u, y, j]), k = le(() => {
|
|
1930
|
+
var z;
|
|
1931
|
+
const B = m.current;
|
|
1932
|
+
if (!B) return;
|
|
1933
|
+
const L = B.getBoundingClientRect(), O = window.innerHeight, C = ((z = x.current) == null ? void 0 : z.offsetHeight) ?? 300, w = Math.max(He, Math.min(O - C - He, L.top));
|
|
1934
|
+
v(i === "right" ? {
|
|
1933
1935
|
position: "fixed",
|
|
1934
1936
|
top: w,
|
|
1935
|
-
right: window.innerWidth -
|
|
1937
|
+
right: window.innerWidth - L.left + Ye,
|
|
1936
1938
|
width: Ve
|
|
1937
1939
|
} : {
|
|
1938
1940
|
position: "fixed",
|
|
1939
1941
|
top: w,
|
|
1940
|
-
left:
|
|
1942
|
+
left: L.right + Ye,
|
|
1941
1943
|
width: Ve
|
|
1942
1944
|
});
|
|
1943
1945
|
}, [i]);
|
|
1944
|
-
|
|
1946
|
+
P(() => {
|
|
1945
1947
|
if (!u) {
|
|
1946
1948
|
h(!1);
|
|
1947
1949
|
return;
|
|
@@ -1949,18 +1951,18 @@ function sn({
|
|
|
1949
1951
|
return k(), requestAnimationFrame(() => h(!0)), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k), () => {
|
|
1950
1952
|
window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
|
|
1951
1953
|
};
|
|
1952
|
-
}, [u, k]),
|
|
1954
|
+
}, [u, k]), P(() => {
|
|
1953
1955
|
if (!u) return;
|
|
1954
|
-
const
|
|
1956
|
+
const B = (O) => {
|
|
1955
1957
|
var C, w;
|
|
1956
|
-
!((C = x.current) != null && C.contains(O.target)) && !((w = m.current) != null && w.contains(O.target)) &&
|
|
1957
|
-
},
|
|
1958
|
-
O.key === "Escape" &&
|
|
1958
|
+
!((C = x.current) != null && C.contains(O.target)) && !((w = m.current) != null && w.contains(O.target)) && j();
|
|
1959
|
+
}, L = (O) => {
|
|
1960
|
+
O.key === "Escape" && j();
|
|
1959
1961
|
};
|
|
1960
|
-
return document.addEventListener("mousedown",
|
|
1961
|
-
document.removeEventListener("mousedown",
|
|
1962
|
+
return document.addEventListener("mousedown", B), document.addEventListener("keydown", L), () => {
|
|
1963
|
+
document.removeEventListener("mousedown", B), document.removeEventListener("keydown", L);
|
|
1962
1964
|
};
|
|
1963
|
-
}, [u,
|
|
1965
|
+
}, [u, j]);
|
|
1964
1966
|
const S = u && /* @__PURE__ */ e.jsxs(
|
|
1965
1967
|
"div",
|
|
1966
1968
|
{
|
|
@@ -1970,7 +1972,7 @@ function sn({
|
|
|
1970
1972
|
`ds-nav-rail-flyout--${i}`,
|
|
1971
1973
|
p && "ds-nav-rail-flyout--visible"
|
|
1972
1974
|
].filter(Boolean).join(" "),
|
|
1973
|
-
style:
|
|
1975
|
+
style: b,
|
|
1974
1976
|
"data-ds-portal": "",
|
|
1975
1977
|
role: "dialog",
|
|
1976
1978
|
"aria-modal": "false",
|
|
@@ -1982,7 +1984,7 @@ function sn({
|
|
|
1982
1984
|
{
|
|
1983
1985
|
type: "button",
|
|
1984
1986
|
className: "ds-nav-rail-flyout__close",
|
|
1985
|
-
onClick:
|
|
1987
|
+
onClick: j,
|
|
1986
1988
|
"aria-label": "Close",
|
|
1987
1989
|
children: /* @__PURE__ */ e.jsx(Q, { size: 16, strokeWidth: 2 })
|
|
1988
1990
|
}
|
|
@@ -2056,26 +2058,26 @@ function rn({
|
|
|
2056
2058
|
style: l,
|
|
2057
2059
|
...d
|
|
2058
2060
|
}) {
|
|
2059
|
-
const [c, u] = I(!1), [p, h] = I(!1), m = n !== void 0, x = m ? n : c,
|
|
2061
|
+
const [c, u] = I(!1), [p, h] = I(!1), m = n !== void 0, x = m ? n : c, b = R(null), v = R(null), y = R(null), j = R(null), [N, k] = I({}), S = R(null), B = 150, L = () => {
|
|
2060
2062
|
if (m)
|
|
2061
2063
|
r == null || r(!1);
|
|
2062
2064
|
else {
|
|
2063
2065
|
if (p) return;
|
|
2064
2066
|
h(!0), S.current = setTimeout(() => {
|
|
2065
2067
|
u(!1), h(!1);
|
|
2066
|
-
},
|
|
2068
|
+
}, B);
|
|
2067
2069
|
}
|
|
2068
2070
|
}, O = () => {
|
|
2069
2071
|
const _ = !x;
|
|
2070
|
-
m ? r == null || r(_) : _ ? (clearTimeout(S.current), h(!1), u(!0)) :
|
|
2072
|
+
m ? r == null || r(_) : _ ? (clearTimeout(S.current), h(!1), u(!0)) : L();
|
|
2071
2073
|
}, C = () => {
|
|
2072
2074
|
x || (m ? r == null || r(!0) : (clearTimeout(S.current), h(!1), u(!0)));
|
|
2073
2075
|
};
|
|
2074
|
-
|
|
2076
|
+
P(() => () => clearTimeout(S.current), []), P(() => {
|
|
2075
2077
|
if (!x) return;
|
|
2076
2078
|
const _ = 300, E = () => {
|
|
2077
2079
|
var $;
|
|
2078
|
-
const A = ($ =
|
|
2080
|
+
const A = ($ = b.current) == null ? void 0 : $.getBoundingClientRect();
|
|
2079
2081
|
if (!A) return;
|
|
2080
2082
|
const U = window.innerHeight - A.bottom, G = U < _ + 8 && A.top > U;
|
|
2081
2083
|
k(
|
|
@@ -2088,43 +2090,43 @@ function rn({
|
|
|
2088
2090
|
}, [x, a]);
|
|
2089
2091
|
const w = () => {
|
|
2090
2092
|
var E;
|
|
2091
|
-
const _ = (E =
|
|
2093
|
+
const _ = (E = y.current) == null ? void 0 : E.querySelector(
|
|
2092
2094
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
2093
2095
|
);
|
|
2094
2096
|
_ == null || _.focus();
|
|
2095
2097
|
};
|
|
2096
|
-
|
|
2098
|
+
P(() => {
|
|
2097
2099
|
if (!x) return;
|
|
2098
2100
|
const _ = (A) => {
|
|
2099
2101
|
var U, G;
|
|
2100
|
-
!((U =
|
|
2102
|
+
!((U = b.current) != null && U.contains(A.target)) && !((G = v.current) != null && G.contains(A.target)) && L();
|
|
2101
2103
|
}, E = (A) => {
|
|
2102
|
-
A.key === "Escape" && (
|
|
2104
|
+
A.key === "Escape" && (L(), w());
|
|
2103
2105
|
};
|
|
2104
2106
|
return document.addEventListener("mousedown", _), document.addEventListener("keydown", E), () => {
|
|
2105
2107
|
document.removeEventListener("mousedown", _), document.removeEventListener("keydown", E);
|
|
2106
2108
|
};
|
|
2107
|
-
}, [x]),
|
|
2108
|
-
if (!x || !
|
|
2109
|
-
const _ =
|
|
2110
|
-
E == null || E.focus(),
|
|
2109
|
+
}, [x]), P(() => {
|
|
2110
|
+
if (!x || !j.current || !v.current) return;
|
|
2111
|
+
const _ = z(), E = j.current === "last" ? _[_.length - 1] : _[0];
|
|
2112
|
+
E == null || E.focus(), j.current = null;
|
|
2111
2113
|
}, [x]);
|
|
2112
|
-
const
|
|
2114
|
+
const z = () => v.current ? [...v.current.querySelectorAll(
|
|
2113
2115
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
2114
2116
|
)] : [], K = (_) => {
|
|
2115
2117
|
var E, A;
|
|
2116
2118
|
if (_.key === "ArrowDown")
|
|
2117
|
-
_.preventDefault(), x ? (E =
|
|
2119
|
+
_.preventDefault(), x ? (E = z()[0]) == null || E.focus() : (j.current = "first", C());
|
|
2118
2120
|
else if (_.key === "ArrowUp")
|
|
2119
2121
|
if (_.preventDefault(), !x)
|
|
2120
|
-
|
|
2122
|
+
j.current = "last", C();
|
|
2121
2123
|
else {
|
|
2122
|
-
const U =
|
|
2124
|
+
const U = z();
|
|
2123
2125
|
(A = U[U.length - 1]) == null || A.focus();
|
|
2124
2126
|
}
|
|
2125
2127
|
}, V = (_) => {
|
|
2126
2128
|
var U, G, $, f;
|
|
2127
|
-
const E =
|
|
2129
|
+
const E = z(), A = E.findIndex((T) => T === document.activeElement);
|
|
2128
2130
|
switch (_.key) {
|
|
2129
2131
|
case "ArrowDown":
|
|
2130
2132
|
_.preventDefault(), (U = E[Math.min(A + 1, E.length - 1)]) == null || U.focus();
|
|
@@ -2139,13 +2141,13 @@ function rn({
|
|
|
2139
2141
|
_.preventDefault(), (f = E[E.length - 1]) == null || f.focus();
|
|
2140
2142
|
break;
|
|
2141
2143
|
case "Tab":
|
|
2142
|
-
|
|
2144
|
+
L();
|
|
2143
2145
|
break;
|
|
2144
2146
|
}
|
|
2145
2147
|
}, D = x && /* @__PURE__ */ e.jsx(
|
|
2146
2148
|
"div",
|
|
2147
2149
|
{
|
|
2148
|
-
ref:
|
|
2150
|
+
ref: v,
|
|
2149
2151
|
role: "menu",
|
|
2150
2152
|
"data-ds-portal": "",
|
|
2151
2153
|
className: [
|
|
@@ -2175,7 +2177,7 @@ function rn({
|
|
|
2175
2177
|
...G,
|
|
2176
2178
|
onClick: () => {
|
|
2177
2179
|
var $;
|
|
2178
|
-
($ = _.onClick) == null || $.call(_),
|
|
2180
|
+
($ = _.onClick) == null || $.call(_), L();
|
|
2179
2181
|
},
|
|
2180
2182
|
children: [
|
|
2181
2183
|
_.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: _.icon }),
|
|
@@ -2191,7 +2193,7 @@ function rn({
|
|
|
2191
2193
|
return /* @__PURE__ */ e.jsxs(
|
|
2192
2194
|
"div",
|
|
2193
2195
|
{
|
|
2194
|
-
ref:
|
|
2196
|
+
ref: b,
|
|
2195
2197
|
className: ["ds-dropdown", o && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
|
|
2196
2198
|
style: l,
|
|
2197
2199
|
...d,
|
|
@@ -2199,7 +2201,7 @@ function rn({
|
|
|
2199
2201
|
/* @__PURE__ */ e.jsx(
|
|
2200
2202
|
"div",
|
|
2201
2203
|
{
|
|
2202
|
-
ref:
|
|
2204
|
+
ref: y,
|
|
2203
2205
|
className: "ds-dropdown__trigger",
|
|
2204
2206
|
onClick: O,
|
|
2205
2207
|
onKeyDown: K,
|
|
@@ -2251,7 +2253,7 @@ function an({
|
|
|
2251
2253
|
const Ft = (t) => 1 - Math.pow(1 - t, 3), Ct = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2252
2254
|
function Wt(t, { duration: s = 600 } = {}) {
|
|
2253
2255
|
const [n, r] = I(t), a = R(t), o = R(null);
|
|
2254
|
-
return
|
|
2256
|
+
return P(() => {
|
|
2255
2257
|
if (Ct()) {
|
|
2256
2258
|
r(t), a.current = t;
|
|
2257
2259
|
return;
|
|
@@ -2279,7 +2281,7 @@ function on({
|
|
|
2279
2281
|
}
|
|
2280
2282
|
function Ot({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2281
2283
|
const r = R(null), [a, o] = I(!1);
|
|
2282
|
-
return
|
|
2284
|
+
return P(() => {
|
|
2283
2285
|
const i = r.current;
|
|
2284
2286
|
if (!i) return;
|
|
2285
2287
|
const l = new IntersectionObserver(
|
|
@@ -2302,7 +2304,7 @@ function ln({
|
|
|
2302
2304
|
...l
|
|
2303
2305
|
}) {
|
|
2304
2306
|
const { ref: d, inView: c } = Ot({ threshold: r, rootMargin: a, once: n }), u = R(!1);
|
|
2305
|
-
return
|
|
2307
|
+
return P(() => {
|
|
2306
2308
|
c && !u.current && (o == null || o()), !c && u.current && (i == null || i()), u.current = c;
|
|
2307
2309
|
}, [c]), /* @__PURE__ */ e.jsx(s, { ref: d, ...l, children: typeof t == "function" ? t(c) : t });
|
|
2308
2310
|
}
|
|
@@ -2314,14 +2316,14 @@ const qe = {
|
|
|
2314
2316
|
};
|
|
2315
2317
|
let xe = [];
|
|
2316
2318
|
const $e = /* @__PURE__ */ new Set();
|
|
2317
|
-
function
|
|
2319
|
+
function tt() {
|
|
2318
2320
|
$e.forEach((t) => t([...xe]));
|
|
2319
2321
|
}
|
|
2320
2322
|
function Ut(t) {
|
|
2321
|
-
xe = [...xe, t],
|
|
2323
|
+
xe = [...xe, t], tt();
|
|
2322
2324
|
}
|
|
2323
2325
|
function Vt(t) {
|
|
2324
|
-
xe = xe.filter((s) => s.id !== t),
|
|
2326
|
+
xe = xe.filter((s) => s.id !== t), tt();
|
|
2325
2327
|
}
|
|
2326
2328
|
function cn() {
|
|
2327
2329
|
const t = (s, n = {}) => {
|
|
@@ -2337,7 +2339,7 @@ function cn() {
|
|
|
2337
2339
|
}
|
|
2338
2340
|
function Yt({ data: t, onDismiss: s }) {
|
|
2339
2341
|
const [n, r] = I(!1), a = R(null);
|
|
2340
|
-
|
|
2342
|
+
P(() => (requestAnimationFrame(() => r(!0)), t.duration > 0 && (a.current = setTimeout(() => o(), t.duration)), () => clearTimeout(a.current)), []);
|
|
2341
2343
|
function o() {
|
|
2342
2344
|
r(!1), setTimeout(() => s(t.id), 250);
|
|
2343
2345
|
}
|
|
@@ -2370,7 +2372,7 @@ function Yt({ data: t, onDismiss: s }) {
|
|
|
2370
2372
|
}
|
|
2371
2373
|
function dn({ position: t = "bottom-right" }) {
|
|
2372
2374
|
const [s, n] = I(() => [...xe]);
|
|
2373
|
-
return
|
|
2375
|
+
return P(() => ($e.add(n), () => $e.delete(n)), []), !s.length || typeof document > "u" ? null : me.createPortal(
|
|
2374
2376
|
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(Yt, { data: r, onDismiss: Vt }, r.id)) }),
|
|
2375
2377
|
document.body
|
|
2376
2378
|
);
|
|
@@ -2451,7 +2453,7 @@ function qt({
|
|
|
2451
2453
|
}
|
|
2452
2454
|
function fn({ content: t, streaming: s = !1, ...n }) {
|
|
2453
2455
|
const [r, a] = I(s);
|
|
2454
|
-
return
|
|
2456
|
+
return P(() => {
|
|
2455
2457
|
a(!!s);
|
|
2456
2458
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2457
2459
|
Be,
|
|
@@ -2464,7 +2466,7 @@ function fn({ content: t, streaming: s = !1, ...n }) {
|
|
|
2464
2466
|
/* @__PURE__ */ e.jsx(yt, { secondary: !0, children: "Thinking" })
|
|
2465
2467
|
] }),
|
|
2466
2468
|
...n,
|
|
2467
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2469
|
+
children: /* @__PURE__ */ e.jsxs(et, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2468
2470
|
t,
|
|
2469
2471
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
2470
2472
|
] })
|
|
@@ -2503,7 +2505,7 @@ function mn({
|
|
|
2503
2505
|
c
|
|
2504
2506
|
);
|
|
2505
2507
|
}) }),
|
|
2506
|
-
a && /* @__PURE__ */ e.jsxs(
|
|
2508
|
+
a && /* @__PURE__ */ e.jsxs(et, { secondary: !0, className: "ds-step-indicator__counter", children: [
|
|
2507
2509
|
s + 1,
|
|
2508
2510
|
" / ",
|
|
2509
2511
|
t
|
|
@@ -2519,7 +2521,7 @@ function pn({
|
|
|
2519
2521
|
...o
|
|
2520
2522
|
}) {
|
|
2521
2523
|
const i = R(t);
|
|
2522
|
-
return
|
|
2524
|
+
return P(() => {
|
|
2523
2525
|
t !== i.current && (r == null || r(t), i.current = t);
|
|
2524
2526
|
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...o, children: [
|
|
2525
2527
|
t,
|
|
@@ -2555,7 +2557,7 @@ function hn({
|
|
|
2555
2557
|
}
|
|
2556
2558
|
function xn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2557
2559
|
const r = R(!1), a = R(0);
|
|
2558
|
-
|
|
2560
|
+
P(() => {
|
|
2559
2561
|
const o = s == null ? void 0 : s.current;
|
|
2560
2562
|
if (!o) return;
|
|
2561
2563
|
const i = () => {
|
|
@@ -2563,7 +2565,7 @@ function xn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
|
2563
2565
|
!l && o.scrollTop < a.current && (r.current = !0), l && (r.current = !1), a.current = o.scrollTop;
|
|
2564
2566
|
};
|
|
2565
2567
|
return o.addEventListener("scroll", i, { passive: !0 }), () => o.removeEventListener("scroll", i);
|
|
2566
|
-
}, [s]),
|
|
2568
|
+
}, [s]), P(() => {
|
|
2567
2569
|
const o = s == null ? void 0 : s.current;
|
|
2568
2570
|
o && (n && r.current || (o.scrollTop = o.scrollHeight));
|
|
2569
2571
|
}, t);
|
|
@@ -2577,33 +2579,33 @@ function Gt({
|
|
|
2577
2579
|
betweenTime: o = 380,
|
|
2578
2580
|
manualPauseMs: i = 5e3
|
|
2579
2581
|
}) {
|
|
2580
|
-
const [l, d] = I(0), [c, u] = I(""), p = R("typing"), h = R(0), m = R(0), x = R(null),
|
|
2581
|
-
|
|
2582
|
+
const [l, d] = I(0), [c, u] = I(""), p = R("typing"), h = R(0), m = R(0), x = R(null), b = R(0);
|
|
2583
|
+
P(() => {
|
|
2582
2584
|
m.current = l;
|
|
2583
|
-
}, [l]),
|
|
2585
|
+
}, [l]), P(() => {
|
|
2584
2586
|
if (x.current && (clearTimeout(x.current), x.current = null), !s || t.length === 0) {
|
|
2585
2587
|
u(""), h.current = 0, p.current = "typing";
|
|
2586
2588
|
return;
|
|
2587
2589
|
}
|
|
2588
2590
|
const k = () => {
|
|
2589
2591
|
const S = Date.now();
|
|
2590
|
-
if (
|
|
2591
|
-
x.current = setTimeout(k,
|
|
2592
|
+
if (b.current > S) {
|
|
2593
|
+
x.current = setTimeout(k, b.current - S);
|
|
2592
2594
|
return;
|
|
2593
2595
|
}
|
|
2594
|
-
const
|
|
2595
|
-
p.current === "typing" ? (h.current += 1, u(
|
|
2596
|
+
const B = t[m.current % t.length] ?? "";
|
|
2597
|
+
p.current === "typing" ? (h.current += 1, u(B.slice(0, h.current)), h.current >= B.length ? (p.current = "holding", x.current = setTimeout(k, a)) : x.current = setTimeout(k, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(k, r)) : (h.current = Math.max(0, h.current - 1), u(B.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", m.current = (m.current + 1) % t.length, d(m.current), x.current = setTimeout(k, o)) : x.current = setTimeout(k, r));
|
|
2596
2598
|
};
|
|
2597
2599
|
return x.current = setTimeout(k, 260), () => {
|
|
2598
2600
|
x.current && clearTimeout(x.current);
|
|
2599
2601
|
};
|
|
2600
2602
|
}, [s, t, n, r, a, o]);
|
|
2601
|
-
const
|
|
2603
|
+
const v = (k) => {
|
|
2602
2604
|
if (t.length === 0) return;
|
|
2603
|
-
const S = (k % t.length + t.length) % t.length,
|
|
2604
|
-
m.current = S, h.current =
|
|
2605
|
-
},
|
|
2606
|
-
return { displayed: c, currentPrompt: N, index: l, next:
|
|
2605
|
+
const S = (k % t.length + t.length) % t.length, B = t[S];
|
|
2606
|
+
m.current = S, h.current = B.length, p.current = "holding", b.current = Date.now() + i, d(S), u(B);
|
|
2607
|
+
}, y = () => v(m.current + 1), j = () => v(m.current - 1), N = t[l % t.length] ?? "";
|
|
2608
|
+
return { displayed: c, currentPrompt: N, index: l, next: y, prev: j };
|
|
2607
2609
|
}
|
|
2608
2610
|
let Kt = 0;
|
|
2609
2611
|
function vn({
|
|
@@ -2622,91 +2624,91 @@ function vn({
|
|
|
2622
2624
|
onAttachImages: h,
|
|
2623
2625
|
onRemoveAttachment: m,
|
|
2624
2626
|
onRemoveImage: x,
|
|
2625
|
-
acceptImage:
|
|
2626
|
-
acceptFile:
|
|
2627
|
-
maxImages:
|
|
2628
|
-
maxImageSize:
|
|
2627
|
+
acceptImage: b,
|
|
2628
|
+
acceptFile: v,
|
|
2629
|
+
maxImages: y,
|
|
2630
|
+
maxImageSize: j,
|
|
2629
2631
|
leftSlot: N,
|
|
2630
2632
|
rightSlot: k,
|
|
2631
2633
|
className: S = "",
|
|
2632
|
-
...
|
|
2634
|
+
...B
|
|
2633
2635
|
}) {
|
|
2634
|
-
const
|
|
2635
|
-
const
|
|
2636
|
-
V((X) => [...X, { id:
|
|
2637
|
-
}, _ = (
|
|
2638
|
-
const
|
|
2639
|
-
let te = 0, ue =
|
|
2640
|
-
for (const se of
|
|
2641
|
-
U(se) ?
|
|
2642
|
-
return { imageFiles:
|
|
2643
|
-
}, f = (
|
|
2644
|
-
const { imageFiles:
|
|
2645
|
-
J.length && D(`File${J.length > 1 ? "s" : ""} too large${
|
|
2646
|
-
const ue = X.concat(h ? [] :
|
|
2636
|
+
const L = R(null), O = R(null), C = R(0), [w, z] = I(!1), [K, V] = I([]), D = (g) => {
|
|
2637
|
+
const M = ++Kt;
|
|
2638
|
+
V((X) => [...X, { id: M, msg: g }]), setTimeout(() => V((X) => X.filter((J) => J.id !== M)), 6e3);
|
|
2639
|
+
}, _ = (g) => V((M) => M.filter((X) => X.id !== g)), E = (g) => g.type.startsWith("image/"), A = () => !0, U = b ?? E, G = v ?? A, $ = (g) => {
|
|
2640
|
+
const M = [], X = [], J = [], Z = [];
|
|
2641
|
+
let te = 0, ue = y != null ? y - ((u == null ? void 0 : u.length) ?? 0) : 1 / 0;
|
|
2642
|
+
for (const se of g)
|
|
2643
|
+
U(se) ? j && se.size > j ? J.push(se.name) : ue > 0 ? (M.push(se), ue--) : te++ : G(se) ? X.push(se) : Z.push(se.name);
|
|
2644
|
+
return { imageFiles: M, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te };
|
|
2645
|
+
}, f = (g) => {
|
|
2646
|
+
const { imageFiles: M, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te } = $(g);
|
|
2647
|
+
J.length && D(`File${J.length > 1 ? "s" : ""} too large${j ? ` (max ${j / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && D(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), te && D(`Max ${y} images per message`), h && M.length && h(M);
|
|
2648
|
+
const ue = X.concat(h ? [] : M);
|
|
2647
2649
|
p && ue.length && p(ue);
|
|
2648
2650
|
};
|
|
2649
|
-
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2652
|
-
}, [t]),
|
|
2653
|
-
const
|
|
2651
|
+
P(() => {
|
|
2652
|
+
const g = O.current;
|
|
2653
|
+
g && (g.style.height = "auto", g.style.height = `${Math.min(g.scrollHeight, 200)}px`);
|
|
2654
|
+
}, [t]), P(() => {
|
|
2655
|
+
const g = (M) => {
|
|
2654
2656
|
var J, Z, te;
|
|
2655
2657
|
if (o || i) return;
|
|
2656
|
-
const X = (J =
|
|
2657
|
-
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z =
|
|
2658
|
+
const X = (J = M.target) == null ? void 0 : J.tagName;
|
|
2659
|
+
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z = M.target) != null && Z.isContentEditable || M.ctrlKey || M.metaKey || M.altKey || M.key.length !== 1 && M.key !== "Backspace" && M.key !== "Delete" || (te = O.current) == null || te.focus();
|
|
2658
2660
|
};
|
|
2659
|
-
return document.addEventListener("keydown",
|
|
2661
|
+
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
2660
2662
|
}, [o, i]);
|
|
2661
|
-
const T = (
|
|
2662
|
-
|
|
2663
|
-
}, W = (
|
|
2664
|
-
|
|
2665
|
-
}, Y = (
|
|
2666
|
-
|
|
2667
|
-
const
|
|
2668
|
-
|
|
2669
|
-
}, oe = (
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2672
|
-
}, q = (
|
|
2663
|
+
const T = (g) => {
|
|
2664
|
+
g.preventDefault(), C.current++, g.dataTransfer.types.includes("Files") && z(!0);
|
|
2665
|
+
}, W = (g) => {
|
|
2666
|
+
g.preventDefault(), C.current--, C.current === 0 && z(!1);
|
|
2667
|
+
}, Y = (g) => g.preventDefault(), ne = (g) => {
|
|
2668
|
+
g.preventDefault(), C.current = 0, z(!1);
|
|
2669
|
+
const M = Array.from(g.dataTransfer.files);
|
|
2670
|
+
M.length && f(M);
|
|
2671
|
+
}, oe = (g) => {
|
|
2672
|
+
const M = Array.from(g.target.files || []);
|
|
2673
|
+
L.current && (L.current.value = ""), M.length && f(M);
|
|
2674
|
+
}, q = (g) => {
|
|
2673
2675
|
var se;
|
|
2674
2676
|
if (!h) return;
|
|
2675
|
-
const
|
|
2676
|
-
if (!
|
|
2677
|
+
const M = (se = g.clipboardData) == null ? void 0 : se.items;
|
|
2678
|
+
if (!M) return;
|
|
2677
2679
|
const X = [];
|
|
2678
|
-
for (const
|
|
2679
|
-
const Me =
|
|
2680
|
+
for (const nt of M) {
|
|
2681
|
+
const Me = nt.getAsFile();
|
|
2680
2682
|
Me && X.push(Me);
|
|
2681
2683
|
}
|
|
2682
2684
|
if (X.length === 0) return;
|
|
2683
2685
|
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ue } = $(X);
|
|
2684
|
-
Z.length && D(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), te.length && D(`Skipped unsupported file${te.length > 1 ? "s" : ""}: ${te.join(", ")}`), ue && D(`Max ${
|
|
2686
|
+
Z.length && D(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), te.length && D(`Skipped unsupported file${te.length > 1 ? "s" : ""}: ${te.join(", ")}`), ue && D(`Max ${y} images per message`), J.length && (g.preventDefault(), h(J));
|
|
2685
2687
|
}, ee = !o && !i && !!(d != null && d.length) && t.length === 0, ie = Gt({
|
|
2686
2688
|
prompts: d ?? [],
|
|
2687
2689
|
enabled: ee
|
|
2688
|
-
}), ge = (
|
|
2690
|
+
}), ge = (g) => {
|
|
2689
2691
|
if (ee) {
|
|
2690
|
-
if (
|
|
2691
|
-
|
|
2692
|
+
if (g.key === "ArrowDown" || g.key === "ArrowRight") {
|
|
2693
|
+
g.preventDefault(), ie.next();
|
|
2692
2694
|
return;
|
|
2693
2695
|
}
|
|
2694
|
-
if (
|
|
2695
|
-
|
|
2696
|
+
if (g.key === "ArrowUp" || g.key === "ArrowLeft") {
|
|
2697
|
+
g.preventDefault(), ie.prev();
|
|
2696
2698
|
return;
|
|
2697
2699
|
}
|
|
2698
|
-
if (
|
|
2699
|
-
|
|
2700
|
+
if (g.key === "Tab" && !g.shiftKey) {
|
|
2701
|
+
g.preventDefault(), s == null || s(ie.currentPrompt);
|
|
2700
2702
|
return;
|
|
2701
2703
|
}
|
|
2702
2704
|
}
|
|
2703
|
-
a == null || a(
|
|
2704
|
-
},
|
|
2705
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", S].filter(Boolean).join(" "), ...
|
|
2705
|
+
a == null || a(g);
|
|
2706
|
+
}, st = (t.trim() || (u == null ? void 0 : u.length) > 0 || (c == null ? void 0 : c.length) > 0) && !i, Pe = p || h;
|
|
2707
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", S].filter(Boolean).join(" "), ...B, children: [
|
|
2706
2708
|
Pe && /* @__PURE__ */ e.jsx(
|
|
2707
2709
|
"input",
|
|
2708
2710
|
{
|
|
2709
|
-
ref:
|
|
2711
|
+
ref: L,
|
|
2710
2712
|
type: "file",
|
|
2711
2713
|
multiple: !0,
|
|
2712
2714
|
accept: "*/*",
|
|
@@ -2729,7 +2731,7 @@ function vn({
|
|
|
2729
2731
|
{
|
|
2730
2732
|
ref: O,
|
|
2731
2733
|
value: t,
|
|
2732
|
-
onChange: (
|
|
2734
|
+
onChange: (g) => s == null ? void 0 : s(g.target.value),
|
|
2733
2735
|
onKeyDown: ge,
|
|
2734
2736
|
onPaste: q,
|
|
2735
2737
|
placeholder: ee ? "" : l,
|
|
@@ -2742,45 +2744,45 @@ function vn({
|
|
|
2742
2744
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
|
|
2743
2745
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2744
2746
|
] }),
|
|
2745
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((
|
|
2746
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2747
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((g, M) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2748
|
+
/* @__PURE__ */ e.jsx("img", { src: g.preview, alt: "" }),
|
|
2747
2749
|
/* @__PURE__ */ e.jsx(
|
|
2748
2750
|
"button",
|
|
2749
2751
|
{
|
|
2750
2752
|
className: "ds-prompt-input__image-remove",
|
|
2751
|
-
onClick: () => x == null ? void 0 : x(
|
|
2753
|
+
onClick: () => x == null ? void 0 : x(M),
|
|
2752
2754
|
"aria-label": "Remove image",
|
|
2753
2755
|
type: "button",
|
|
2754
2756
|
children: /* @__PURE__ */ e.jsx(Q, { size: 12, strokeWidth: 2 })
|
|
2755
2757
|
}
|
|
2756
2758
|
)
|
|
2757
|
-
] },
|
|
2758
|
-
K.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: K.map((
|
|
2759
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2759
|
+
] }, M)) }),
|
|
2760
|
+
K.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: K.map((g) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2761
|
+
/* @__PURE__ */ e.jsx("span", { children: g.msg }),
|
|
2760
2762
|
/* @__PURE__ */ e.jsx(
|
|
2761
2763
|
"button",
|
|
2762
2764
|
{
|
|
2763
2765
|
type: "button",
|
|
2764
2766
|
className: "ds-prompt-input__warning-close",
|
|
2765
|
-
onClick: () => _(
|
|
2767
|
+
onClick: () => _(g.id),
|
|
2766
2768
|
"aria-label": "Dismiss",
|
|
2767
2769
|
children: /* @__PURE__ */ e.jsx(Q, { size: F[1], strokeWidth: 1.5 })
|
|
2768
2770
|
}
|
|
2769
2771
|
)
|
|
2770
|
-
] },
|
|
2771
|
-
c && c.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: c.map((
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2772
|
+
] }, g.id)) }),
|
|
2773
|
+
c && c.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: c.map((g, M) => /* @__PURE__ */ e.jsx(fe, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2774
|
+
g.uploading ? /* @__PURE__ */ e.jsx(mt, { size: F[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(ze, { size: F[1], strokeWidth: 1.5 }),
|
|
2775
|
+
g.filename,
|
|
2776
|
+
g.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2775
2777
|
"button",
|
|
2776
2778
|
{
|
|
2777
2779
|
type: "button",
|
|
2778
2780
|
className: "ds-prompt-input__remove-btn",
|
|
2779
|
-
onClick: () => m == null ? void 0 : m(
|
|
2781
|
+
onClick: () => m == null ? void 0 : m(M),
|
|
2780
2782
|
children: /* @__PURE__ */ e.jsx(Q, { size: F[1], strokeWidth: 1.5 })
|
|
2781
2783
|
}
|
|
2782
2784
|
)
|
|
2783
|
-
] }) },
|
|
2785
|
+
] }) }, M)) }),
|
|
2784
2786
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2785
2787
|
Pe && /* @__PURE__ */ e.jsx(
|
|
2786
2788
|
ae,
|
|
@@ -2790,8 +2792,8 @@ function vn({
|
|
|
2790
2792
|
icon: /* @__PURE__ */ e.jsx(ze, { size: F[2], strokeWidth: 1.5 }),
|
|
2791
2793
|
"aria-label": "Attach files",
|
|
2792
2794
|
onClick: () => {
|
|
2793
|
-
var
|
|
2794
|
-
return (
|
|
2795
|
+
var g;
|
|
2796
|
+
return (g = L.current) == null ? void 0 : g.click();
|
|
2795
2797
|
}
|
|
2796
2798
|
}
|
|
2797
2799
|
),
|
|
@@ -2814,7 +2816,7 @@ function vn({
|
|
|
2814
2816
|
size: "xs",
|
|
2815
2817
|
icon: /* @__PURE__ */ e.jsx(ht, { size: F[2], strokeWidth: 1.5 }),
|
|
2816
2818
|
onClick: n,
|
|
2817
|
-
disabled: !
|
|
2819
|
+
disabled: !st,
|
|
2818
2820
|
"aria-label": "Send"
|
|
2819
2821
|
}
|
|
2820
2822
|
)
|
|
@@ -2836,22 +2838,22 @@ function _n({
|
|
|
2836
2838
|
className: l = "",
|
|
2837
2839
|
...d
|
|
2838
2840
|
}) {
|
|
2839
|
-
const [c, u] = I(!1), p = R(null), h = R(null), m = R(null), [x,
|
|
2840
|
-
|
|
2841
|
+
const [c, u] = I(!1), p = R(null), h = R(null), m = R(null), [x, b] = I({}), v = t.filter((w) => !a || w.name === "auto" ? !0 : (Ge[w.tier] ?? 1) >= (Ge[a] ?? 1)), y = v.find((w) => w.name === "auto"), j = v.filter((w) => w.name !== "auto"), N = t.find((w) => w.name === s), S = new Set(j.map((w) => w.tier).filter(Boolean)).size > 1;
|
|
2842
|
+
P(() => {
|
|
2841
2843
|
if (!c) return;
|
|
2842
|
-
const w = 320,
|
|
2844
|
+
const w = 320, z = () => {
|
|
2843
2845
|
var A;
|
|
2844
2846
|
const D = (A = h.current) == null ? void 0 : A.getBoundingClientRect();
|
|
2845
2847
|
if (!D) return;
|
|
2846
2848
|
const _ = window.innerHeight - D.bottom, E = _ < w + 8 && D.top > _;
|
|
2847
|
-
|
|
2849
|
+
b({
|
|
2848
2850
|
position: "fixed",
|
|
2849
2851
|
zIndex: "var(--z-dropdown, 500)",
|
|
2850
2852
|
left: D.left,
|
|
2851
2853
|
...E ? { bottom: window.innerHeight - D.top + 4, top: "auto" } : { top: D.bottom + 4, bottom: "auto" }
|
|
2852
2854
|
});
|
|
2853
2855
|
};
|
|
2854
|
-
|
|
2856
|
+
z(), window.addEventListener("scroll", z, !0), window.addEventListener("resize", z);
|
|
2855
2857
|
const K = (D) => {
|
|
2856
2858
|
var _, E;
|
|
2857
2859
|
!((_ = p.current) != null && _.contains(D.target)) && !((E = m.current) != null && E.contains(D.target)) && u(!1);
|
|
@@ -2859,12 +2861,12 @@ function _n({
|
|
|
2859
2861
|
D.key === "Escape" && u(!1);
|
|
2860
2862
|
};
|
|
2861
2863
|
return document.addEventListener("mousedown", K), document.addEventListener("keydown", V), () => {
|
|
2862
|
-
window.removeEventListener("scroll",
|
|
2864
|
+
window.removeEventListener("scroll", z, !0), window.removeEventListener("resize", z), document.removeEventListener("mousedown", K), document.removeEventListener("keydown", V);
|
|
2863
2865
|
};
|
|
2864
2866
|
}, [c]);
|
|
2865
|
-
const
|
|
2867
|
+
const B = (w) => {
|
|
2866
2868
|
n == null || n(w), u(!1);
|
|
2867
|
-
},
|
|
2869
|
+
}, L = (w) => /* @__PURE__ */ e.jsxs(
|
|
2868
2870
|
"button",
|
|
2869
2871
|
{
|
|
2870
2872
|
type: "button",
|
|
@@ -2872,7 +2874,7 @@ function _n({
|
|
|
2872
2874
|
"ds-model-picker__item",
|
|
2873
2875
|
w.name === s && "ds-model-picker__item--active"
|
|
2874
2876
|
].filter(Boolean).join(" "),
|
|
2875
|
-
onClick: () =>
|
|
2877
|
+
onClick: () => B(w.name),
|
|
2876
2878
|
children: [
|
|
2877
2879
|
w.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: w.icon }) : /* @__PURE__ */ e.jsx(Fe, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2878
2880
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: w.displayName || w.name }),
|
|
@@ -2880,14 +2882,14 @@ function _n({
|
|
|
2880
2882
|
]
|
|
2881
2883
|
},
|
|
2882
2884
|
w.name
|
|
2883
|
-
), O = () => !i || !S ?
|
|
2884
|
-
const
|
|
2885
|
-
return
|
|
2885
|
+
), O = () => !i || !S ? j.map(L) : ["fast", "standard", "premium"].flatMap((w) => {
|
|
2886
|
+
const z = j.filter((K) => K.tier === w);
|
|
2887
|
+
return z.length ? [
|
|
2886
2888
|
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": w, children: w.charAt(0).toUpperCase() + w.slice(1) }, `lbl-${w}`),
|
|
2887
|
-
...
|
|
2889
|
+
...z.map(L)
|
|
2888
2890
|
] : [];
|
|
2889
2891
|
}), C = c && /* @__PURE__ */ e.jsxs("div", { ref: m, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: x, children: [
|
|
2890
|
-
o &&
|
|
2892
|
+
o && y && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2891
2893
|
/* @__PURE__ */ e.jsxs(
|
|
2892
2894
|
"button",
|
|
2893
2895
|
{
|
|
@@ -2897,14 +2899,14 @@ function _n({
|
|
|
2897
2899
|
"ds-model-picker__item--auto",
|
|
2898
2900
|
s === "auto" && "ds-model-picker__item--active"
|
|
2899
2901
|
].filter(Boolean).join(" "),
|
|
2900
|
-
onClick: () =>
|
|
2902
|
+
onClick: () => B("auto"),
|
|
2901
2903
|
children: [
|
|
2902
2904
|
/* @__PURE__ */ e.jsx(xt, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2903
2905
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
2904
2906
|
]
|
|
2905
2907
|
}
|
|
2906
2908
|
),
|
|
2907
|
-
|
|
2909
|
+
j.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
2908
2910
|
] }),
|
|
2909
2911
|
O()
|
|
2910
2912
|
] });
|
|
@@ -2959,7 +2961,7 @@ function bn({
|
|
|
2959
2961
|
const [o, i] = I(!1), l = Jt(t), d = l.length > r, c = o ? l : l.slice(0, r), u = t.some((h) => h.snippet), p = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2960
2962
|
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2961
2963
|
c.map((h) => {
|
|
2962
|
-
const m = h.items.map((
|
|
2964
|
+
const m = h.items.map((b) => b.page).filter(Boolean), x = !!a;
|
|
2963
2965
|
return /* @__PURE__ */ e.jsxs(
|
|
2964
2966
|
"div",
|
|
2965
2967
|
{
|
|
@@ -2982,20 +2984,20 @@ function bn({
|
|
|
2982
2984
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2983
2985
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2984
2986
|
c.map((h) => {
|
|
2985
|
-
const m = h.items.map((
|
|
2987
|
+
const m = h.items.map((b) => b.page).filter(Boolean), x = !!a;
|
|
2986
2988
|
return u ? /* @__PURE__ */ e.jsx(
|
|
2987
2989
|
Be,
|
|
2988
2990
|
{
|
|
2989
2991
|
title: /* @__PURE__ */ e.jsx(Xt, { filename: h.filename, pages: m }),
|
|
2990
2992
|
padding: "s",
|
|
2991
|
-
children: h.items.map((
|
|
2993
|
+
children: h.items.map((b, v) => /* @__PURE__ */ e.jsx(
|
|
2992
2994
|
"div",
|
|
2993
2995
|
{
|
|
2994
2996
|
className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2995
|
-
onClick: x ? () => a(
|
|
2996
|
-
children:
|
|
2997
|
+
onClick: x ? () => a(b) : void 0,
|
|
2998
|
+
children: b.snippet ?? `p. ${b.page}`
|
|
2997
2999
|
},
|
|
2998
|
-
|
|
3000
|
+
v
|
|
2999
3001
|
))
|
|
3000
3002
|
},
|
|
3001
3003
|
h.filename
|
|
@@ -3330,15 +3332,15 @@ function $n({
|
|
|
3330
3332
|
statePrimary: h = "idle",
|
|
3331
3333
|
stateBack: m = "idle"
|
|
3332
3334
|
}) {
|
|
3333
|
-
const x = R(null),
|
|
3334
|
-
|
|
3335
|
-
const [
|
|
3336
|
-
const D =
|
|
3335
|
+
const x = R(null), b = R(t), v = R(s), y = R(l);
|
|
3336
|
+
b.current = t, v.current = s, y.current = l;
|
|
3337
|
+
const [j, N] = I(!1), [k, S] = I({ position: "fixed", visibility: "hidden", width: ke }), [B, L] = I("bottom"), [O, C] = I(null), w = R(!1), z = t[s], K = s === t.length - 1, V = le(() => {
|
|
3338
|
+
const D = b.current[v.current];
|
|
3337
3339
|
if (!D || !x.current) return;
|
|
3338
3340
|
const _ = as(D.target);
|
|
3339
3341
|
if (!_) return;
|
|
3340
|
-
const E = _.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, G = ke, $ =
|
|
3341
|
-
|
|
3342
|
+
const E = _.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, G = ke, $ = y.current ? ss : ns, f = D.position || os(E, U, G, $), { top: T, left: W, arrowOffset: Y } = is(f, E, U, G, $);
|
|
3343
|
+
L(f), S({
|
|
3342
3344
|
position: "fixed",
|
|
3343
3345
|
top: T,
|
|
3344
3346
|
left: W,
|
|
@@ -3352,7 +3354,7 @@ function $n({
|
|
|
3352
3354
|
height: E.height + Ne * 2
|
|
3353
3355
|
});
|
|
3354
3356
|
}, []);
|
|
3355
|
-
return
|
|
3357
|
+
return P(() => {
|
|
3356
3358
|
window.addEventListener("scroll", V, !0), window.addEventListener("resize", V);
|
|
3357
3359
|
const D = requestAnimationFrame(() => {
|
|
3358
3360
|
V(), N(!0), w.current = !0;
|
|
@@ -3360,7 +3362,7 @@ function $n({
|
|
|
3360
3362
|
return () => {
|
|
3361
3363
|
cancelAnimationFrame(D), window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", V);
|
|
3362
3364
|
};
|
|
3363
|
-
}, []),
|
|
3365
|
+
}, []), P(() => {
|
|
3364
3366
|
if (!w.current) return;
|
|
3365
3367
|
N(!1);
|
|
3366
3368
|
const D = setTimeout(() => {
|
|
@@ -3369,15 +3371,15 @@ function $n({
|
|
|
3369
3371
|
});
|
|
3370
3372
|
}, rs + 20);
|
|
3371
3373
|
return () => clearTimeout(D);
|
|
3372
|
-
}, [s]),
|
|
3373
|
-
|
|
3374
|
-
}, [
|
|
3374
|
+
}, [s]), P(() => {
|
|
3375
|
+
j && x.current && x.current.focus({ preventScroll: !0 });
|
|
3376
|
+
}, [j]), P(() => {
|
|
3375
3377
|
const D = (_) => {
|
|
3376
3378
|
_.key === "Escape" && a();
|
|
3377
3379
|
};
|
|
3378
3380
|
return document.addEventListener("keydown", D), () => document.removeEventListener("keydown", D);
|
|
3379
|
-
}, [a]),
|
|
3380
|
-
if (!
|
|
3381
|
+
}, [a]), P(() => {
|
|
3382
|
+
if (!j) return;
|
|
3381
3383
|
const D = (_) => {
|
|
3382
3384
|
if (_.key !== "Tab" || !x.current) return;
|
|
3383
3385
|
const E = Array.from(
|
|
@@ -3388,7 +3390,7 @@ function $n({
|
|
|
3388
3390
|
_.shiftKey && document.activeElement === A ? (_.preventDefault(), U.focus()) : !_.shiftKey && document.activeElement === U && (_.preventDefault(), A.focus());
|
|
3389
3391
|
};
|
|
3390
3392
|
return document.addEventListener("keydown", D), () => document.removeEventListener("keydown", D);
|
|
3391
|
-
}, [
|
|
3393
|
+
}, [j]), !z || typeof document > "u" ? null : me.createPortal(
|
|
3392
3394
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3393
3395
|
O && /* @__PURE__ */ e.jsx(
|
|
3394
3396
|
"div",
|
|
@@ -3397,7 +3399,7 @@ function $n({
|
|
|
3397
3399
|
"ds-coachmark__spotlight",
|
|
3398
3400
|
i && "ds-coachmark__spotlight--overlay",
|
|
3399
3401
|
!l && "ds-coachmark__spotlight--no-ring",
|
|
3400
|
-
|
|
3402
|
+
j && "ds-coachmark__spotlight--visible"
|
|
3401
3403
|
].filter(Boolean).join(" "),
|
|
3402
3404
|
style: O,
|
|
3403
3405
|
"aria-hidden": "true"
|
|
@@ -3411,11 +3413,11 @@ function $n({
|
|
|
3411
3413
|
role: "dialog",
|
|
3412
3414
|
"aria-modal": "false",
|
|
3413
3415
|
"aria-live": "polite",
|
|
3414
|
-
"aria-label":
|
|
3416
|
+
"aria-label": z.title ?? `Step ${s + 1} of ${t.length}`,
|
|
3415
3417
|
className: [
|
|
3416
3418
|
"ds-coachmark__bubble",
|
|
3417
|
-
`ds-coachmark__bubble--${
|
|
3418
|
-
|
|
3419
|
+
`ds-coachmark__bubble--${B}`,
|
|
3420
|
+
j && "ds-coachmark__bubble--visible"
|
|
3419
3421
|
].filter(Boolean).join(" "),
|
|
3420
3422
|
style: k,
|
|
3421
3423
|
tabIndex: -1,
|
|
@@ -3430,8 +3432,8 @@ function $n({
|
|
|
3430
3432
|
children: /* @__PURE__ */ e.jsx(Q, { size: 16, strokeWidth: 2 })
|
|
3431
3433
|
}
|
|
3432
3434
|
),
|
|
3433
|
-
|
|
3434
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children:
|
|
3435
|
+
z.title && /* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__title", children: z.title }),
|
|
3436
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children: z.content }),
|
|
3435
3437
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer", children: [
|
|
3436
3438
|
t.length > 1 && /* @__PURE__ */ e.jsxs("span", { className: "ds-coachmark__counter", children: [
|
|
3437
3439
|
s + 1,
|
|
@@ -3527,7 +3529,7 @@ export {
|
|
|
3527
3529
|
Qs as NavRailRecents,
|
|
3528
3530
|
js as P1,
|
|
3529
3531
|
yt as P2,
|
|
3530
|
-
|
|
3532
|
+
et as P3,
|
|
3531
3533
|
Vs as Pagination,
|
|
3532
3534
|
an as ProgressBar,
|
|
3533
3535
|
vn as PromptInput,
|