@donkit-ai/design-system 1.4.93 → 1.4.95
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/README.md +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +591 -591
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import X, { useMemo as vt, useContext as ie, createContext as De, useState as
|
|
1
|
+
import X, { useMemo as vt, useContext as ie, createContext as De, useState as D, useRef as A, useEffect as z, useLayoutEffect as ct, useId as bt, useCallback as se, forwardRef as dt } from "react";
|
|
2
2
|
import { Check as Pe, X as ee, ChevronDown as ye, Minus as _t, Plus as jt, XCircle as Me, AlertTriangle as ze, CheckCircle as Fe, Info as We, ChevronUp as Nt, ChevronsUpDown as wt, ChevronLeft as gt, ChevronRight as yt, Copy as kt, Brain as Et, Loader as Tt, Paperclip as Ge, Square as $t, ArrowUp as Rt, Zap as St, Cpu as Ke, FileText as At, ThumbsUp as Bt, ThumbsDown as It } from "lucide-react";
|
|
3
3
|
import re from "react-dom";
|
|
4
4
|
const q = {
|
|
@@ -56,20 +56,20 @@ function Dt() {
|
|
|
56
56
|
function t(m) {
|
|
57
57
|
if (m == null) return null;
|
|
58
58
|
if (typeof m == "function")
|
|
59
|
-
return m.$$typeof ===
|
|
59
|
+
return m.$$typeof === y ? null : m.displayName || m.name || null;
|
|
60
60
|
if (typeof m == "string") return m;
|
|
61
61
|
switch (m) {
|
|
62
|
-
case
|
|
62
|
+
case g:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case R:
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case j:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case S:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case I:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case W:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof m == "object")
|
|
@@ -78,19 +78,19 @@ function Dt() {
|
|
|
78
78
|
), m.$$typeof) {
|
|
79
79
|
case N:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case
|
|
81
|
+
case b:
|
|
82
82
|
return m.displayName || "Context";
|
|
83
|
-
case
|
|
83
|
+
case k:
|
|
84
84
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case
|
|
86
|
-
var
|
|
87
|
-
return m = m.displayName, m || (m =
|
|
88
|
-
case
|
|
89
|
-
return
|
|
90
|
-
case
|
|
91
|
-
|
|
85
|
+
case w:
|
|
86
|
+
var v = m.render;
|
|
87
|
+
return m = m.displayName, m || (m = v.displayName || v.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
88
|
+
case L:
|
|
89
|
+
return v = m.displayName || null, v !== null ? v : t(m.type) || "Memo";
|
|
90
|
+
case F:
|
|
91
|
+
v = m._payload, m = m._init;
|
|
92
92
|
try {
|
|
93
|
-
return t(m(
|
|
93
|
+
return t(m(v));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -102,50 +102,50 @@ function Dt() {
|
|
|
102
102
|
function n(m) {
|
|
103
103
|
try {
|
|
104
104
|
s(m);
|
|
105
|
-
var
|
|
105
|
+
var v = !1;
|
|
106
106
|
} catch {
|
|
107
|
-
|
|
107
|
+
v = !0;
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
var B =
|
|
109
|
+
if (v) {
|
|
110
|
+
v = console;
|
|
111
|
+
var B = v.error, U = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
112
112
|
return B.call(
|
|
113
|
-
|
|
113
|
+
v,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
|
-
|
|
115
|
+
U
|
|
116
116
|
), s(m);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function r(m) {
|
|
120
|
-
if (m ===
|
|
121
|
-
if (typeof m == "object" && m !== null && m.$$typeof ===
|
|
120
|
+
if (m === g) return "<>";
|
|
121
|
+
if (typeof m == "object" && m !== null && m.$$typeof === F)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
124
|
+
var v = t(m);
|
|
125
|
+
return v ? "<" + v + ">" : "<...>";
|
|
126
126
|
} catch {
|
|
127
127
|
return "<...>";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function a() {
|
|
131
|
-
var m =
|
|
131
|
+
var m = O.A;
|
|
132
132
|
return m === null ? null : m.getOwner();
|
|
133
133
|
}
|
|
134
134
|
function o() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(m) {
|
|
138
|
-
if (
|
|
139
|
-
var
|
|
140
|
-
if (
|
|
138
|
+
if (P.call(m, "key")) {
|
|
139
|
+
var v = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
140
|
+
if (v && v.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return m.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function l(m,
|
|
144
|
+
function l(m, v) {
|
|
145
145
|
function B() {
|
|
146
146
|
$ || ($ = !0, console.error(
|
|
147
147
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
148
|
-
|
|
148
|
+
v
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
151
|
B.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
@@ -155,18 +155,18 @@ function Dt() {
|
|
|
155
155
|
}
|
|
156
156
|
function c() {
|
|
157
157
|
var m = t(this.type);
|
|
158
|
-
return
|
|
158
|
+
return T[m] || (T[m] = !0, console.error(
|
|
159
159
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
160
160
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
161
161
|
}
|
|
162
|
-
function u(m,
|
|
162
|
+
function u(m, v, B, U, te, le) {
|
|
163
163
|
var G = B.ref;
|
|
164
164
|
return m = {
|
|
165
|
-
$$typeof:
|
|
165
|
+
$$typeof: _,
|
|
166
166
|
type: m,
|
|
167
|
-
key:
|
|
167
|
+
key: v,
|
|
168
168
|
props: B,
|
|
169
|
-
_owner:
|
|
169
|
+
_owner: U
|
|
170
170
|
}, (G !== void 0 ? G : null) !== null ? Object.defineProperty(m, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
get: c
|
|
@@ -192,42 +192,42 @@ function Dt() {
|
|
|
192
192
|
value: le
|
|
193
193
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
194
194
|
}
|
|
195
|
-
function d(m,
|
|
196
|
-
var G =
|
|
195
|
+
function d(m, v, B, U, te, le) {
|
|
196
|
+
var G = v.children;
|
|
197
197
|
if (G !== void 0)
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
200
|
-
for (
|
|
201
|
-
p(G[
|
|
198
|
+
if (U)
|
|
199
|
+
if (V(G)) {
|
|
200
|
+
for (U = 0; U < G.length; U++)
|
|
201
|
+
p(G[U]);
|
|
202
202
|
Object.freeze && Object.freeze(G);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
207
|
else p(G);
|
|
208
|
-
if (
|
|
208
|
+
if (P.call(v, "key")) {
|
|
209
209
|
G = t(m);
|
|
210
|
-
var Z = Object.keys(
|
|
210
|
+
var Z = Object.keys(v).filter(function(je) {
|
|
211
211
|
return je !== "key";
|
|
212
212
|
});
|
|
213
|
-
|
|
213
|
+
U = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", Y[G + U] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
215
215
|
let props = %s;
|
|
216
216
|
<%s {...props} />
|
|
217
217
|
React keys must be passed directly to JSX without using spread:
|
|
218
218
|
let props = %s;
|
|
219
219
|
<%s key={someKey} {...props} />`,
|
|
220
|
-
|
|
220
|
+
U,
|
|
221
221
|
G,
|
|
222
222
|
Z,
|
|
223
223
|
G
|
|
224
|
-
), Y[G +
|
|
224
|
+
), Y[G + U] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (G = null, B !== void 0 && (n(B), G = "" + B), i(
|
|
226
|
+
if (G = null, B !== void 0 && (n(B), G = "" + B), i(v) && (n(v.key), G = "" + v.key), "key" in v) {
|
|
227
227
|
B = {};
|
|
228
|
-
for (var fe in
|
|
229
|
-
fe !== "key" && (B[fe] =
|
|
230
|
-
} else B =
|
|
228
|
+
for (var fe in v)
|
|
229
|
+
fe !== "key" && (B[fe] = v[fe]);
|
|
230
|
+
} else B = v;
|
|
231
231
|
return G && l(
|
|
232
232
|
B,
|
|
233
233
|
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
@@ -241,12 +241,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(m) {
|
|
244
|
-
h(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof ===
|
|
244
|
+
h(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === F && (m._payload.status === "fulfilled" ? h(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(m) {
|
|
247
|
-
return typeof m == "object" && m !== null && m.$$typeof ===
|
|
247
|
+
return typeof m == "object" && m !== null && m.$$typeof === _;
|
|
248
248
|
}
|
|
249
|
-
var f = X,
|
|
249
|
+
var f = X, _ = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), b = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), O = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, P = Object.prototype.hasOwnProperty, V = Array.isArray, x = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
f = {
|
|
@@ -254,29 +254,29 @@ React keys must be passed directly to JSX without using spread:
|
|
|
254
254
|
return m();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var $,
|
|
257
|
+
var $, T = {}, C = f.react_stack_bottom_frame.bind(
|
|
258
258
|
f,
|
|
259
259
|
o
|
|
260
|
-
)(),
|
|
261
|
-
ge.Fragment =
|
|
262
|
-
var
|
|
260
|
+
)(), H = x(r(o)), Y = {};
|
|
261
|
+
ge.Fragment = g, ge.jsx = function(m, v, B) {
|
|
262
|
+
var U = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return d(
|
|
264
264
|
m,
|
|
265
|
-
|
|
265
|
+
v,
|
|
266
266
|
B,
|
|
267
267
|
!1,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
U ? Error("react-stack-top-frame") : C,
|
|
269
|
+
U ? x(r(m)) : H
|
|
270
270
|
);
|
|
271
|
-
}, ge.jsxs = function(m,
|
|
272
|
-
var
|
|
271
|
+
}, ge.jsxs = function(m, v, B) {
|
|
272
|
+
var U = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return d(
|
|
274
274
|
m,
|
|
275
|
-
|
|
275
|
+
v,
|
|
276
276
|
B,
|
|
277
277
|
!0,
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
U ? Error("react-stack-top-frame") : C,
|
|
279
|
+
U ? x(r(m)) : H
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), ge;
|
|
@@ -394,42 +394,42 @@ function de({
|
|
|
394
394
|
href: p,
|
|
395
395
|
"aria-label": h,
|
|
396
396
|
"aria-pressed": f,
|
|
397
|
-
className:
|
|
397
|
+
className: _ = "",
|
|
398
398
|
...N
|
|
399
399
|
}) {
|
|
400
|
-
const
|
|
400
|
+
const g = a && !t, j = i === "loading", R = i === "success", k = i === "error", b = j || R || k, w = !!(l || c), S = n === "xs" ? "s" : "m", I = s === "danger" ? "on-accent" : "default", L = Mt[n] ?? 16, F = j ? /* @__PURE__ */ e.jsx(Pt, { size: S, color: I }) : R ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Pe, { size: L, strokeWidth: 2.5 }) }) : k ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ee, { size: L, strokeWidth: 2.5 }) }) : null, W = [
|
|
401
401
|
"ds-button",
|
|
402
402
|
`ds-button--${s}`,
|
|
403
403
|
`ds-button--${n}`,
|
|
404
404
|
r && "ds-button--full",
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
].filter(Boolean).join(" "),
|
|
408
|
-
|
|
405
|
+
g && "ds-button--icon-only",
|
|
406
|
+
_
|
|
407
|
+
].filter(Boolean).join(" "), y = i !== "idle" ? i : void 0, O = f !== void 0 ? f : w ? !0 : void 0, P = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
408
|
+
b ? F : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
409
409
|
t
|
|
410
410
|
] });
|
|
411
411
|
if (p) {
|
|
412
|
-
const
|
|
412
|
+
const V = (x) => {
|
|
413
413
|
if (o || j) {
|
|
414
|
-
|
|
414
|
+
x.preventDefault();
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
x.metaKey || x.ctrlKey || x.button === 1 || (x.preventDefault(), u == null || u(x));
|
|
418
418
|
};
|
|
419
419
|
return /* @__PURE__ */ e.jsx(
|
|
420
420
|
"a",
|
|
421
421
|
{
|
|
422
|
-
className:
|
|
422
|
+
className: W,
|
|
423
423
|
href: o || j ? void 0 : p,
|
|
424
|
-
onClick:
|
|
424
|
+
onClick: V,
|
|
425
425
|
"aria-label": h,
|
|
426
426
|
"aria-disabled": o || j ? "true" : void 0,
|
|
427
427
|
"aria-busy": j ? "true" : void 0,
|
|
428
|
-
"aria-pressed":
|
|
429
|
-
"data-state":
|
|
430
|
-
"data-active":
|
|
428
|
+
"aria-pressed": O,
|
|
429
|
+
"data-state": y,
|
|
430
|
+
"data-active": w ? "true" : void 0,
|
|
431
431
|
...N,
|
|
432
|
-
children:
|
|
432
|
+
children: P
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
435
|
}
|
|
@@ -437,16 +437,16 @@ function de({
|
|
|
437
437
|
"button",
|
|
438
438
|
{
|
|
439
439
|
type: d,
|
|
440
|
-
className:
|
|
440
|
+
className: W,
|
|
441
441
|
disabled: o,
|
|
442
442
|
onClick: j ? void 0 : u,
|
|
443
443
|
"aria-label": h,
|
|
444
444
|
"aria-busy": j ? "true" : void 0,
|
|
445
|
-
"aria-pressed":
|
|
446
|
-
"data-state":
|
|
447
|
-
"data-active":
|
|
445
|
+
"aria-pressed": O,
|
|
446
|
+
"data-state": y,
|
|
447
|
+
"data-active": w ? "true" : void 0,
|
|
448
448
|
...N,
|
|
449
|
-
children:
|
|
449
|
+
children: P
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
452
|
}
|
|
@@ -464,7 +464,7 @@ function Ts({
|
|
|
464
464
|
iconRightLabel: d,
|
|
465
465
|
...p
|
|
466
466
|
}) {
|
|
467
|
-
const h = K(), f = u || `input-${X.useId()}`,
|
|
467
|
+
const h = K(), f = u || `input-${X.useId()}`, _ = n ? `${f}-hint` : void 0, N = s ? `${f}-error` : void 0, g = N || _;
|
|
468
468
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${r ? "ds-input-wrapper--full" : ""} ${c ? "ds-input-wrapper--disabled" : ""} ${s ? "ds-input-wrapper--error" : ""}`, children: [
|
|
469
469
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: f, children: t }),
|
|
470
470
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -476,7 +476,7 @@ function Ts({
|
|
|
476
476
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${o ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
|
|
477
477
|
disabled: c,
|
|
478
478
|
"aria-invalid": s ? "true" : "false",
|
|
479
|
-
"aria-describedby":
|
|
479
|
+
"aria-describedby": g,
|
|
480
480
|
...p
|
|
481
481
|
}
|
|
482
482
|
),
|
|
@@ -492,7 +492,7 @@ function Ts({
|
|
|
492
492
|
}
|
|
493
493
|
)
|
|
494
494
|
] }),
|
|
495
|
-
n && !s && /* @__PURE__ */ e.jsx("span", { id:
|
|
495
|
+
n && !s && /* @__PURE__ */ e.jsx("span", { id: _, className: "ds-input-hint", children: n }),
|
|
496
496
|
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id: N, className: "ds-input-error", role: "alert", children: s }) }) })
|
|
497
497
|
] });
|
|
498
498
|
}
|
|
@@ -540,141 +540,141 @@ function Rs({
|
|
|
540
540
|
id: u,
|
|
541
541
|
...d
|
|
542
542
|
}) {
|
|
543
|
-
const p = K(), h = a ?? p.selectOption, [f,
|
|
544
|
-
N || (
|
|
543
|
+
const p = K(), h = a ?? p.selectOption, [f, _] = D(!1), [N, g] = D(!1), [j, R] = D({}), [k, b] = D("down"), [w, S] = D(-1), I = A(null), L = A(null), F = A(null), W = A(null), y = u || `select-${X.useId()}`, O = `${y}-label`, P = o ? `${y}-error` : void 0, V = 150, x = (v = !1) => {
|
|
544
|
+
N || (g(!0), S(-1), W.current = setTimeout(() => {
|
|
545
545
|
var B;
|
|
546
|
-
|
|
547
|
-
},
|
|
548
|
-
}, $ = (
|
|
549
|
-
clearTimeout(
|
|
550
|
-
const B =
|
|
551
|
-
|
|
546
|
+
_(!1), g(!1), v && ((B = F.current) == null || B.focus());
|
|
547
|
+
}, V));
|
|
548
|
+
}, $ = (v) => {
|
|
549
|
+
clearTimeout(W.current), g(!1);
|
|
550
|
+
const B = v !== void 0 ? v : Math.max(r.findIndex((U) => U.value === s), 0);
|
|
551
|
+
S(B), _(!0);
|
|
552
552
|
};
|
|
553
|
-
|
|
554
|
-
const
|
|
553
|
+
z(() => () => clearTimeout(W.current), []);
|
|
554
|
+
const T = () => {
|
|
555
555
|
var Z;
|
|
556
|
-
const
|
|
557
|
-
if (!
|
|
558
|
-
const B = window.innerHeight,
|
|
559
|
-
|
|
560
|
-
G ? { bottom: B -
|
|
556
|
+
const v = (Z = I.current) == null ? void 0 : Z.getBoundingClientRect();
|
|
557
|
+
if (!v) return;
|
|
558
|
+
const B = window.innerHeight, U = B - v.bottom, te = v.top, G = U < 300 && te > U;
|
|
559
|
+
b(G ? "up" : "down"), R(
|
|
560
|
+
G ? { bottom: B - v.top + 4, left: v.left, width: v.width } : { top: v.bottom + 4, left: v.left, width: v.width }
|
|
561
561
|
);
|
|
562
562
|
};
|
|
563
|
-
|
|
563
|
+
z(() => {
|
|
564
564
|
if (f)
|
|
565
|
-
return
|
|
566
|
-
window.removeEventListener("scroll",
|
|
565
|
+
return T(), window.addEventListener("scroll", T, !0), window.addEventListener("resize", T), () => {
|
|
566
|
+
window.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T);
|
|
567
567
|
};
|
|
568
|
-
}, [f]),
|
|
569
|
-
const
|
|
570
|
-
I.current && !I.current.contains(B.target) &&
|
|
568
|
+
}, [f]), z(() => {
|
|
569
|
+
const v = (B) => {
|
|
570
|
+
I.current && !I.current.contains(B.target) && L.current && !L.current.contains(B.target) && x();
|
|
571
571
|
};
|
|
572
|
-
return document.addEventListener("mousedown",
|
|
573
|
-
}, [N]),
|
|
572
|
+
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
573
|
+
}, [N]), z(() => {
|
|
574
574
|
var B;
|
|
575
|
-
if (!f ||
|
|
576
|
-
(B =
|
|
577
|
-
}, [
|
|
578
|
-
const
|
|
579
|
-
switch (
|
|
575
|
+
if (!f || w < 0 || !L.current) return;
|
|
576
|
+
(B = L.current.querySelectorAll(".ds-select-option")[w]) == null || B.scrollIntoView({ block: "nearest" });
|
|
577
|
+
}, [w, f]);
|
|
578
|
+
const C = (v) => {
|
|
579
|
+
switch (v.key) {
|
|
580
580
|
case "ArrowDown":
|
|
581
|
-
|
|
581
|
+
v.preventDefault(), f ? S((B) => Math.min(B + 1, r.length - 1)) : $();
|
|
582
582
|
break;
|
|
583
583
|
case "ArrowUp":
|
|
584
|
-
|
|
584
|
+
v.preventDefault(), f ? S((B) => Math.max(B - 1, 0)) : $(r.length - 1);
|
|
585
585
|
break;
|
|
586
586
|
case "Home":
|
|
587
|
-
f && (
|
|
587
|
+
f && (v.preventDefault(), S(0));
|
|
588
588
|
break;
|
|
589
589
|
case "End":
|
|
590
|
-
f && (
|
|
590
|
+
f && (v.preventDefault(), S(r.length - 1));
|
|
591
591
|
break;
|
|
592
592
|
case "Enter":
|
|
593
593
|
case " ":
|
|
594
|
-
|
|
594
|
+
v.preventDefault(), f ? w >= 0 && (n == null || n(r[w].value), x(!0)) : $();
|
|
595
595
|
break;
|
|
596
596
|
case "Escape":
|
|
597
|
-
f && (
|
|
597
|
+
f && (v.preventDefault(), x(!0));
|
|
598
598
|
break;
|
|
599
599
|
case "Tab":
|
|
600
|
-
f &&
|
|
600
|
+
f && x(!1);
|
|
601
601
|
break;
|
|
602
602
|
}
|
|
603
|
-
},
|
|
603
|
+
}, H = r.find((v) => v.value === s), Y = l === "xs" ? q[1] : l === "small" ? q[2] : q[3], m = f && /* @__PURE__ */ e.jsx(
|
|
604
604
|
"div",
|
|
605
605
|
{
|
|
606
|
-
ref:
|
|
606
|
+
ref: L,
|
|
607
607
|
"data-ds-portal": "",
|
|
608
608
|
role: "listbox",
|
|
609
|
-
"aria-labelledby": t ?
|
|
609
|
+
"aria-labelledby": t ? O : void 0,
|
|
610
610
|
tabIndex: -1,
|
|
611
611
|
className: [
|
|
612
612
|
"ds-select-dropdown ds-scrollable",
|
|
613
613
|
`ds-select-dropdown--${l}`,
|
|
614
|
-
`ds-select-dropdown--${
|
|
614
|
+
`ds-select-dropdown--${k}`,
|
|
615
615
|
N && "ds-select-dropdown--closing"
|
|
616
616
|
].filter(Boolean).join(" "),
|
|
617
617
|
style: j,
|
|
618
|
-
children: r.map((
|
|
618
|
+
children: r.map((v, B) => /* @__PURE__ */ e.jsx(
|
|
619
619
|
"button",
|
|
620
620
|
{
|
|
621
|
-
id: `${
|
|
621
|
+
id: `${y}-opt-${B}`,
|
|
622
622
|
type: "button",
|
|
623
623
|
role: "option",
|
|
624
624
|
tabIndex: -1,
|
|
625
|
-
"aria-selected": s ===
|
|
625
|
+
"aria-selected": s === v.value,
|
|
626
626
|
className: [
|
|
627
627
|
"ds-select-option",
|
|
628
628
|
`ds-select-option--${l}`,
|
|
629
|
-
s ===
|
|
630
|
-
B ===
|
|
629
|
+
s === v.value && "ds-select-option--selected",
|
|
630
|
+
B === w && "ds-select-option--active"
|
|
631
631
|
].filter(Boolean).join(" "),
|
|
632
632
|
onClick: () => {
|
|
633
|
-
n == null || n(
|
|
633
|
+
n == null || n(v.value), x(!0);
|
|
634
634
|
},
|
|
635
|
-
children:
|
|
635
|
+
children: v.label
|
|
636
636
|
},
|
|
637
|
-
|
|
637
|
+
v.value
|
|
638
638
|
))
|
|
639
639
|
}
|
|
640
640
|
);
|
|
641
641
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${c ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
642
|
-
t && /* @__PURE__ */ e.jsx("label", { id:
|
|
642
|
+
t && /* @__PURE__ */ e.jsx("label", { id: O, className: "ds-select-label", children: t }),
|
|
643
643
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: I, children: /* @__PURE__ */ e.jsxs(
|
|
644
644
|
"button",
|
|
645
645
|
{
|
|
646
|
-
ref:
|
|
646
|
+
ref: F,
|
|
647
647
|
type: "button",
|
|
648
|
-
id:
|
|
648
|
+
id: y,
|
|
649
649
|
role: "combobox",
|
|
650
650
|
"aria-haspopup": "listbox",
|
|
651
651
|
"aria-expanded": f,
|
|
652
|
-
"aria-activedescendant": f &&
|
|
653
|
-
"aria-labelledby": t ?
|
|
652
|
+
"aria-activedescendant": f && w >= 0 ? `${y}-opt-${w}` : void 0,
|
|
653
|
+
"aria-labelledby": t ? O : void 0,
|
|
654
654
|
"aria-invalid": o ? "true" : "false",
|
|
655
|
-
"aria-describedby":
|
|
655
|
+
"aria-describedby": P,
|
|
656
656
|
className: `ds-select-trigger ds-select-trigger--${l} ${o ? "ds-select-trigger--error" : ""}`,
|
|
657
657
|
onClick: () => {
|
|
658
|
-
c || (f ?
|
|
658
|
+
c || (f ? x() : $());
|
|
659
659
|
},
|
|
660
|
-
onKeyDown:
|
|
660
|
+
onKeyDown: C,
|
|
661
661
|
disabled: c,
|
|
662
662
|
...d,
|
|
663
663
|
children: [
|
|
664
|
-
/* @__PURE__ */ e.jsx("span", { className:
|
|
664
|
+
/* @__PURE__ */ e.jsx("span", { className: H ? "" : "ds-select-placeholder", children: (H == null ? void 0 : H.label) || h }),
|
|
665
665
|
/* @__PURE__ */ e.jsx(
|
|
666
666
|
ye,
|
|
667
667
|
{
|
|
668
668
|
size: Y,
|
|
669
669
|
strokeWidth: 1.5,
|
|
670
|
-
className: `ds-select-icon ${f &&
|
|
670
|
+
className: `ds-select-icon ${f && k === "down" ? "ds-select-icon--open" : ""} ${f && k === "up" ? "ds-select-icon--up" : ""}`,
|
|
671
671
|
"aria-hidden": "true"
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
674
|
]
|
|
675
675
|
}
|
|
676
676
|
) }),
|
|
677
|
-
o && /* @__PURE__ */ e.jsx("span", { id:
|
|
677
|
+
o && /* @__PURE__ */ e.jsx("span", { id: P, className: "ds-select-error", role: "alert", children: o }),
|
|
678
678
|
typeof document < "u" && re.createPortal(m, document.body)
|
|
679
679
|
] });
|
|
680
680
|
}
|
|
@@ -693,38 +693,38 @@ function Ss({
|
|
|
693
693
|
increaseLabel: p,
|
|
694
694
|
...h
|
|
695
695
|
}) {
|
|
696
|
-
const f = K(),
|
|
696
|
+
const f = K(), _ = () => {
|
|
697
697
|
if (l) return;
|
|
698
|
-
const
|
|
699
|
-
n == null || n(
|
|
698
|
+
const b = Math.min(Number(s) + o, a);
|
|
699
|
+
n == null || n(b);
|
|
700
700
|
}, N = () => {
|
|
701
701
|
if (l) return;
|
|
702
|
-
const
|
|
703
|
-
n == null || n(
|
|
704
|
-
},
|
|
702
|
+
const b = Math.max(Number(s) - o, r);
|
|
703
|
+
n == null || n(b);
|
|
704
|
+
}, g = (b) => {
|
|
705
705
|
if (l) return;
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
706
|
+
const w = b.target.value;
|
|
707
|
+
if (w === "") {
|
|
708
708
|
n == null || n(r);
|
|
709
709
|
return;
|
|
710
710
|
}
|
|
711
|
-
const
|
|
712
|
-
if (!isNaN(
|
|
713
|
-
const I = Math.min(Math.max(
|
|
711
|
+
const S = Number(w);
|
|
712
|
+
if (!isNaN(S)) {
|
|
713
|
+
const I = Math.min(Math.max(S, r), a);
|
|
714
714
|
n == null || n(I);
|
|
715
715
|
}
|
|
716
716
|
}, j = [
|
|
717
717
|
"ds-stepper-wrapper",
|
|
718
718
|
l && "ds-stepper-wrapper--disabled",
|
|
719
719
|
u && "ds-stepper-wrapper--error"
|
|
720
|
-
].filter(Boolean).join(" "),
|
|
720
|
+
].filter(Boolean).join(" "), R = [
|
|
721
721
|
"ds-stepper",
|
|
722
722
|
`ds-stepper--${i}`,
|
|
723
723
|
l && "ds-stepper--disabled"
|
|
724
|
-
].filter(Boolean).join(" "),
|
|
724
|
+
].filter(Boolean).join(" "), k = i === "xs" ? q[1] : i === "small" ? q[2] : q[3];
|
|
725
725
|
return /* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
726
726
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
727
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
727
|
+
/* @__PURE__ */ e.jsxs("div", { className: R, children: [
|
|
728
728
|
/* @__PURE__ */ e.jsx(
|
|
729
729
|
"button",
|
|
730
730
|
{
|
|
@@ -733,7 +733,7 @@ function Ss({
|
|
|
733
733
|
onClick: N,
|
|
734
734
|
disabled: l || s <= r,
|
|
735
735
|
"aria-label": d ?? f.decrease,
|
|
736
|
-
children: /* @__PURE__ */ e.jsx(_t, { size:
|
|
736
|
+
children: /* @__PURE__ */ e.jsx(_t, { size: k, strokeWidth: 1.5 })
|
|
737
737
|
}
|
|
738
738
|
),
|
|
739
739
|
/* @__PURE__ */ e.jsx(
|
|
@@ -742,7 +742,7 @@ function Ss({
|
|
|
742
742
|
type: "number",
|
|
743
743
|
className: "ds-stepper-input",
|
|
744
744
|
value: s,
|
|
745
|
-
onChange:
|
|
745
|
+
onChange: g,
|
|
746
746
|
min: r,
|
|
747
747
|
max: a,
|
|
748
748
|
step: o,
|
|
@@ -755,10 +755,10 @@ function Ss({
|
|
|
755
755
|
{
|
|
756
756
|
type: "button",
|
|
757
757
|
className: "ds-stepper-button ds-stepper-button--plus",
|
|
758
|
-
onClick:
|
|
758
|
+
onClick: _,
|
|
759
759
|
disabled: l || s >= a,
|
|
760
760
|
"aria-label": p ?? f.increase,
|
|
761
|
-
children: /* @__PURE__ */ e.jsx(jt, { size:
|
|
761
|
+
children: /* @__PURE__ */ e.jsx(jt, { size: k, strokeWidth: 1.5 })
|
|
762
762
|
}
|
|
763
763
|
)
|
|
764
764
|
] }),
|
|
@@ -785,7 +785,7 @@ function As({
|
|
|
785
785
|
l
|
|
786
786
|
].filter(Boolean).join(" ");
|
|
787
787
|
if (o) {
|
|
788
|
-
const
|
|
788
|
+
const _ = (N) => {
|
|
789
789
|
if (i) {
|
|
790
790
|
N.preventDefault();
|
|
791
791
|
return;
|
|
@@ -797,7 +797,7 @@ function As({
|
|
|
797
797
|
{
|
|
798
798
|
className: p,
|
|
799
799
|
href: i ? void 0 : o,
|
|
800
|
-
onClick:
|
|
800
|
+
onClick: _,
|
|
801
801
|
"aria-disabled": i ? "true" : void 0,
|
|
802
802
|
...c,
|
|
803
803
|
children: t
|
|
@@ -909,24 +909,24 @@ function zs({
|
|
|
909
909
|
closeLabel: i,
|
|
910
910
|
...l
|
|
911
911
|
}) {
|
|
912
|
-
const c = K(), u =
|
|
912
|
+
const c = K(), u = A(null), d = A(null), p = X.useId(), [h, f] = D(!1), _ = () => {
|
|
913
913
|
!n || h || (f(!0), setTimeout(() => {
|
|
914
914
|
f(!1), n();
|
|
915
915
|
}, Ot));
|
|
916
916
|
};
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
},
|
|
917
|
+
z(() => {
|
|
918
|
+
const k = (w) => {
|
|
919
|
+
w.key === "Escape" && _();
|
|
920
|
+
}, b = (w) => {
|
|
921
921
|
var I;
|
|
922
|
-
const
|
|
923
|
-
|
|
922
|
+
const S = Ce(w);
|
|
923
|
+
S && ((I = d.current) != null && I.contains(S) || Ue(S, u.current) || _());
|
|
924
924
|
};
|
|
925
|
-
return document.addEventListener("keydown",
|
|
926
|
-
document.removeEventListener("keydown",
|
|
925
|
+
return document.addEventListener("keydown", k), document.addEventListener("mousedown", b), () => {
|
|
926
|
+
document.removeEventListener("keydown", k), document.removeEventListener("mousedown", b);
|
|
927
927
|
};
|
|
928
928
|
}, [n, h]);
|
|
929
|
-
const N = X.Children.toArray(t),
|
|
929
|
+
const N = X.Children.toArray(t), g = N.find((k) => (k == null ? void 0 : k.type) === xe), j = N.filter((k) => (k == null ? void 0 : k.type) !== xe), R = /* @__PURE__ */ e.jsx(
|
|
930
930
|
"div",
|
|
931
931
|
{
|
|
932
932
|
className: ["ds-modal-overlay", h && "ds-modal-overlay--closing"].filter(Boolean).join(" "),
|
|
@@ -950,7 +950,7 @@ function zs({
|
|
|
950
950
|
variant: "ghost",
|
|
951
951
|
size: "small",
|
|
952
952
|
icon: /* @__PURE__ */ e.jsx(ee, { size: q[2], strokeWidth: 1.5 }),
|
|
953
|
-
onClick:
|
|
953
|
+
onClick: _,
|
|
954
954
|
"aria-label": i ?? c.closeModal
|
|
955
955
|
}
|
|
956
956
|
),
|
|
@@ -959,13 +959,13 @@ function zs({
|
|
|
959
959
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: o })
|
|
960
960
|
] }),
|
|
961
961
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: j }),
|
|
962
|
-
|
|
962
|
+
g
|
|
963
963
|
]
|
|
964
964
|
}
|
|
965
965
|
)
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
|
-
return typeof document > "u" ?
|
|
968
|
+
return typeof document > "u" ? R : re.createPortal(R, document.body);
|
|
969
969
|
}
|
|
970
970
|
function xe({ children: t }) {
|
|
971
971
|
return !t || X.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
|
|
@@ -979,24 +979,24 @@ function Fs({
|
|
|
979
979
|
closeLabel: a,
|
|
980
980
|
...o
|
|
981
981
|
}) {
|
|
982
|
-
const i = K(), l =
|
|
982
|
+
const i = K(), l = A(null), c = A(null), u = X.useId(), [d, p] = D(!1), h = () => {
|
|
983
983
|
!n || d || (p(!0), setTimeout(() => {
|
|
984
984
|
p(!1), n();
|
|
985
985
|
}, Ct));
|
|
986
986
|
};
|
|
987
|
-
|
|
988
|
-
const j = (
|
|
989
|
-
|
|
990
|
-
},
|
|
991
|
-
var
|
|
992
|
-
const
|
|
993
|
-
|
|
987
|
+
z(() => {
|
|
988
|
+
const j = (k) => {
|
|
989
|
+
k.key === "Escape" && h();
|
|
990
|
+
}, R = (k) => {
|
|
991
|
+
var w;
|
|
992
|
+
const b = Ce(k);
|
|
993
|
+
b && ((w = c.current) != null && w.contains(b) || Ue(b, l.current) || h());
|
|
994
994
|
};
|
|
995
|
-
return document.addEventListener("keydown", j), document.addEventListener("mousedown",
|
|
996
|
-
document.removeEventListener("keydown", j), document.removeEventListener("mousedown",
|
|
995
|
+
return document.addEventListener("keydown", j), document.addEventListener("mousedown", R), () => {
|
|
996
|
+
document.removeEventListener("keydown", j), document.removeEventListener("mousedown", R);
|
|
997
997
|
};
|
|
998
998
|
}, [n, d]);
|
|
999
|
-
const f = X.Children.toArray(t),
|
|
999
|
+
const f = X.Children.toArray(t), _ = f.find((j) => (j == null ? void 0 : j.type) === xe), N = f.filter((j) => (j == null ? void 0 : j.type) !== xe), g = /* @__PURE__ */ e.jsx(
|
|
1000
1000
|
"div",
|
|
1001
1001
|
{
|
|
1002
1002
|
className: ["ds-bottom-sheet-overlay", d && "ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),
|
|
@@ -1030,13 +1030,13 @@ function Fs({
|
|
|
1030
1030
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__subheader", children: r })
|
|
1031
1031
|
] }),
|
|
1032
1032
|
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: N }),
|
|
1033
|
-
|
|
1033
|
+
_
|
|
1034
1034
|
]
|
|
1035
1035
|
}
|
|
1036
1036
|
)
|
|
1037
1037
|
}
|
|
1038
1038
|
);
|
|
1039
|
-
return typeof document > "u" ?
|
|
1039
|
+
return typeof document > "u" ? g : re.createPortal(g, document.body);
|
|
1040
1040
|
}
|
|
1041
1041
|
function Ut({
|
|
1042
1042
|
children: t,
|
|
@@ -1048,8 +1048,8 @@ function Ut({
|
|
|
1048
1048
|
className: i = "",
|
|
1049
1049
|
...l
|
|
1050
1050
|
}) {
|
|
1051
|
-
const c = K(), u = s ?? c.code, [d, p] =
|
|
1052
|
-
h ? a == null || a(!r) : p((
|
|
1051
|
+
const c = K(), u = s ?? c.code, [d, p] = D(n), h = r !== void 0, f = h ? r : d, _ = () => {
|
|
1052
|
+
h ? a == null || a(!r) : p((g) => !g);
|
|
1053
1053
|
}, N = [
|
|
1054
1054
|
"ds-code-accordion",
|
|
1055
1055
|
`ds-code-accordion--${o}`,
|
|
@@ -1062,7 +1062,7 @@ function Ut({
|
|
|
1062
1062
|
{
|
|
1063
1063
|
type: "button",
|
|
1064
1064
|
className: "ds-code-accordion__header",
|
|
1065
|
-
onClick:
|
|
1065
|
+
onClick: _,
|
|
1066
1066
|
"aria-expanded": f,
|
|
1067
1067
|
children: [
|
|
1068
1068
|
/* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: u }),
|
|
@@ -1233,23 +1233,23 @@ function qs({
|
|
|
1233
1233
|
return a ? /* @__PURE__ */ e.jsx("button", { type: "button", role: "listitem", className: c, onClick: a, ...i, children: u }) : /* @__PURE__ */ e.jsx("div", { role: "listitem", className: c, ...i, children: u });
|
|
1234
1234
|
}
|
|
1235
1235
|
function Gs({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1 }) {
|
|
1236
|
-
const o =
|
|
1236
|
+
const o = A(null), i = A(null), [l, c] = D(!1), u = A(!1), d = A(null), p = A(null), h = () => {
|
|
1237
1237
|
if (!o.current) return;
|
|
1238
1238
|
const f = o.current.querySelector(`[data-value="${s}"]`);
|
|
1239
1239
|
if (!f) return;
|
|
1240
|
-
const
|
|
1241
|
-
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left =
|
|
1240
|
+
const _ = o.current.getBoundingClientRect(), N = f.getBoundingClientRect(), g = N.left - _.left, j = N.width;
|
|
1241
|
+
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = g + "px", i.current.style.width = j + "px", u.current = !1) : (c(!0), requestAnimationFrame(() => {
|
|
1242
1242
|
if (!i.current || !o.current) return;
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
1245
|
-
const
|
|
1246
|
-
i.current.style.transition = "none", i.current.style.left =
|
|
1243
|
+
const R = o.current.querySelector(`[data-value="${s}"]`);
|
|
1244
|
+
if (!R) return;
|
|
1245
|
+
const k = o.current.getBoundingClientRect(), b = R.getBoundingClientRect();
|
|
1246
|
+
i.current.style.transition = "none", i.current.style.left = b.left - k.left + "px", i.current.style.width = b.width + "px";
|
|
1247
1247
|
}));
|
|
1248
1248
|
};
|
|
1249
1249
|
return p.current = h, ct(() => {
|
|
1250
1250
|
const f = d.current !== s;
|
|
1251
1251
|
d.current = s, u.current = l && f, h();
|
|
1252
|
-
}),
|
|
1252
|
+
}), z(() => {
|
|
1253
1253
|
if (!o.current) return;
|
|
1254
1254
|
const f = new ResizeObserver(() => {
|
|
1255
1255
|
u.current = !1, p.current();
|
|
@@ -1303,7 +1303,7 @@ function He({
|
|
|
1303
1303
|
padding: o = "m",
|
|
1304
1304
|
...i
|
|
1305
1305
|
}) {
|
|
1306
|
-
const [l, c] =
|
|
1306
|
+
const [l, c] = D(n), u = r !== void 0, d = u ? r : l, p = () => {
|
|
1307
1307
|
u ? a == null || a(!r) : c((f) => !f);
|
|
1308
1308
|
}, h = [
|
|
1309
1309
|
"ds-accordion",
|
|
@@ -1367,32 +1367,32 @@ function Vt(t, s, n) {
|
|
|
1367
1367
|
return o === t.top ? "top" : o === a - t.bottom ? "bottom" : o === r - t.right ? "right" : "left";
|
|
1368
1368
|
}
|
|
1369
1369
|
function Ve({ children: t, content: s, position: n, ...r }) {
|
|
1370
|
-
const [a, o] =
|
|
1370
|
+
const [a, o] = D(!1), [i, l] = D({ visibility: "hidden" }), [c, u] = D(n || "top"), d = A(null), p = A(null), h = A(!1), f = () => {
|
|
1371
1371
|
if (!d.current || !p.current) return;
|
|
1372
|
-
const N = d.current.getBoundingClientRect(),
|
|
1372
|
+
const N = d.current.getBoundingClientRect(), g = p.current.getBoundingClientRect(), j = n || Vt(N, g.height, g.width), { top: R, left: k, arrowOffset: b } = Ht(j, N, g);
|
|
1373
1373
|
u(j), l({
|
|
1374
1374
|
position: "fixed",
|
|
1375
|
-
top:
|
|
1376
|
-
left:
|
|
1375
|
+
top: R,
|
|
1376
|
+
left: k,
|
|
1377
1377
|
visibility: "visible",
|
|
1378
|
-
"--arrow-offset": `${
|
|
1378
|
+
"--arrow-offset": `${b}px`
|
|
1379
1379
|
});
|
|
1380
1380
|
};
|
|
1381
|
-
if (
|
|
1381
|
+
if (z(() => {
|
|
1382
1382
|
if (!a) return;
|
|
1383
1383
|
l({ position: "fixed", visibility: "hidden" });
|
|
1384
1384
|
const N = requestAnimationFrame(f);
|
|
1385
1385
|
return window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
1386
1386
|
cancelAnimationFrame(N), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
1387
1387
|
};
|
|
1388
|
-
}, [a, n]),
|
|
1388
|
+
}, [a, n]), z(() => {
|
|
1389
1389
|
if (!a) return;
|
|
1390
|
-
const N = (
|
|
1391
|
-
d.current && !d.current.contains(
|
|
1390
|
+
const N = (g) => {
|
|
1391
|
+
d.current && !d.current.contains(g.target) && o(!1);
|
|
1392
1392
|
};
|
|
1393
1393
|
return document.addEventListener("touchstart", N), () => document.removeEventListener("touchstart", N);
|
|
1394
1394
|
}, [a]), !s) return t;
|
|
1395
|
-
const
|
|
1395
|
+
const _ = a && /* @__PURE__ */ e.jsx(
|
|
1396
1396
|
"div",
|
|
1397
1397
|
{
|
|
1398
1398
|
ref: p,
|
|
@@ -1420,7 +1420,7 @@ function Ve({ children: t, content: s, position: n, ...r }) {
|
|
|
1420
1420
|
...r,
|
|
1421
1421
|
children: [
|
|
1422
1422
|
t,
|
|
1423
|
-
typeof document < "u" && re.createPortal(
|
|
1423
|
+
typeof document < "u" && re.createPortal(_, document.body)
|
|
1424
1424
|
]
|
|
1425
1425
|
}
|
|
1426
1426
|
);
|
|
@@ -1443,59 +1443,59 @@ function Ks({
|
|
|
1443
1443
|
popoverClassName: u = "",
|
|
1444
1444
|
...d
|
|
1445
1445
|
}) {
|
|
1446
|
-
const p = bt(), h =
|
|
1447
|
-
|
|
1448
|
-
}, []),
|
|
1449
|
-
I(),
|
|
1450
|
-
}, [I]),
|
|
1451
|
-
I(),
|
|
1452
|
-
}, [I]),
|
|
1453
|
-
const
|
|
1454
|
-
if (!
|
|
1455
|
-
const
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1446
|
+
const p = bt(), h = A(null), f = A(null), _ = A(null), [N, g] = D(!1), [j, R] = D(null), k = s != null, b = a || t || "", w = Qe(t || a), S = Qe(o), I = se(() => {
|
|
1447
|
+
_.current != null && (window.clearTimeout(_.current), _.current = null);
|
|
1448
|
+
}, []), L = se(() => {
|
|
1449
|
+
I(), g(!0);
|
|
1450
|
+
}, [I]), F = se(() => {
|
|
1451
|
+
I(), _.current = window.setTimeout(() => g(!1), Yt);
|
|
1452
|
+
}, [I]), W = se(() => {
|
|
1453
|
+
const P = h.current, V = f.current;
|
|
1454
|
+
if (!P) return;
|
|
1455
|
+
const x = P.getBoundingClientRect(), $ = (V == null ? void 0 : V.offsetHeight) ?? 160, T = (V == null ? void 0 : V.offsetWidth) ?? 260;
|
|
1456
|
+
let C = x.bottom + Ze;
|
|
1457
|
+
C + $ > window.innerHeight - Ee && (C = Math.max(Ee, x.top - $ - Ze));
|
|
1458
|
+
const H = Math.max(Ee, Math.min(x.left, window.innerWidth - T - Ee));
|
|
1459
|
+
R({ top: C, left: H });
|
|
1460
1460
|
}, []);
|
|
1461
1461
|
ct(() => {
|
|
1462
|
-
N &&
|
|
1463
|
-
}, [N,
|
|
1462
|
+
N && W();
|
|
1463
|
+
}, [N, W]), z(() => {
|
|
1464
1464
|
if (!N) return;
|
|
1465
|
-
const
|
|
1466
|
-
$.key === "Escape" &&
|
|
1467
|
-
},
|
|
1468
|
-
var
|
|
1465
|
+
const P = () => W(), V = ($) => {
|
|
1466
|
+
$.key === "Escape" && g(!1);
|
|
1467
|
+
}, x = ($) => {
|
|
1468
|
+
var C, H;
|
|
1469
1469
|
if (n === "hover") return;
|
|
1470
|
-
const
|
|
1471
|
-
(
|
|
1470
|
+
const T = $.target;
|
|
1471
|
+
(C = f.current) != null && C.contains(T) || (H = h.current) != null && H.contains(T) || g(!1);
|
|
1472
1472
|
};
|
|
1473
|
-
return window.addEventListener("scroll",
|
|
1474
|
-
window.removeEventListener("scroll",
|
|
1473
|
+
return window.addEventListener("scroll", P, !0), window.addEventListener("resize", P), document.addEventListener("keydown", V), document.addEventListener("mousedown", x), () => {
|
|
1474
|
+
window.removeEventListener("scroll", P, !0), window.removeEventListener("resize", P), document.removeEventListener("keydown", V), document.removeEventListener("mousedown", x);
|
|
1475
1475
|
};
|
|
1476
|
-
}, [N,
|
|
1477
|
-
const
|
|
1476
|
+
}, [N, W, n]), z(() => () => I(), [I]);
|
|
1477
|
+
const y = n === "hover" ? { onMouseEnter: L, onMouseLeave: F } : {}, O = N ? re.createPortal(
|
|
1478
1478
|
/* @__PURE__ */ e.jsxs(
|
|
1479
1479
|
"div",
|
|
1480
1480
|
{
|
|
1481
1481
|
ref: f,
|
|
1482
1482
|
id: p,
|
|
1483
1483
|
role: "dialog",
|
|
1484
|
-
"aria-label":
|
|
1484
|
+
"aria-label": b || w || "Mention",
|
|
1485
1485
|
"data-ds-portal": "",
|
|
1486
1486
|
className: ["ds-mention__popover", u].filter(Boolean).join(" "),
|
|
1487
1487
|
style: j ? { top: j.top, left: j.left } : { top: -9999, left: -9999, visibility: "hidden" },
|
|
1488
|
-
...
|
|
1488
|
+
...y,
|
|
1489
1489
|
children: [
|
|
1490
|
-
(r ||
|
|
1490
|
+
(r || b || S) && /* @__PURE__ */ e.jsxs("div", { className: "ds-mention__head", children: [
|
|
1491
1491
|
r,
|
|
1492
|
-
(
|
|
1493
|
-
|
|
1494
|
-
|
|
1492
|
+
(b || S) && /* @__PURE__ */ e.jsxs("div", { className: "ds-mention__meta", children: [
|
|
1493
|
+
b ? /* @__PURE__ */ e.jsx("span", { className: "ds-mention__name", children: b }) : null,
|
|
1494
|
+
S ? /* @__PURE__ */ e.jsx("span", { className: "ds-mention__handle", children: S }) : null
|
|
1495
1495
|
] })
|
|
1496
1496
|
] }),
|
|
1497
1497
|
i ? /* @__PURE__ */ e.jsx("p", { className: "ds-mention__desc", children: i }) : null,
|
|
1498
|
-
l ? /* @__PURE__ */ e.jsx("div", { className: "ds-mention__actions", onClick: () =>
|
|
1498
|
+
l ? /* @__PURE__ */ e.jsx("div", { className: "ds-mention__actions", onClick: () => g(!1), children: l }) : null
|
|
1499
1499
|
]
|
|
1500
1500
|
}
|
|
1501
1501
|
),
|
|
@@ -1510,28 +1510,28 @@ function Ks({
|
|
|
1510
1510
|
type: "button",
|
|
1511
1511
|
className: [
|
|
1512
1512
|
"ds-mention",
|
|
1513
|
-
|
|
1513
|
+
k && "ds-mention--custom",
|
|
1514
1514
|
c
|
|
1515
1515
|
].filter(Boolean).join(" "),
|
|
1516
1516
|
"aria-expanded": N,
|
|
1517
1517
|
"aria-haspopup": "dialog",
|
|
1518
|
-
"aria-label":
|
|
1518
|
+
"aria-label": k && (w || b) || void 0,
|
|
1519
1519
|
"aria-controls": N ? p : void 0,
|
|
1520
|
-
onClick: (
|
|
1521
|
-
var
|
|
1522
|
-
if ((
|
|
1523
|
-
if (
|
|
1524
|
-
|
|
1520
|
+
onClick: (P) => {
|
|
1521
|
+
var V;
|
|
1522
|
+
if ((V = d.onClick) == null || V.call(d, P), !P.defaultPrevented) {
|
|
1523
|
+
if (P.preventDefault(), P.stopPropagation(), n === "hover") {
|
|
1524
|
+
L();
|
|
1525
1525
|
return;
|
|
1526
1526
|
}
|
|
1527
|
-
|
|
1527
|
+
g((x) => !x);
|
|
1528
1528
|
}
|
|
1529
1529
|
},
|
|
1530
|
-
...
|
|
1531
|
-
children:
|
|
1530
|
+
...y,
|
|
1531
|
+
children: k ? s : w
|
|
1532
1532
|
}
|
|
1533
1533
|
),
|
|
1534
|
-
typeof document < "u" ?
|
|
1534
|
+
typeof document < "u" ? O : null
|
|
1535
1535
|
] });
|
|
1536
1536
|
}
|
|
1537
1537
|
function Xs({
|
|
@@ -1681,7 +1681,7 @@ function Xt(t) {
|
|
|
1681
1681
|
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
|
|
1682
1682
|
}
|
|
1683
1683
|
function Qs({ seed: t, icon: s, src: n, size: r = 32, className: a = "", style: o = {}, ...i }) {
|
|
1684
|
-
const l = Kt(t ?? ""), [c, u] =
|
|
1684
|
+
const l = Kt(t ?? ""), [c, u] = D(!1), d = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: Xt(t) });
|
|
1685
1685
|
return /* @__PURE__ */ e.jsx(
|
|
1686
1686
|
"div",
|
|
1687
1687
|
{
|
|
@@ -1921,7 +1921,7 @@ function fn({
|
|
|
1921
1921
|
}
|
|
1922
1922
|
),
|
|
1923
1923
|
h.map(
|
|
1924
|
-
(f,
|
|
1924
|
+
(f, _) => f === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${_}`) : /* @__PURE__ */ e.jsx(
|
|
1925
1925
|
"button",
|
|
1926
1926
|
{
|
|
1927
1927
|
className: `ds-pagination-page${f === t ? " ds-pagination-page--current" : ""}`,
|
|
@@ -1968,27 +1968,27 @@ function mn({
|
|
|
1968
1968
|
closeLabel: u,
|
|
1969
1969
|
...d
|
|
1970
1970
|
}) {
|
|
1971
|
-
const p = K(), h =
|
|
1972
|
-
!n ||
|
|
1971
|
+
const p = K(), h = A(null), f = X.useId(), [_, N] = D(!1), g = () => {
|
|
1972
|
+
!n || _ || (N(!0), setTimeout(() => {
|
|
1973
1973
|
N(!1), n();
|
|
1974
1974
|
}, Zt));
|
|
1975
1975
|
};
|
|
1976
|
-
|
|
1977
|
-
const
|
|
1978
|
-
I.key === "Escape" &&
|
|
1979
|
-
},
|
|
1980
|
-
var
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1976
|
+
z(() => {
|
|
1977
|
+
const w = (I) => {
|
|
1978
|
+
I.key === "Escape" && g();
|
|
1979
|
+
}, S = (I) => {
|
|
1980
|
+
var F, W;
|
|
1981
|
+
const L = Ce(I);
|
|
1982
|
+
L && ((F = c == null ? void 0 : c.current) != null && F.contains(L) || (W = h.current) != null && W.contains(L) || Ue(L, null) || g());
|
|
1983
1983
|
};
|
|
1984
|
-
return document.addEventListener("keydown",
|
|
1985
|
-
document.removeEventListener("keydown",
|
|
1984
|
+
return document.addEventListener("keydown", w), document.addEventListener("mousedown", S), () => {
|
|
1985
|
+
document.removeEventListener("keydown", w), document.removeEventListener("mousedown", S);
|
|
1986
1986
|
};
|
|
1987
|
-
}, [n,
|
|
1988
|
-
const j = X.Children.toArray(t),
|
|
1987
|
+
}, [n, _, c]);
|
|
1988
|
+
const j = X.Children.toArray(t), R = j.find((w) => (w == null ? void 0 : w.type) === et || (w == null ? void 0 : w.type) === xe), k = j.filter((w) => (w == null ? void 0 : w.type) !== et && (w == null ? void 0 : w.type) !== xe), b = /* @__PURE__ */ e.jsx(
|
|
1989
1989
|
"div",
|
|
1990
1990
|
{
|
|
1991
|
-
className: ["ds-side-page-overlay",
|
|
1991
|
+
className: ["ds-side-page-overlay", _ && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
|
|
1992
1992
|
"data-side": a,
|
|
1993
1993
|
style: { "--ds-side-page-offset-left": `${i}px`, "--ds-side-page-offset-right": `${l}px` },
|
|
1994
1994
|
...d,
|
|
@@ -1996,7 +1996,7 @@ function mn({
|
|
|
1996
1996
|
"div",
|
|
1997
1997
|
{
|
|
1998
1998
|
ref: h,
|
|
1999
|
-
className: ["ds-side-page",
|
|
1999
|
+
className: ["ds-side-page", _ && "ds-side-page--closing"].filter(Boolean).join(" "),
|
|
2000
2000
|
"data-surface": "2",
|
|
2001
2001
|
"data-side": a,
|
|
2002
2002
|
"data-size": o,
|
|
@@ -2011,7 +2011,7 @@ function mn({
|
|
|
2011
2011
|
variant: "ghost",
|
|
2012
2012
|
size: "small",
|
|
2013
2013
|
icon: /* @__PURE__ */ e.jsx(ee, { size: q[2], strokeWidth: 1.5 }),
|
|
2014
|
-
onClick:
|
|
2014
|
+
onClick: g,
|
|
2015
2015
|
"aria-label": u ?? p.close
|
|
2016
2016
|
}
|
|
2017
2017
|
),
|
|
@@ -2019,14 +2019,14 @@ function mn({
|
|
|
2019
2019
|
s && /* @__PURE__ */ e.jsx("h3", { id: f, className: "ds-side-page__title", children: s }),
|
|
2020
2020
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
|
|
2021
2021
|
] }),
|
|
2022
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children:
|
|
2023
|
-
|
|
2022
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: k }),
|
|
2023
|
+
R
|
|
2024
2024
|
]
|
|
2025
2025
|
}
|
|
2026
2026
|
)
|
|
2027
2027
|
}
|
|
2028
2028
|
);
|
|
2029
|
-
return typeof document > "u" ?
|
|
2029
|
+
return typeof document > "u" ? b : re.createPortal(b, document.body);
|
|
2030
2030
|
}
|
|
2031
2031
|
function et({ children: t }) {
|
|
2032
2032
|
return !t || X.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
@@ -2081,7 +2081,7 @@ function hn({
|
|
|
2081
2081
|
className: d = "",
|
|
2082
2082
|
...p
|
|
2083
2083
|
}) {
|
|
2084
|
-
const { collapsed: h, side: f } = ie(_e),
|
|
2084
|
+
const { collapsed: h, side: f } = ie(_e), _ = ie(Re), j = {
|
|
2085
2085
|
className: [
|
|
2086
2086
|
"ds-nav-rail__item",
|
|
2087
2087
|
d
|
|
@@ -2098,10 +2098,10 @@ function hn({
|
|
|
2098
2098
|
"data-onboarding": u || void 0
|
|
2099
2099
|
},
|
|
2100
2100
|
...p
|
|
2101
|
-
},
|
|
2101
|
+
}, R = i != null, k = f === "left" ? "right" : "left", b = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2102
2102
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
2103
2103
|
!h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
|
|
2104
|
-
!h &&
|
|
2104
|
+
!h && R && /* @__PURE__ */ e.jsx(
|
|
2105
2105
|
"span",
|
|
2106
2106
|
{
|
|
2107
2107
|
className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "),
|
|
@@ -2109,11 +2109,11 @@ function hn({
|
|
|
2109
2109
|
children: i
|
|
2110
2110
|
}
|
|
2111
2111
|
),
|
|
2112
|
-
!h && l && (!
|
|
2113
|
-
h &&
|
|
2114
|
-
h && l && (!
|
|
2115
|
-
] }),
|
|
2116
|
-
return h && !
|
|
2112
|
+
!h && l && (!R || i === 0) && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot ds-nav-rail__dot--inline", "aria-hidden": "true" }),
|
|
2113
|
+
h && R && i !== 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__count-collapsed", "data-updated": l || void 0, children: i > 99 ? "99+" : i }),
|
|
2114
|
+
h && l && (!R || i === 0) && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
2115
|
+
] }), w = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...j, children: b }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...j, children: b });
|
|
2116
|
+
return h && !_ ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: k, children: w }) : w;
|
|
2117
2117
|
}
|
|
2118
2118
|
function xn({ children: t, className: s = "", ...n }) {
|
|
2119
2119
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__body", "ds-scrollable", s].filter(Boolean).join(" "), ...n, children: t });
|
|
@@ -2128,7 +2128,7 @@ function _n({ className: t = "", ...s }) {
|
|
|
2128
2128
|
return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
|
|
2129
2129
|
}
|
|
2130
2130
|
function jn({ children: t, label: s, defaultOpen: n = !0, className: r = "", ...a }) {
|
|
2131
|
-
const { collapsed: o } = ie(_e), i = K(), l = s ?? i.recents, [c, u] =
|
|
2131
|
+
const { collapsed: o } = ie(_e), i = K(), l = s ?? i.recents, [c, u] = D(n);
|
|
2132
2132
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...a, children: [
|
|
2133
2133
|
!o && /* @__PURE__ */ e.jsxs(
|
|
2134
2134
|
"button",
|
|
@@ -2189,11 +2189,11 @@ function wn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a,
|
|
|
2189
2189
|
"data-disabled": r || void 0
|
|
2190
2190
|
},
|
|
2191
2191
|
...l
|
|
2192
|
-
},
|
|
2192
|
+
}, _ = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2193
2193
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
2194
2194
|
!c && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
2195
|
-
] }), N = u === "left" ? "right" : "left",
|
|
2196
|
-
return c && !d ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: N, children:
|
|
2195
|
+
] }), N = u === "left" ? "right" : "left", g = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...f, children: _ }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...f, children: _ });
|
|
2196
|
+
return c && !d ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: N, children: g }) : g;
|
|
2197
2197
|
}
|
|
2198
2198
|
const tt = 240, st = 6, nt = 8;
|
|
2199
2199
|
function gn({
|
|
@@ -2205,51 +2205,51 @@ function gn({
|
|
|
2205
2205
|
defaultOpen: o = !1,
|
|
2206
2206
|
closeLabel: i
|
|
2207
2207
|
}) {
|
|
2208
|
-
const l = K(), { side: c } = ie(_e), [u, d] =
|
|
2208
|
+
const l = K(), { side: c } = ie(_e), [u, d] = D(o), p = r !== void 0, h = p ? r : u, [f, _] = D(!1), N = A(null), g = A(null), [j, R] = D({}), k = se(() => {
|
|
2209
2209
|
p ? a == null || a(!0) : d(!0);
|
|
2210
|
-
}, [p, a]),
|
|
2210
|
+
}, [p, a]), b = se(() => {
|
|
2211
2211
|
p ? a == null || a(!1) : d(!1);
|
|
2212
|
-
}, [p, a]),
|
|
2213
|
-
var
|
|
2214
|
-
const
|
|
2215
|
-
if (!
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2212
|
+
}, [p, a]), w = se(() => h ? b() : k(), [h, k, b]), S = se(() => {
|
|
2213
|
+
var P;
|
|
2214
|
+
const L = N.current;
|
|
2215
|
+
if (!L) return;
|
|
2216
|
+
const F = L.getBoundingClientRect(), W = window.innerHeight, y = ((P = g.current) == null ? void 0 : P.offsetHeight) ?? 300, O = Math.max(nt, Math.min(W - y - nt, F.top));
|
|
2217
|
+
R(c === "right" ? {
|
|
2218
2218
|
position: "fixed",
|
|
2219
|
-
top:
|
|
2220
|
-
right: window.innerWidth -
|
|
2219
|
+
top: O,
|
|
2220
|
+
right: window.innerWidth - F.left + st,
|
|
2221
2221
|
width: tt
|
|
2222
2222
|
} : {
|
|
2223
2223
|
position: "fixed",
|
|
2224
|
-
top:
|
|
2225
|
-
left:
|
|
2224
|
+
top: O,
|
|
2225
|
+
left: F.right + st,
|
|
2226
2226
|
width: tt
|
|
2227
2227
|
});
|
|
2228
2228
|
}, [c]);
|
|
2229
|
-
|
|
2229
|
+
z(() => {
|
|
2230
2230
|
if (!h) {
|
|
2231
|
-
|
|
2231
|
+
_(!1);
|
|
2232
2232
|
return;
|
|
2233
2233
|
}
|
|
2234
|
-
return
|
|
2235
|
-
window.removeEventListener("scroll",
|
|
2234
|
+
return S(), requestAnimationFrame(() => _(!0)), window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), () => {
|
|
2235
|
+
window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
|
|
2236
2236
|
};
|
|
2237
|
-
}, [h,
|
|
2237
|
+
}, [h, S]), z(() => {
|
|
2238
2238
|
if (!h) return;
|
|
2239
|
-
const
|
|
2240
|
-
var
|
|
2241
|
-
!((
|
|
2242
|
-
},
|
|
2243
|
-
|
|
2239
|
+
const L = (W) => {
|
|
2240
|
+
var y, O;
|
|
2241
|
+
!((y = g.current) != null && y.contains(W.target)) && !((O = N.current) != null && O.contains(W.target)) && b();
|
|
2242
|
+
}, F = (W) => {
|
|
2243
|
+
W.key === "Escape" && b();
|
|
2244
2244
|
};
|
|
2245
|
-
return document.addEventListener("mousedown",
|
|
2246
|
-
document.removeEventListener("mousedown",
|
|
2245
|
+
return document.addEventListener("mousedown", L), document.addEventListener("keydown", F), () => {
|
|
2246
|
+
document.removeEventListener("mousedown", L), document.removeEventListener("keydown", F);
|
|
2247
2247
|
};
|
|
2248
|
-
}, [h,
|
|
2248
|
+
}, [h, b]);
|
|
2249
2249
|
const I = h && /* @__PURE__ */ e.jsxs(
|
|
2250
2250
|
"div",
|
|
2251
2251
|
{
|
|
2252
|
-
ref:
|
|
2252
|
+
ref: g,
|
|
2253
2253
|
className: [
|
|
2254
2254
|
"ds-nav-rail-flyout",
|
|
2255
2255
|
`ds-nav-rail-flyout--${c}`,
|
|
@@ -2267,7 +2267,7 @@ function gn({
|
|
|
2267
2267
|
{
|
|
2268
2268
|
type: "button",
|
|
2269
2269
|
className: "ds-nav-rail-flyout__close",
|
|
2270
|
-
onClick:
|
|
2270
|
+
onClick: b,
|
|
2271
2271
|
"aria-label": i ?? l.close,
|
|
2272
2272
|
children: /* @__PURE__ */ e.jsx(ee, { size: 16, strokeWidth: 2 })
|
|
2273
2273
|
}
|
|
@@ -2278,7 +2278,7 @@ function gn({
|
|
|
2278
2278
|
}
|
|
2279
2279
|
);
|
|
2280
2280
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2281
|
-
/* @__PURE__ */ e.jsx(Re.Provider, { value: h, children: /* @__PURE__ */ e.jsx("div", { ref: N, onClick:
|
|
2281
|
+
/* @__PURE__ */ e.jsx(Re.Provider, { value: h, children: /* @__PURE__ */ e.jsx("div", { ref: N, onClick: w, style: { display: "flex", flexDirection: "column", width: "100%" }, children: t }) }),
|
|
2282
2282
|
typeof document < "u" && re.createPortal(I, document.body)
|
|
2283
2283
|
] });
|
|
2284
2284
|
}
|
|
@@ -2342,96 +2342,96 @@ function kn({
|
|
|
2342
2342
|
style: l,
|
|
2343
2343
|
...c
|
|
2344
2344
|
}) {
|
|
2345
|
-
const [u, d] =
|
|
2345
|
+
const [u, d] = D(!1), [p, h] = D(!1), f = n !== void 0, _ = f ? n : u, N = A(null), g = A(null), j = A(null), R = A(null), [k, b] = D({}), w = A(null), S = 150, I = () => {
|
|
2346
2346
|
if (f)
|
|
2347
2347
|
r == null || r(!1);
|
|
2348
2348
|
else {
|
|
2349
2349
|
if (p) return;
|
|
2350
|
-
h(!0),
|
|
2350
|
+
h(!0), w.current = setTimeout(() => {
|
|
2351
2351
|
d(!1), h(!1);
|
|
2352
|
-
},
|
|
2352
|
+
}, S);
|
|
2353
2353
|
}
|
|
2354
|
-
},
|
|
2355
|
-
const
|
|
2356
|
-
f ? r == null || r(
|
|
2357
|
-
},
|
|
2358
|
-
|
|
2354
|
+
}, L = () => {
|
|
2355
|
+
const x = !_;
|
|
2356
|
+
f ? r == null || r(x) : x ? (clearTimeout(w.current), h(!1), d(!0)) : I();
|
|
2357
|
+
}, F = () => {
|
|
2358
|
+
_ || (f ? r == null || r(!0) : (clearTimeout(w.current), h(!1), d(!0)));
|
|
2359
2359
|
};
|
|
2360
|
-
|
|
2361
|
-
if (!
|
|
2362
|
-
const
|
|
2360
|
+
z(() => () => clearTimeout(w.current), []), z(() => {
|
|
2361
|
+
if (!_) return;
|
|
2362
|
+
const x = 300, $ = () => {
|
|
2363
2363
|
var Y;
|
|
2364
|
-
const
|
|
2365
|
-
if (!
|
|
2366
|
-
const
|
|
2367
|
-
|
|
2368
|
-
a === "right" ?
|
|
2364
|
+
const T = (Y = N.current) == null ? void 0 : Y.getBoundingClientRect();
|
|
2365
|
+
if (!T) return;
|
|
2366
|
+
const C = window.innerHeight - T.bottom, H = C < x + 8 && T.top > C;
|
|
2367
|
+
b(
|
|
2368
|
+
a === "right" ? H ? { bottom: window.innerHeight - T.top + 4, top: "auto", right: window.innerWidth - T.right } : { top: T.bottom + 4, bottom: "auto", right: window.innerWidth - T.right } : H ? { bottom: window.innerHeight - T.top + 4, top: "auto", left: T.left } : { top: T.bottom + 4, bottom: "auto", left: T.left }
|
|
2369
2369
|
);
|
|
2370
2370
|
};
|
|
2371
2371
|
return $(), window.addEventListener("scroll", $, !0), window.addEventListener("resize", $), () => {
|
|
2372
2372
|
window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $);
|
|
2373
2373
|
};
|
|
2374
|
-
}, [
|
|
2375
|
-
const
|
|
2374
|
+
}, [_, a]);
|
|
2375
|
+
const W = () => {
|
|
2376
2376
|
var $;
|
|
2377
|
-
const
|
|
2377
|
+
const x = ($ = j.current) == null ? void 0 : $.querySelector(
|
|
2378
2378
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
2379
2379
|
);
|
|
2380
|
-
|
|
2380
|
+
x == null || x.focus();
|
|
2381
2381
|
};
|
|
2382
|
-
|
|
2383
|
-
if (!
|
|
2384
|
-
const
|
|
2385
|
-
var
|
|
2386
|
-
!((
|
|
2387
|
-
}, $ = (
|
|
2388
|
-
|
|
2382
|
+
z(() => {
|
|
2383
|
+
if (!_) return;
|
|
2384
|
+
const x = (T) => {
|
|
2385
|
+
var C, H;
|
|
2386
|
+
!((C = N.current) != null && C.contains(T.target)) && !((H = g.current) != null && H.contains(T.target)) && I();
|
|
2387
|
+
}, $ = (T) => {
|
|
2388
|
+
T.key === "Escape" && (I(), W());
|
|
2389
2389
|
};
|
|
2390
|
-
return document.addEventListener("mousedown",
|
|
2391
|
-
document.removeEventListener("mousedown",
|
|
2390
|
+
return document.addEventListener("mousedown", x), document.addEventListener("keydown", $), () => {
|
|
2391
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", $);
|
|
2392
2392
|
};
|
|
2393
|
-
}, [
|
|
2394
|
-
if (!
|
|
2395
|
-
const
|
|
2396
|
-
$ == null || $.focus(),
|
|
2397
|
-
}, [
|
|
2398
|
-
const
|
|
2393
|
+
}, [_]), z(() => {
|
|
2394
|
+
if (!_ || !R.current || !g.current) return;
|
|
2395
|
+
const x = y(), $ = R.current === "last" ? x[x.length - 1] : x[0];
|
|
2396
|
+
$ == null || $.focus(), R.current = null;
|
|
2397
|
+
}, [_]);
|
|
2398
|
+
const y = () => g.current ? [...g.current.querySelectorAll(
|
|
2399
2399
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
2400
|
-
)] : [],
|
|
2401
|
-
var $,
|
|
2402
|
-
if (
|
|
2403
|
-
|
|
2404
|
-
else if (
|
|
2405
|
-
if (
|
|
2406
|
-
|
|
2400
|
+
)] : [], O = (x) => {
|
|
2401
|
+
var $, T;
|
|
2402
|
+
if (x.key === "ArrowDown")
|
|
2403
|
+
x.preventDefault(), _ ? ($ = y()[0]) == null || $.focus() : (R.current = "first", F());
|
|
2404
|
+
else if (x.key === "ArrowUp")
|
|
2405
|
+
if (x.preventDefault(), !_)
|
|
2406
|
+
R.current = "last", F();
|
|
2407
2407
|
else {
|
|
2408
|
-
const
|
|
2409
|
-
(
|
|
2408
|
+
const C = y();
|
|
2409
|
+
(T = C[C.length - 1]) == null || T.focus();
|
|
2410
2410
|
}
|
|
2411
|
-
},
|
|
2412
|
-
var
|
|
2413
|
-
const $ =
|
|
2414
|
-
switch (
|
|
2411
|
+
}, P = (x) => {
|
|
2412
|
+
var C, H, Y, m;
|
|
2413
|
+
const $ = y(), T = $.findIndex((v) => v === document.activeElement);
|
|
2414
|
+
switch (x.key) {
|
|
2415
2415
|
case "ArrowDown":
|
|
2416
|
-
|
|
2416
|
+
x.preventDefault(), (C = $[Math.min(T + 1, $.length - 1)]) == null || C.focus();
|
|
2417
2417
|
break;
|
|
2418
2418
|
case "ArrowUp":
|
|
2419
|
-
|
|
2419
|
+
x.preventDefault(), T <= 0 ? W() : (H = $[T - 1]) == null || H.focus();
|
|
2420
2420
|
break;
|
|
2421
2421
|
case "Home":
|
|
2422
|
-
|
|
2422
|
+
x.preventDefault(), (Y = $[0]) == null || Y.focus();
|
|
2423
2423
|
break;
|
|
2424
2424
|
case "End":
|
|
2425
|
-
|
|
2425
|
+
x.preventDefault(), (m = $[$.length - 1]) == null || m.focus();
|
|
2426
2426
|
break;
|
|
2427
2427
|
case "Tab":
|
|
2428
2428
|
I();
|
|
2429
2429
|
break;
|
|
2430
2430
|
}
|
|
2431
|
-
},
|
|
2431
|
+
}, V = _ && /* @__PURE__ */ e.jsx(
|
|
2432
2432
|
"div",
|
|
2433
2433
|
{
|
|
2434
|
-
ref:
|
|
2434
|
+
ref: g,
|
|
2435
2435
|
role: "menu",
|
|
2436
2436
|
"data-ds-portal": "",
|
|
2437
2437
|
className: [
|
|
@@ -2439,34 +2439,34 @@ function kn({
|
|
|
2439
2439
|
`ds-dropdown__menu--${a}`,
|
|
2440
2440
|
p && "ds-dropdown__menu--closing"
|
|
2441
2441
|
].filter(Boolean).join(" "),
|
|
2442
|
-
style:
|
|
2443
|
-
onKeyDown:
|
|
2444
|
-
children: s.map((
|
|
2445
|
-
if (
|
|
2442
|
+
style: k,
|
|
2443
|
+
onKeyDown: P,
|
|
2444
|
+
children: s.map((x, $) => {
|
|
2445
|
+
if (x.separator)
|
|
2446
2446
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, $);
|
|
2447
|
-
if (
|
|
2447
|
+
if (x.type === "section")
|
|
2448
2448
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
2449
|
-
|
|
2450
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
2449
|
+
x.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
|
|
2450
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
|
|
2451
2451
|
] }, $);
|
|
2452
|
-
const
|
|
2452
|
+
const T = !!x.href, C = T ? "a" : "button", H = T ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
|
|
2453
2453
|
return /* @__PURE__ */ e.jsxs(
|
|
2454
|
-
|
|
2454
|
+
C,
|
|
2455
2455
|
{
|
|
2456
2456
|
role: "menuitem",
|
|
2457
2457
|
className: [
|
|
2458
2458
|
"ds-dropdown__item",
|
|
2459
|
-
|
|
2459
|
+
x.danger && "ds-dropdown__item--danger"
|
|
2460
2460
|
].filter(Boolean).join(" "),
|
|
2461
|
-
...
|
|
2461
|
+
...H,
|
|
2462
2462
|
onClick: () => {
|
|
2463
2463
|
var Y;
|
|
2464
|
-
(Y =
|
|
2464
|
+
(Y = x.onClick) == null || Y.call(x), I();
|
|
2465
2465
|
},
|
|
2466
2466
|
children: [
|
|
2467
|
-
|
|
2468
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
2469
|
-
|
|
2467
|
+
x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
2468
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: x.label }),
|
|
2469
|
+
x.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: x.shortcut })
|
|
2470
2470
|
]
|
|
2471
2471
|
},
|
|
2472
2472
|
$
|
|
@@ -2487,12 +2487,12 @@ function kn({
|
|
|
2487
2487
|
{
|
|
2488
2488
|
ref: j,
|
|
2489
2489
|
className: "ds-dropdown__trigger",
|
|
2490
|
-
onClick:
|
|
2491
|
-
onKeyDown:
|
|
2490
|
+
onClick: L,
|
|
2491
|
+
onKeyDown: O,
|
|
2492
2492
|
children: t
|
|
2493
2493
|
}
|
|
2494
2494
|
),
|
|
2495
|
-
typeof document < "u" && re.createPortal(
|
|
2495
|
+
typeof document < "u" && re.createPortal(V, document.body)
|
|
2496
2496
|
]
|
|
2497
2497
|
}
|
|
2498
2498
|
);
|
|
@@ -2536,8 +2536,8 @@ function En({
|
|
|
2536
2536
|
}
|
|
2537
2537
|
const es = (t) => 1 - Math.pow(1 - t, 3), ts = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2538
2538
|
function ss(t, { duration: s = 600 } = {}) {
|
|
2539
|
-
const [n, r] =
|
|
2540
|
-
return
|
|
2539
|
+
const [n, r] = D(t), a = A(t), o = A(null);
|
|
2540
|
+
return z(() => {
|
|
2541
2541
|
if (ts()) {
|
|
2542
2542
|
r(t), a.current = t;
|
|
2543
2543
|
return;
|
|
@@ -2564,8 +2564,8 @@ function Tn({
|
|
|
2564
2564
|
return `${r}${i}${a}`;
|
|
2565
2565
|
}
|
|
2566
2566
|
function ns({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2567
|
-
const r =
|
|
2568
|
-
return
|
|
2567
|
+
const r = A(null), [a, o] = D(!1);
|
|
2568
|
+
return z(() => {
|
|
2569
2569
|
const i = r.current;
|
|
2570
2570
|
if (!i) return;
|
|
2571
2571
|
const l = new IntersectionObserver(
|
|
@@ -2587,8 +2587,8 @@ function $n({
|
|
|
2587
2587
|
onLeave: i,
|
|
2588
2588
|
...l
|
|
2589
2589
|
}) {
|
|
2590
|
-
const { ref: c, inView: u } = ns({ threshold: r, rootMargin: a, once: n }), d =
|
|
2591
|
-
return
|
|
2590
|
+
const { ref: c, inView: u } = ns({ threshold: r, rootMargin: a, once: n }), d = A(!1);
|
|
2591
|
+
return z(() => {
|
|
2592
2592
|
u && !d.current && (o == null || o()), !u && d.current && (i == null || i()), d.current = u;
|
|
2593
2593
|
}, [u]), /* @__PURE__ */ e.jsx(s, { ref: c, ...l, children: typeof t == "function" ? t(u) : t });
|
|
2594
2594
|
}
|
|
@@ -2622,8 +2622,8 @@ function Rn() {
|
|
|
2622
2622
|
return t.success = (s, n) => t(s, { ...n, type: "success" }), t.error = (s, n) => t(s, { ...n, type: "error" }), t.warning = (s, n) => t(s, { ...n, type: "warning" }), { toast: t };
|
|
2623
2623
|
}
|
|
2624
2624
|
function os({ data: t, onDismiss: s }) {
|
|
2625
|
-
const n = K(), [r, a] =
|
|
2626
|
-
|
|
2625
|
+
const n = K(), [r, a] = D(!1), o = A(null);
|
|
2626
|
+
z(() => (requestAnimationFrame(() => a(!0)), t.duration > 0 && (o.current = setTimeout(() => i(), t.duration)), () => clearTimeout(o.current)), []);
|
|
2627
2627
|
function i() {
|
|
2628
2628
|
a(!1), setTimeout(() => s(t.id), 250);
|
|
2629
2629
|
}
|
|
@@ -2655,8 +2655,8 @@ function os({ data: t, onDismiss: s }) {
|
|
|
2655
2655
|
);
|
|
2656
2656
|
}
|
|
2657
2657
|
function Sn({ position: t = "bottom-right" }) {
|
|
2658
|
-
const [s, n] =
|
|
2659
|
-
return
|
|
2658
|
+
const [s, n] = D(() => [...ve]);
|
|
2659
|
+
return z(() => (Le.add(n), () => Le.delete(n)), []), !s.length || typeof document > "u" ? null : re.createPortal(
|
|
2660
2660
|
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(os, { data: r, onDismiss: as }, r.id)) }),
|
|
2661
2661
|
document.body
|
|
2662
2662
|
);
|
|
@@ -2717,7 +2717,7 @@ function ls({
|
|
|
2717
2717
|
"aria-label": r,
|
|
2718
2718
|
...a
|
|
2719
2719
|
}) {
|
|
2720
|
-
const o = K(), [i, l] =
|
|
2720
|
+
const o = K(), [i, l] = D(!1), c = (u) => {
|
|
2721
2721
|
u.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
|
|
2722
2722
|
l(!0), setTimeout(() => l(!1), n);
|
|
2723
2723
|
});
|
|
@@ -2736,8 +2736,8 @@ function ls({
|
|
|
2736
2736
|
);
|
|
2737
2737
|
}
|
|
2738
2738
|
function Bn({ content: t, streaming: s = !1, ...n }) {
|
|
2739
|
-
const [r, a] =
|
|
2740
|
-
return
|
|
2739
|
+
const [r, a] = D(s);
|
|
2740
|
+
return z(() => {
|
|
2741
2741
|
a(!!s);
|
|
2742
2742
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2743
2743
|
He,
|
|
@@ -2770,7 +2770,7 @@ function In({
|
|
|
2770
2770
|
const c = K(), { t: u } = be();
|
|
2771
2771
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", o].filter(Boolean).join(" "), ...l, children: [
|
|
2772
2772
|
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i ?? c.steps, children: Array.from({ length: t }, (d, p) => {
|
|
2773
|
-
const h = p === s, f = n.includes(p) && !h,
|
|
2773
|
+
const h = p === s, f = n.includes(p) && !h, _ = r && (p <= s || n.includes(p)), N = [
|
|
2774
2774
|
"ds-step-indicator__dot",
|
|
2775
2775
|
h && "ds-step-indicator__dot--active",
|
|
2776
2776
|
f && "ds-step-indicator__dot--done"
|
|
@@ -2783,7 +2783,7 @@ function In({
|
|
|
2783
2783
|
role: "tab",
|
|
2784
2784
|
"aria-selected": h,
|
|
2785
2785
|
"aria-label": u("stepN", { n: p + 1 }),
|
|
2786
|
-
disabled: !
|
|
2786
|
+
disabled: !_ || p === s,
|
|
2787
2787
|
onClick: () => r == null ? void 0 : r(p),
|
|
2788
2788
|
children: f ? /* @__PURE__ */ e.jsx(Pe, { size: 8, strokeWidth: 3 }) : null
|
|
2789
2789
|
},
|
|
@@ -2805,8 +2805,8 @@ function Ln({
|
|
|
2805
2805
|
className: a = "",
|
|
2806
2806
|
...o
|
|
2807
2807
|
}) {
|
|
2808
|
-
const i =
|
|
2809
|
-
return
|
|
2808
|
+
const i = A(t);
|
|
2809
|
+
return z(() => {
|
|
2810
2810
|
t !== i.current && (r == null || r(t), i.current = t);
|
|
2811
2811
|
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...o, children: [
|
|
2812
2812
|
t,
|
|
@@ -2841,8 +2841,8 @@ function Dn({
|
|
|
2841
2841
|
] });
|
|
2842
2842
|
}
|
|
2843
2843
|
function Pn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2844
|
-
const r =
|
|
2845
|
-
|
|
2844
|
+
const r = A(!1), a = A(0);
|
|
2845
|
+
z(() => {
|
|
2846
2846
|
const o = s == null ? void 0 : s.current;
|
|
2847
2847
|
if (!o) return;
|
|
2848
2848
|
const i = () => {
|
|
@@ -2850,7 +2850,7 @@ function Pn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
|
2850
2850
|
!l && o.scrollTop < a.current && (r.current = !0), l && (r.current = !1), a.current = o.scrollTop;
|
|
2851
2851
|
};
|
|
2852
2852
|
return o.addEventListener("scroll", i, { passive: !0 }), () => o.removeEventListener("scroll", i);
|
|
2853
|
-
}, [s]),
|
|
2853
|
+
}, [s]), z(() => {
|
|
2854
2854
|
const o = s == null ? void 0 : s.current;
|
|
2855
2855
|
o && (n && r.current || (o.scrollTop = o.scrollHeight));
|
|
2856
2856
|
}, t);
|
|
@@ -2864,33 +2864,33 @@ function cs({
|
|
|
2864
2864
|
betweenTime: o = 380,
|
|
2865
2865
|
manualPauseMs: i = 5e3
|
|
2866
2866
|
}) {
|
|
2867
|
-
const [l, c] =
|
|
2868
|
-
|
|
2867
|
+
const [l, c] = D(0), [u, d] = D(""), p = A("typing"), h = A(0), f = A(0), _ = A(null), N = A(0);
|
|
2868
|
+
z(() => {
|
|
2869
2869
|
f.current = l;
|
|
2870
|
-
}, [l]),
|
|
2871
|
-
if (
|
|
2870
|
+
}, [l]), z(() => {
|
|
2871
|
+
if (_.current && (clearTimeout(_.current), _.current = null), !s || t.length === 0) {
|
|
2872
2872
|
d(""), h.current = 0, p.current = "typing";
|
|
2873
2873
|
return;
|
|
2874
2874
|
}
|
|
2875
|
-
const
|
|
2876
|
-
const
|
|
2877
|
-
if (N.current >
|
|
2878
|
-
|
|
2875
|
+
const b = () => {
|
|
2876
|
+
const w = Date.now();
|
|
2877
|
+
if (N.current > w) {
|
|
2878
|
+
_.current = setTimeout(b, N.current - w);
|
|
2879
2879
|
return;
|
|
2880
2880
|
}
|
|
2881
|
-
const
|
|
2882
|
-
p.current === "typing" ? (h.current += 1, d(
|
|
2881
|
+
const S = t[f.current % t.length] ?? "";
|
|
2882
|
+
p.current === "typing" ? (h.current += 1, d(S.slice(0, h.current)), h.current >= S.length ? (p.current = "holding", _.current = setTimeout(b, a)) : _.current = setTimeout(b, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", _.current = setTimeout(b, r)) : (h.current = Math.max(0, h.current - 1), d(S.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", f.current = (f.current + 1) % t.length, c(f.current), _.current = setTimeout(b, o)) : _.current = setTimeout(b, r));
|
|
2883
2883
|
};
|
|
2884
|
-
return
|
|
2885
|
-
|
|
2884
|
+
return _.current = setTimeout(b, 260), () => {
|
|
2885
|
+
_.current && clearTimeout(_.current);
|
|
2886
2886
|
};
|
|
2887
2887
|
}, [s, t, n, r, a, o]);
|
|
2888
|
-
const
|
|
2888
|
+
const g = (b) => {
|
|
2889
2889
|
if (t.length === 0) return;
|
|
2890
|
-
const
|
|
2891
|
-
f.current =
|
|
2892
|
-
}, j = () =>
|
|
2893
|
-
return { displayed: u, currentPrompt:
|
|
2890
|
+
const w = (b % t.length + t.length) % t.length, S = t[w];
|
|
2891
|
+
f.current = w, h.current = S.length, p.current = "holding", N.current = Date.now() + i, c(w), d(S);
|
|
2892
|
+
}, j = () => g(f.current + 1), R = () => g(f.current - 1), k = t[l % t.length] ?? "";
|
|
2893
|
+
return { displayed: u, currentPrompt: k, index: l, next: j, prev: R };
|
|
2894
2894
|
}
|
|
2895
2895
|
let ds = 0;
|
|
2896
2896
|
function Mn({
|
|
@@ -2908,70 +2908,70 @@ function Mn({
|
|
|
2908
2908
|
onAttachFiles: p,
|
|
2909
2909
|
onAttachImages: h,
|
|
2910
2910
|
onRemoveAttachment: f,
|
|
2911
|
-
onRemoveImage:
|
|
2911
|
+
onRemoveImage: _,
|
|
2912
2912
|
acceptImage: N,
|
|
2913
|
-
acceptFile:
|
|
2913
|
+
acceptFile: g,
|
|
2914
2914
|
maxImages: j,
|
|
2915
|
-
maxImageSize:
|
|
2916
|
-
leftSlot:
|
|
2917
|
-
rightSlot:
|
|
2918
|
-
className:
|
|
2919
|
-
...
|
|
2915
|
+
maxImageSize: R,
|
|
2916
|
+
leftSlot: k,
|
|
2917
|
+
rightSlot: b,
|
|
2918
|
+
className: w = "",
|
|
2919
|
+
...S
|
|
2920
2920
|
}) {
|
|
2921
|
-
const I = K(), { t:
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2924
|
-
},
|
|
2925
|
-
const
|
|
2921
|
+
const I = K(), { t: L } = be(), F = A(null), W = A(null), y = A(0), [O, P] = D(!1), [V, x] = D([]), $ = l ?? I.promptPlaceholder, T = (E) => {
|
|
2922
|
+
const M = ++ds;
|
|
2923
|
+
x((J) => [...J, { id: M, msg: E }]), setTimeout(() => x((J) => J.filter((Q) => Q.id !== M)), 6e3);
|
|
2924
|
+
}, C = (E) => x((M) => M.filter((J) => J.id !== E)), H = (E) => E.type.startsWith("image/"), Y = () => !0, m = N ?? H, v = g ?? Y, B = (E) => {
|
|
2925
|
+
const M = [], J = [], Q = [], ne = [];
|
|
2926
2926
|
let ae = 0, me = j != null ? j - ((d == null ? void 0 : d.length) ?? 0) : 1 / 0;
|
|
2927
2927
|
for (const oe of E)
|
|
2928
|
-
m(oe) ?
|
|
2929
|
-
return { imageFiles:
|
|
2930
|
-
},
|
|
2931
|
-
const
|
|
2932
|
-
|
|
2928
|
+
m(oe) ? R && oe.size > R ? Q.push(oe.name) : me > 0 ? (M.push(oe), me--) : ae++ : v(oe) ? J.push(oe) : ne.push(oe.name);
|
|
2929
|
+
return { imageFiles: M, docFiles: J, tooLarge: Q, skipped: ne, limitExceeded: ae };
|
|
2930
|
+
}, U = (E) => {
|
|
2931
|
+
const M = R ? L("fileTooLargeMaxHint", { maxMb: R / 1024 / 1024 }) : "";
|
|
2932
|
+
T(L("fileTooLarge", { maxHint: M, names: E.join(", ") }));
|
|
2933
2933
|
}, te = (E) => {
|
|
2934
|
-
const { imageFiles:
|
|
2935
|
-
Q.length &&
|
|
2936
|
-
const me = J.concat(h ? [] :
|
|
2934
|
+
const { imageFiles: M, docFiles: J, tooLarge: Q, skipped: ne, limitExceeded: ae } = B(E);
|
|
2935
|
+
Q.length && U(Q), ne.length && T(L("filesSkipped", { names: ne.join(", ") })), ae && T(L("maxImages", { n: j })), h && M.length && h(M);
|
|
2936
|
+
const me = J.concat(h ? [] : M);
|
|
2937
2937
|
p && me.length && p(me);
|
|
2938
2938
|
};
|
|
2939
|
-
|
|
2940
|
-
const E =
|
|
2939
|
+
z(() => {
|
|
2940
|
+
const E = W.current;
|
|
2941
2941
|
E && (E.style.height = "auto", E.style.height = `${Math.min(E.scrollHeight, 200)}px`);
|
|
2942
|
-
}, [t]),
|
|
2943
|
-
const E = (
|
|
2942
|
+
}, [t]), z(() => {
|
|
2943
|
+
const E = (M) => {
|
|
2944
2944
|
var Q, ne, ae;
|
|
2945
2945
|
if (o || i) return;
|
|
2946
|
-
const J = (Q =
|
|
2947
|
-
J === "INPUT" || J === "TEXTAREA" || J === "SELECT" || (ne =
|
|
2946
|
+
const J = (Q = M.target) == null ? void 0 : Q.tagName;
|
|
2947
|
+
J === "INPUT" || J === "TEXTAREA" || J === "SELECT" || (ne = M.target) != null && ne.isContentEditable || M.ctrlKey || M.metaKey || M.altKey || M.key.length !== 1 && M.key !== "Backspace" && M.key !== "Delete" || (ae = W.current) == null || ae.focus();
|
|
2948
2948
|
};
|
|
2949
2949
|
return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
|
|
2950
2950
|
}, [o, i]);
|
|
2951
2951
|
const le = (E) => {
|
|
2952
|
-
E.preventDefault(),
|
|
2952
|
+
E.preventDefault(), y.current++, E.dataTransfer.types.includes("Files") && P(!0);
|
|
2953
2953
|
}, G = (E) => {
|
|
2954
|
-
E.preventDefault(),
|
|
2954
|
+
E.preventDefault(), y.current--, y.current === 0 && P(!1);
|
|
2955
2955
|
}, Z = (E) => E.preventDefault(), fe = (E) => {
|
|
2956
|
-
E.preventDefault(),
|
|
2957
|
-
const
|
|
2958
|
-
|
|
2956
|
+
E.preventDefault(), y.current = 0, P(!1);
|
|
2957
|
+
const M = Array.from(E.dataTransfer.files);
|
|
2958
|
+
M.length && te(M);
|
|
2959
2959
|
}, je = (E) => {
|
|
2960
|
-
const
|
|
2961
|
-
|
|
2960
|
+
const M = Array.from(E.target.files || []);
|
|
2961
|
+
F.current && (F.current.value = ""), M.length && te(M);
|
|
2962
2962
|
}, Se = (E) => {
|
|
2963
2963
|
var oe;
|
|
2964
2964
|
if (!h) return;
|
|
2965
|
-
const
|
|
2966
|
-
if (!
|
|
2965
|
+
const M = (oe = E.clipboardData) == null ? void 0 : oe.items;
|
|
2966
|
+
if (!M) return;
|
|
2967
2967
|
const J = [];
|
|
2968
|
-
for (const xt of
|
|
2968
|
+
for (const xt of M) {
|
|
2969
2969
|
const qe = xt.getAsFile();
|
|
2970
2970
|
qe && J.push(qe);
|
|
2971
2971
|
}
|
|
2972
2972
|
if (J.length === 0) return;
|
|
2973
2973
|
const { imageFiles: Q, tooLarge: ne, skipped: ae, limitExceeded: me } = B(J);
|
|
2974
|
-
ne.length &&
|
|
2974
|
+
ne.length && U(ne), ae.length && T(L("filesSkipped", { names: ae.join(", ") })), me && T(L("maxImages", { n: j })), Q.length && (E.preventDefault(), h(Q));
|
|
2975
2975
|
}, Ne = !o && !i && !!(c != null && c.length) && t.length === 0, ke = cs({
|
|
2976
2976
|
prompts: c ?? [],
|
|
2977
2977
|
enabled: Ne
|
|
@@ -2992,11 +2992,11 @@ function Mn({
|
|
|
2992
2992
|
}
|
|
2993
2993
|
a == null || a(E);
|
|
2994
2994
|
}, ht = (t.trim() || (d == null ? void 0 : d.length) > 0 || (u == null ? void 0 : u.length) > 0) && !i, Ye = p || h;
|
|
2995
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input",
|
|
2995
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", w].filter(Boolean).join(" "), ...S, children: [
|
|
2996
2996
|
Ye && /* @__PURE__ */ e.jsx(
|
|
2997
2997
|
"input",
|
|
2998
2998
|
{
|
|
2999
|
-
ref:
|
|
2999
|
+
ref: F,
|
|
3000
3000
|
type: "file",
|
|
3001
3001
|
multiple: !0,
|
|
3002
3002
|
accept: "*/*",
|
|
@@ -3007,17 +3007,17 @@ function Mn({
|
|
|
3007
3007
|
/* @__PURE__ */ e.jsxs(
|
|
3008
3008
|
"div",
|
|
3009
3009
|
{
|
|
3010
|
-
className: ["ds-prompt-input__box",
|
|
3010
|
+
className: ["ds-prompt-input__box", O && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
3011
3011
|
onDragEnter: le,
|
|
3012
3012
|
onDragLeave: G,
|
|
3013
3013
|
onDragOver: Z,
|
|
3014
3014
|
onDrop: fe,
|
|
3015
3015
|
children: [
|
|
3016
|
-
|
|
3016
|
+
O && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: I.dropFilesHere }),
|
|
3017
3017
|
/* @__PURE__ */ e.jsx(
|
|
3018
3018
|
"textarea",
|
|
3019
3019
|
{
|
|
3020
|
-
ref:
|
|
3020
|
+
ref: W,
|
|
3021
3021
|
value: t,
|
|
3022
3022
|
onChange: (E) => s == null ? void 0 : s(E.target.value),
|
|
3023
3023
|
onKeyDown: pt,
|
|
@@ -3032,33 +3032,33 @@ function Mn({
|
|
|
3032
3032
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ke.displayed }),
|
|
3033
3033
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
3034
3034
|
] }),
|
|
3035
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: d.map((E,
|
|
3035
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: d.map((E, M) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
3036
3036
|
/* @__PURE__ */ e.jsx("img", { src: E.preview, alt: "" }),
|
|
3037
3037
|
/* @__PURE__ */ e.jsx(
|
|
3038
3038
|
"button",
|
|
3039
3039
|
{
|
|
3040
3040
|
className: "ds-prompt-input__image-remove",
|
|
3041
|
-
onClick: () =>
|
|
3041
|
+
onClick: () => _ == null ? void 0 : _(M),
|
|
3042
3042
|
"aria-label": I.removeImage,
|
|
3043
3043
|
type: "button",
|
|
3044
3044
|
children: /* @__PURE__ */ e.jsx(ee, { size: 12, strokeWidth: 2 })
|
|
3045
3045
|
}
|
|
3046
3046
|
)
|
|
3047
|
-
] },
|
|
3048
|
-
|
|
3047
|
+
] }, M)) }),
|
|
3048
|
+
V.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: V.map((E) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
3049
3049
|
/* @__PURE__ */ e.jsx("span", { children: E.msg }),
|
|
3050
3050
|
/* @__PURE__ */ e.jsx(
|
|
3051
3051
|
"button",
|
|
3052
3052
|
{
|
|
3053
3053
|
type: "button",
|
|
3054
3054
|
className: "ds-prompt-input__warning-close",
|
|
3055
|
-
onClick: () =>
|
|
3055
|
+
onClick: () => C(E.id),
|
|
3056
3056
|
"aria-label": I.dismiss,
|
|
3057
3057
|
children: /* @__PURE__ */ e.jsx(ee, { size: q[1], strokeWidth: 1.5 })
|
|
3058
3058
|
}
|
|
3059
3059
|
)
|
|
3060
3060
|
] }, E.id)) }),
|
|
3061
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((E,
|
|
3061
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((E, M) => /* @__PURE__ */ e.jsx(he, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
3062
3062
|
E.uploading ? /* @__PURE__ */ e.jsx(Tt, { size: q[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Ge, { size: q[1], strokeWidth: 1.5 }),
|
|
3063
3063
|
E.filename,
|
|
3064
3064
|
E.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: I.uploading }) : /* @__PURE__ */ e.jsx(
|
|
@@ -3066,12 +3066,12 @@ function Mn({
|
|
|
3066
3066
|
{
|
|
3067
3067
|
type: "button",
|
|
3068
3068
|
className: "ds-prompt-input__remove-btn",
|
|
3069
|
-
onClick: () => f == null ? void 0 : f(
|
|
3069
|
+
onClick: () => f == null ? void 0 : f(M),
|
|
3070
3070
|
"aria-label": I.removeAttachment,
|
|
3071
3071
|
children: /* @__PURE__ */ e.jsx(ee, { size: q[1], strokeWidth: 1.5 })
|
|
3072
3072
|
}
|
|
3073
3073
|
)
|
|
3074
|
-
] }) },
|
|
3074
|
+
] }) }, M)) }),
|
|
3075
3075
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
3076
3076
|
Ye && /* @__PURE__ */ e.jsx(
|
|
3077
3077
|
de,
|
|
@@ -3082,12 +3082,12 @@ function Mn({
|
|
|
3082
3082
|
"aria-label": I.attachFiles,
|
|
3083
3083
|
onClick: () => {
|
|
3084
3084
|
var E;
|
|
3085
|
-
return (E =
|
|
3085
|
+
return (E = F.current) == null ? void 0 : E.click();
|
|
3086
3086
|
}
|
|
3087
3087
|
}
|
|
3088
3088
|
),
|
|
3089
|
-
|
|
3090
|
-
|
|
3089
|
+
k,
|
|
3090
|
+
b,
|
|
3091
3091
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
3092
3092
|
o ? /* @__PURE__ */ e.jsx(
|
|
3093
3093
|
de,
|
|
@@ -3127,58 +3127,58 @@ function zn({
|
|
|
3127
3127
|
className: l = "",
|
|
3128
3128
|
...c
|
|
3129
3129
|
}) {
|
|
3130
|
-
const [u, d] =
|
|
3131
|
-
|
|
3130
|
+
const [u, d] = D(!1), p = A(null), h = A(null), f = A(null), [_, N] = D({}), g = r === "s" ? "s" : "xs", j = t.filter((y) => !a || y.name === "auto" ? !0 : (at[y.tier] ?? 1) >= (at[a] ?? 1)), R = j.find((y) => y.name === "auto"), k = j.filter((y) => y.name !== "auto"), b = t.find((y) => y.name === s), S = new Set(k.map((y) => y.tier).filter(Boolean)).size > 1;
|
|
3131
|
+
z(() => {
|
|
3132
3132
|
if (!u) return;
|
|
3133
|
-
const
|
|
3134
|
-
var
|
|
3135
|
-
const
|
|
3136
|
-
if (!
|
|
3137
|
-
const
|
|
3133
|
+
const y = 320, O = () => {
|
|
3134
|
+
var C;
|
|
3135
|
+
const x = (C = h.current) == null ? void 0 : C.getBoundingClientRect();
|
|
3136
|
+
if (!x) return;
|
|
3137
|
+
const $ = window.innerHeight - x.bottom, T = $ < y + 8 && x.top > $;
|
|
3138
3138
|
N({
|
|
3139
3139
|
position: "fixed",
|
|
3140
3140
|
zIndex: "var(--z-dropdown, 500)",
|
|
3141
|
-
left:
|
|
3142
|
-
|
|
3141
|
+
left: x.left,
|
|
3142
|
+
...T ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
|
|
3143
3143
|
});
|
|
3144
3144
|
};
|
|
3145
|
-
|
|
3146
|
-
const
|
|
3147
|
-
var
|
|
3148
|
-
!((
|
|
3149
|
-
},
|
|
3150
|
-
|
|
3145
|
+
O(), window.addEventListener("scroll", O, !0), window.addEventListener("resize", O);
|
|
3146
|
+
const P = (x) => {
|
|
3147
|
+
var $, T;
|
|
3148
|
+
!(($ = p.current) != null && $.contains(x.target)) && !((T = f.current) != null && T.contains(x.target)) && d(!1);
|
|
3149
|
+
}, V = (x) => {
|
|
3150
|
+
x.key === "Escape" && d(!1);
|
|
3151
3151
|
};
|
|
3152
|
-
return document.addEventListener("mousedown",
|
|
3153
|
-
window.removeEventListener("scroll",
|
|
3152
|
+
return document.addEventListener("mousedown", P), document.addEventListener("keydown", V), () => {
|
|
3153
|
+
window.removeEventListener("scroll", O, !0), window.removeEventListener("resize", O), document.removeEventListener("mousedown", P), document.removeEventListener("keydown", V);
|
|
3154
3154
|
};
|
|
3155
3155
|
}, [u]);
|
|
3156
|
-
const
|
|
3157
|
-
n == null || n(
|
|
3158
|
-
},
|
|
3156
|
+
const I = (y) => {
|
|
3157
|
+
n == null || n(y), d(!1);
|
|
3158
|
+
}, L = (y) => /* @__PURE__ */ e.jsxs(
|
|
3159
3159
|
"button",
|
|
3160
3160
|
{
|
|
3161
3161
|
type: "button",
|
|
3162
3162
|
className: [
|
|
3163
3163
|
"ds-model-picker__item",
|
|
3164
|
-
|
|
3164
|
+
y.name === s && "ds-model-picker__item--active"
|
|
3165
3165
|
].filter(Boolean).join(" "),
|
|
3166
|
-
onClick: () =>
|
|
3166
|
+
onClick: () => I(y.name),
|
|
3167
3167
|
children: [
|
|
3168
|
-
|
|
3169
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
3170
|
-
|
|
3168
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: y.icon || /* @__PURE__ */ e.jsx(Ke, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3169
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: y.displayName || y.name }),
|
|
3170
|
+
S && y.tier && /* @__PURE__ */ e.jsx(he, { size: "xs", variant: ot[y.tier] || "default", children: y.tier })
|
|
3171
3171
|
]
|
|
3172
3172
|
},
|
|
3173
|
-
|
|
3174
|
-
),
|
|
3175
|
-
const
|
|
3176
|
-
return
|
|
3177
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
3178
|
-
...
|
|
3173
|
+
y.name
|
|
3174
|
+
), F = () => !i || !S ? k.map(L) : ["fast", "standard", "premium"].flatMap((y) => {
|
|
3175
|
+
const O = k.filter((P) => P.tier === y);
|
|
3176
|
+
return O.length ? [
|
|
3177
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": y, children: y.charAt(0).toUpperCase() + y.slice(1) }, `lbl-${y}`),
|
|
3178
|
+
...O.map(L)
|
|
3179
3179
|
] : [];
|
|
3180
|
-
}),
|
|
3181
|
-
o &&
|
|
3180
|
+
}), W = u && /* @__PURE__ */ e.jsxs("div", { ref: f, className: `ds-model-picker__menu ds-model-picker__menu--${g} ds-scrollable`, "data-ds-portal": "", style: _, children: [
|
|
3181
|
+
o && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3182
3182
|
/* @__PURE__ */ e.jsxs(
|
|
3183
3183
|
"button",
|
|
3184
3184
|
{
|
|
@@ -3188,16 +3188,16 @@ function zn({
|
|
|
3188
3188
|
"ds-model-picker__item--auto",
|
|
3189
3189
|
s === "auto" && "ds-model-picker__item--active"
|
|
3190
3190
|
].filter(Boolean).join(" "),
|
|
3191
|
-
onClick: () =>
|
|
3191
|
+
onClick: () => I("auto"),
|
|
3192
3192
|
children: [
|
|
3193
|
-
/* @__PURE__ */ e.jsx(
|
|
3193
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: /* @__PURE__ */ e.jsx(St, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3194
3194
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
3195
3195
|
]
|
|
3196
3196
|
}
|
|
3197
3197
|
),
|
|
3198
|
-
|
|
3198
|
+
k.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
3199
3199
|
] }),
|
|
3200
|
-
|
|
3200
|
+
F()
|
|
3201
3201
|
] });
|
|
3202
3202
|
return /* @__PURE__ */ e.jsxs(
|
|
3203
3203
|
"div",
|
|
@@ -3211,18 +3211,18 @@ function zn({
|
|
|
3211
3211
|
{
|
|
3212
3212
|
ref: h,
|
|
3213
3213
|
type: "button",
|
|
3214
|
-
className:
|
|
3215
|
-
onClick: () => d((
|
|
3214
|
+
className: `ds-model-picker__trigger ds-model-picker__trigger--${g}`,
|
|
3215
|
+
onClick: () => d((y) => !y),
|
|
3216
3216
|
"aria-haspopup": "listbox",
|
|
3217
3217
|
"aria-expanded": u,
|
|
3218
3218
|
children: [
|
|
3219
|
-
|
|
3220
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (
|
|
3221
|
-
|
|
3219
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__icon", children: (b == null ? void 0 : b.icon) || /* @__PURE__ */ e.jsx(Ke, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3220
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (b == null ? void 0 : b.displayName) || (b == null ? void 0 : b.name) || s }),
|
|
3221
|
+
S && (b == null ? void 0 : b.tier) && /* @__PURE__ */ e.jsx(he, { size: "xs", variant: ot[b.tier] || "default", children: b.tier })
|
|
3222
3222
|
]
|
|
3223
3223
|
}
|
|
3224
3224
|
),
|
|
3225
|
-
typeof document < "u" && re.createPortal(
|
|
3225
|
+
typeof document < "u" && re.createPortal(W, document.body)
|
|
3226
3226
|
]
|
|
3227
3227
|
}
|
|
3228
3228
|
);
|
|
@@ -3244,53 +3244,53 @@ function Fn({
|
|
|
3244
3244
|
maxVisible: r = 5,
|
|
3245
3245
|
onSourceClick: a
|
|
3246
3246
|
}) {
|
|
3247
|
-
const o = K(), { t: i } = be(), l = n ?? o.sources, [c, u] =
|
|
3248
|
-
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className:
|
|
3247
|
+
const o = K(), { t: i } = be(), l = n ?? o.sources, [c, u] = D(!1), d = fs(t), p = d.length > r, h = c ? d : d.slice(0, r), f = t.some((j) => j.snippet), _ = (j) => j != null && j.length ? i("pageAbbrev", { pages: j.join(", ") }) : null, N = i("moreSources", { n: d.length - r }), g = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
3248
|
+
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: g, children: [
|
|
3249
3249
|
h.map((j) => {
|
|
3250
|
-
const
|
|
3250
|
+
const R = j.items.map((w) => w.page).filter(Boolean), k = _(R), b = !!a;
|
|
3251
3251
|
return /* @__PURE__ */ e.jsxs(
|
|
3252
3252
|
"div",
|
|
3253
3253
|
{
|
|
3254
|
-
className: `ds-sources-panel__compact-row${
|
|
3255
|
-
onClick:
|
|
3254
|
+
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
3255
|
+
onClick: b ? () => a(j.items[0]) : void 0,
|
|
3256
3256
|
children: [
|
|
3257
3257
|
/* @__PURE__ */ e.jsx(At, { size: q[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
3258
3258
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: j.filename }),
|
|
3259
|
-
|
|
3259
|
+
k && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: k })
|
|
3260
3260
|
]
|
|
3261
3261
|
},
|
|
3262
3262
|
j.filename
|
|
3263
3263
|
);
|
|
3264
3264
|
}),
|
|
3265
3265
|
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children: N })
|
|
3266
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
3266
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: g, children: [
|
|
3267
3267
|
l && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: l }),
|
|
3268
3268
|
h.map((j) => {
|
|
3269
|
-
const
|
|
3269
|
+
const R = j.items.map((w) => w.page).filter(Boolean), k = _(R), b = !!a;
|
|
3270
3270
|
return f ? /* @__PURE__ */ e.jsx(
|
|
3271
3271
|
He,
|
|
3272
3272
|
{
|
|
3273
|
-
title: /* @__PURE__ */ e.jsx(us, { filename: j.filename, pagesLabel:
|
|
3273
|
+
title: /* @__PURE__ */ e.jsx(us, { filename: j.filename, pagesLabel: k }),
|
|
3274
3274
|
padding: "s",
|
|
3275
|
-
children: j.items.map((
|
|
3275
|
+
children: j.items.map((w, S) => /* @__PURE__ */ e.jsx(
|
|
3276
3276
|
"div",
|
|
3277
3277
|
{
|
|
3278
|
-
className: `ds-sources-panel__snippet${
|
|
3279
|
-
onClick:
|
|
3280
|
-
children:
|
|
3278
|
+
className: `ds-sources-panel__snippet${b ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
3279
|
+
onClick: b ? () => a(w) : void 0,
|
|
3280
|
+
children: w.snippet ?? i("pageAbbrev", { pages: w.page })
|
|
3281
3281
|
},
|
|
3282
|
-
|
|
3282
|
+
S
|
|
3283
3283
|
))
|
|
3284
3284
|
},
|
|
3285
3285
|
j.filename
|
|
3286
3286
|
) : /* @__PURE__ */ e.jsxs(
|
|
3287
3287
|
"div",
|
|
3288
3288
|
{
|
|
3289
|
-
className: `ds-sources-panel__row${
|
|
3290
|
-
onClick:
|
|
3289
|
+
className: `ds-sources-panel__row${b ? " ds-sources-panel__row--clickable" : ""}`,
|
|
3290
|
+
onClick: b ? () => a(j.items[0]) : void 0,
|
|
3291
3291
|
children: [
|
|
3292
3292
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: j.filename }),
|
|
3293
|
-
|
|
3293
|
+
k && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: k })
|
|
3294
3294
|
]
|
|
3295
3295
|
},
|
|
3296
3296
|
j.filename
|
|
@@ -3612,15 +3612,15 @@ function qn({
|
|
|
3612
3612
|
statePrimary: h = "idle",
|
|
3613
3613
|
stateBack: f = "idle"
|
|
3614
3614
|
}) {
|
|
3615
|
-
const
|
|
3616
|
-
|
|
3617
|
-
const [
|
|
3618
|
-
const Y =
|
|
3619
|
-
if (!Y || !
|
|
3615
|
+
const _ = K(), { t: N } = be(), g = c ?? _.next, j = u ?? _.back, R = d ?? _.skipTour, k = p ?? _.done, b = A(null), w = A(t), S = A(s), I = A(l);
|
|
3616
|
+
w.current = t, S.current = s, I.current = l;
|
|
3617
|
+
const [L, F] = D(!1), [W, y] = D({ position: "fixed", visibility: "hidden", width: Be }), [O, P] = D("bottom"), [V, x] = D(null), $ = A(!1), T = t[s], C = s === t.length - 1, H = se(() => {
|
|
3618
|
+
const Y = w.current[S.current];
|
|
3619
|
+
if (!Y || !b.current) return;
|
|
3620
3620
|
const m = js(Y.target);
|
|
3621
3621
|
if (!m) return;
|
|
3622
|
-
const
|
|
3623
|
-
|
|
3622
|
+
const v = m.getBoundingClientRect(), U = b.current.getBoundingClientRect().height || 160, te = Be, le = I.current ? vs : bs, G = Y.position || Ns(v, U, te, le), { top: Z, left: fe, arrowOffset: je, arrowOffsetY: Se } = ws(G, v, U, te, le);
|
|
3623
|
+
P(G), y({
|
|
3624
3624
|
position: "fixed",
|
|
3625
3625
|
top: Z,
|
|
3626
3626
|
left: fe,
|
|
@@ -3628,79 +3628,79 @@ function qn({
|
|
|
3628
3628
|
visibility: "visible",
|
|
3629
3629
|
"--arrow-offset": `${je}px`,
|
|
3630
3630
|
"--arrow-offset-y": `${Se}px`
|
|
3631
|
-
}),
|
|
3632
|
-
top:
|
|
3633
|
-
left:
|
|
3634
|
-
width:
|
|
3635
|
-
height:
|
|
3631
|
+
}), x({
|
|
3632
|
+
top: v.top - Te,
|
|
3633
|
+
left: v.left - Te,
|
|
3634
|
+
width: v.width + Te * 2,
|
|
3635
|
+
height: v.height + Te * 2
|
|
3636
3636
|
});
|
|
3637
3637
|
}, []);
|
|
3638
|
-
return
|
|
3639
|
-
window.addEventListener("scroll",
|
|
3638
|
+
return z(() => {
|
|
3639
|
+
window.addEventListener("scroll", H, !0), window.addEventListener("resize", H);
|
|
3640
3640
|
const Y = requestAnimationFrame(() => {
|
|
3641
|
-
|
|
3641
|
+
H(), F(!0), $.current = !0;
|
|
3642
3642
|
});
|
|
3643
3643
|
return () => {
|
|
3644
|
-
cancelAnimationFrame(Y), window.removeEventListener("scroll",
|
|
3644
|
+
cancelAnimationFrame(Y), window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", H);
|
|
3645
3645
|
};
|
|
3646
|
-
}, []),
|
|
3646
|
+
}, []), z(() => {
|
|
3647
3647
|
if (!$.current) return;
|
|
3648
|
-
|
|
3648
|
+
F(!1);
|
|
3649
3649
|
const Y = setTimeout(() => {
|
|
3650
|
-
|
|
3651
|
-
|
|
3650
|
+
y((m) => ({ ...m, visibility: "hidden" })), requestAnimationFrame(() => {
|
|
3651
|
+
H(), F(!0);
|
|
3652
3652
|
});
|
|
3653
3653
|
}, _s + 20);
|
|
3654
3654
|
return () => clearTimeout(Y);
|
|
3655
|
-
}, [s]),
|
|
3656
|
-
|
|
3657
|
-
}, [
|
|
3655
|
+
}, [s]), z(() => {
|
|
3656
|
+
L && b.current && b.current.focus({ preventScroll: !0 });
|
|
3657
|
+
}, [L]), z(() => {
|
|
3658
3658
|
const Y = (m) => {
|
|
3659
3659
|
m.key === "Escape" && a();
|
|
3660
3660
|
};
|
|
3661
3661
|
return document.addEventListener("keydown", Y), () => document.removeEventListener("keydown", Y);
|
|
3662
|
-
}, [a]),
|
|
3663
|
-
if (!
|
|
3662
|
+
}, [a]), z(() => {
|
|
3663
|
+
if (!L) return;
|
|
3664
3664
|
const Y = (m) => {
|
|
3665
|
-
if (m.key !== "Tab" || !
|
|
3666
|
-
const
|
|
3667
|
-
|
|
3665
|
+
if (m.key !== "Tab" || !b.current) return;
|
|
3666
|
+
const v = Array.from(
|
|
3667
|
+
b.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
|
|
3668
3668
|
);
|
|
3669
|
-
if (!
|
|
3670
|
-
const B =
|
|
3671
|
-
m.shiftKey && document.activeElement === B ? (m.preventDefault(),
|
|
3669
|
+
if (!v.length) return;
|
|
3670
|
+
const B = v[0], U = v[v.length - 1];
|
|
3671
|
+
m.shiftKey && document.activeElement === B ? (m.preventDefault(), U.focus()) : !m.shiftKey && document.activeElement === U && (m.preventDefault(), B.focus());
|
|
3672
3672
|
};
|
|
3673
3673
|
return document.addEventListener("keydown", Y), () => document.removeEventListener("keydown", Y);
|
|
3674
|
-
}, [
|
|
3674
|
+
}, [L]), !T || typeof document > "u" ? null : re.createPortal(
|
|
3675
3675
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3676
|
-
|
|
3676
|
+
V && /* @__PURE__ */ e.jsx(
|
|
3677
3677
|
"div",
|
|
3678
3678
|
{
|
|
3679
3679
|
className: [
|
|
3680
3680
|
"ds-coachmark__spotlight",
|
|
3681
3681
|
i && "ds-coachmark__spotlight--overlay",
|
|
3682
3682
|
!l && "ds-coachmark__spotlight--no-ring",
|
|
3683
|
-
|
|
3683
|
+
L && "ds-coachmark__spotlight--visible"
|
|
3684
3684
|
].filter(Boolean).join(" "),
|
|
3685
|
-
style:
|
|
3685
|
+
style: V,
|
|
3686
3686
|
"aria-hidden": "true"
|
|
3687
3687
|
}
|
|
3688
3688
|
),
|
|
3689
3689
|
/* @__PURE__ */ e.jsxs(
|
|
3690
3690
|
"div",
|
|
3691
3691
|
{
|
|
3692
|
-
ref:
|
|
3692
|
+
ref: b,
|
|
3693
3693
|
"data-ds-portal": "",
|
|
3694
3694
|
role: "dialog",
|
|
3695
3695
|
"aria-modal": "false",
|
|
3696
3696
|
"aria-live": "polite",
|
|
3697
|
-
"aria-label":
|
|
3697
|
+
"aria-label": T.title ?? N("stepOf", { current: s + 1, total: t.length }),
|
|
3698
3698
|
className: [
|
|
3699
3699
|
"ds-coachmark__bubble",
|
|
3700
|
-
`ds-coachmark__bubble--${
|
|
3701
|
-
|
|
3700
|
+
`ds-coachmark__bubble--${O}`,
|
|
3701
|
+
L && "ds-coachmark__bubble--visible"
|
|
3702
3702
|
].filter(Boolean).join(" "),
|
|
3703
|
-
style:
|
|
3703
|
+
style: W,
|
|
3704
3704
|
tabIndex: -1,
|
|
3705
3705
|
children: [
|
|
3706
3706
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3709,12 +3709,12 @@ function qn({
|
|
|
3709
3709
|
type: "button",
|
|
3710
3710
|
className: "ds-coachmark__close",
|
|
3711
3711
|
onClick: a,
|
|
3712
|
-
"aria-label":
|
|
3712
|
+
"aria-label": R,
|
|
3713
3713
|
children: /* @__PURE__ */ e.jsx(ee, { size: 16, strokeWidth: 2 })
|
|
3714
3714
|
}
|
|
3715
3715
|
),
|
|
3716
|
-
|
|
3717
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children:
|
|
3716
|
+
T.title && /* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__title", children: T.title }),
|
|
3717
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children: T.content }),
|
|
3718
3718
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer", children: [
|
|
3719
3719
|
t.length > 1 && /* @__PURE__ */ e.jsxs("span", { className: "ds-coachmark__counter", children: [
|
|
3720
3720
|
s + 1,
|
|
@@ -3723,7 +3723,7 @@ function qn({
|
|
|
3723
3723
|
] }),
|
|
3724
3724
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
|
|
3725
3725
|
s > 0 && /* @__PURE__ */ e.jsx(de, { variant: "secondary", size: "s", state: f, onClick: r, children: j }),
|
|
3726
|
-
/* @__PURE__ */ e.jsx(de, { variant: "primary", size: "s", state: h, onClick:
|
|
3726
|
+
/* @__PURE__ */ e.jsx(de, { variant: "primary", size: "s", state: h, onClick: C ? o : n, children: C ? k : g })
|
|
3727
3727
|
] })
|
|
3728
3728
|
] })
|
|
3729
3729
|
]
|
|
@@ -3734,7 +3734,7 @@ function qn({
|
|
|
3734
3734
|
);
|
|
3735
3735
|
}
|
|
3736
3736
|
function Gn(t, s = {}) {
|
|
3737
|
-
const { storageKey: n } = s, [r, a] =
|
|
3737
|
+
const { storageKey: n } = s, [r, a] = D(0), [o, i] = D(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = se(() => {
|
|
3738
3738
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3739
3739
|
}, [n]);
|
|
3740
3740
|
return {
|
|
@@ -3750,7 +3750,7 @@ function Gn(t, s = {}) {
|
|
|
3750
3750
|
};
|
|
3751
3751
|
}
|
|
3752
3752
|
function Kn() {
|
|
3753
|
-
const t =
|
|
3753
|
+
const t = A(null), s = se(() => {
|
|
3754
3754
|
const n = t.current;
|
|
3755
3755
|
if (!n) return;
|
|
3756
3756
|
n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
|