@donkit-ai/design-system 1.4.69 → 1.4.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.ts +3 -19
- package/dist/index.es.js +949 -1004
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Check as Re, X as
|
|
1
|
+
import q, { useState as I, useRef as R, useEffect as P, useLayoutEffect as nt, forwardRef as Je, useCallback as le, useContext as de, createContext as Ze } from "react";
|
|
2
|
+
import { Check as Re, X as ee, ChevronDown as je, Minus as rt, Plus as at, XCircle as Se, AlertTriangle as Ae, CheckCircle as De, Info as Ie, ChevronUp as ot, ChevronsUpDown as it, ChevronLeft as lt, ChevronRight as ct, Copy as dt, Brain as ut, Loader as ft, Paperclip as ze, Square as mt, ArrowUp as pt, Zap as ht, Cpu as Fe, FileText as xt, ThumbsUp as vt, ThumbsDown as _t } from "lucide-react";
|
|
3
3
|
import me from "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const C = {
|
|
5
5
|
1: 16,
|
|
6
6
|
2: 20,
|
|
7
7
|
3: 24,
|
|
@@ -18,10 +18,10 @@ var Ee = { exports: {} }, _e = {};
|
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
|
|
21
|
+
var We;
|
|
22
|
+
function bt() {
|
|
23
|
+
if (We) return _e;
|
|
24
|
+
We = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
26
26
|
function n(r, a, o) {
|
|
27
27
|
var i = null;
|
|
@@ -50,44 +50,44 @@ var be = {};
|
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
|
-
var
|
|
54
|
-
function
|
|
55
|
-
return
|
|
53
|
+
var Ce;
|
|
54
|
+
function jt() {
|
|
55
|
+
return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function t(f) {
|
|
57
57
|
if (f == null) return null;
|
|
58
58
|
if (typeof f == "function")
|
|
59
|
-
return f.$$typeof ===
|
|
59
|
+
return f.$$typeof === F ? null : f.displayName || f.name || null;
|
|
60
60
|
if (typeof f == "string") return f;
|
|
61
61
|
switch (f) {
|
|
62
62
|
case g:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case _:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case $:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case B:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case
|
|
70
|
+
case M:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case j:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof f == "object")
|
|
76
76
|
switch (typeof f.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), f.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case b:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case
|
|
81
|
+
case y:
|
|
82
82
|
return f.displayName || "Context";
|
|
83
83
|
case N:
|
|
84
84
|
return (f._context.displayName || "Context") + ".Consumer";
|
|
85
85
|
case S:
|
|
86
86
|
var T = f.render;
|
|
87
87
|
return f = f.displayName, f || (f = T.displayName || T.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
88
|
-
case
|
|
88
|
+
case W:
|
|
89
89
|
return T = f.displayName || null, T !== null ? T : t(f.type) || "Memo";
|
|
90
|
-
case
|
|
90
|
+
case z:
|
|
91
91
|
T = f._payload, f = f._init;
|
|
92
92
|
try {
|
|
93
93
|
return t(f(T));
|
|
@@ -108,8 +108,8 @@ function Nt() {
|
|
|
108
108
|
}
|
|
109
109
|
if (T) {
|
|
110
110
|
T = console;
|
|
111
|
-
var
|
|
112
|
-
return
|
|
111
|
+
var O = T.error, Y = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
112
|
+
return O.call(
|
|
113
113
|
T,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
115
|
Y
|
|
@@ -118,7 +118,7 @@ function Nt() {
|
|
|
118
118
|
}
|
|
119
119
|
function r(f) {
|
|
120
120
|
if (f === g) return "<>";
|
|
121
|
-
if (typeof f == "object" && f !== null && f.$$typeof ===
|
|
121
|
+
if (typeof f == "object" && f !== null && f.$$typeof === z)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
124
|
var T = t(f);
|
|
@@ -142,34 +142,34 @@ function Nt() {
|
|
|
142
142
|
return f.key !== void 0;
|
|
143
143
|
}
|
|
144
144
|
function l(f, T) {
|
|
145
|
-
function
|
|
146
|
-
|
|
145
|
+
function O() {
|
|
146
|
+
k || (k = !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
|
T
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
get:
|
|
151
|
+
O.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
152
|
+
get: O,
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function c() {
|
|
157
157
|
var f = t(this.type);
|
|
158
158
|
return A[f] || (A[f] = !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
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
var
|
|
162
|
+
function d(f, T, O, Y, ne, oe) {
|
|
163
|
+
var H = O.ref;
|
|
164
164
|
return f = {
|
|
165
165
|
$$typeof: x,
|
|
166
166
|
type: f,
|
|
167
167
|
key: T,
|
|
168
|
-
props:
|
|
168
|
+
props: O,
|
|
169
169
|
_owner: Y
|
|
170
|
-
}, (
|
|
170
|
+
}, (H !== void 0 ? H : null) !== null ? Object.defineProperty(f, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
172
|
+
get: c
|
|
173
173
|
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -192,25 +192,25 @@ function Nt() {
|
|
|
192
192
|
value: oe
|
|
193
193
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
194
194
|
}
|
|
195
|
-
function u(f, T,
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
195
|
+
function u(f, T, O, Y, ne, oe) {
|
|
196
|
+
var H = T.children;
|
|
197
|
+
if (H !== void 0)
|
|
198
198
|
if (Y)
|
|
199
|
-
if (D(
|
|
200
|
-
for (Y = 0; Y <
|
|
201
|
-
p(
|
|
202
|
-
Object.freeze && Object.freeze(
|
|
199
|
+
if (D(H)) {
|
|
200
|
+
for (Y = 0; Y < H.length; Y++)
|
|
201
|
+
p(H[Y]);
|
|
202
|
+
Object.freeze && Object.freeze(H);
|
|
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
|
-
else p(
|
|
207
|
+
else p(H);
|
|
208
208
|
if (V.call(T, "key")) {
|
|
209
|
-
|
|
210
|
-
var
|
|
209
|
+
H = t(f);
|
|
210
|
+
var Q = Object.keys(T).filter(function(ge) {
|
|
211
211
|
return ge !== "key";
|
|
212
212
|
});
|
|
213
|
-
Y = 0 <
|
|
213
|
+
Y = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", E[H + Y] || (Q = 0 < Q.length ? "{" + Q.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} />
|
|
@@ -218,35 +218,35 @@ React keys must be passed directly to JSX without using spread:
|
|
|
218
218
|
let props = %s;
|
|
219
219
|
<%s key={someKey} {...props} />`,
|
|
220
220
|
Y,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
),
|
|
221
|
+
H,
|
|
222
|
+
Q,
|
|
223
|
+
H
|
|
224
|
+
), E[H + Y] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (
|
|
227
|
-
|
|
226
|
+
if (H = null, O !== void 0 && (n(O), H = "" + O), i(T) && (n(T.key), H = "" + T.key), "key" in T) {
|
|
227
|
+
O = {};
|
|
228
228
|
for (var ie in T)
|
|
229
|
-
ie !== "key" && (
|
|
230
|
-
} else
|
|
231
|
-
return
|
|
232
|
-
|
|
229
|
+
ie !== "key" && (O[ie] = T[ie]);
|
|
230
|
+
} else O = T;
|
|
231
|
+
return H && l(
|
|
232
|
+
O,
|
|
233
233
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
234
|
-
),
|
|
234
|
+
), d(
|
|
235
235
|
f,
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
H,
|
|
237
|
+
O,
|
|
238
238
|
a(),
|
|
239
239
|
ne,
|
|
240
240
|
oe
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(f) {
|
|
244
|
-
h(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof ===
|
|
244
|
+
h(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === z && (f._payload.status === "fulfilled" ? h(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(f) {
|
|
247
247
|
return typeof f == "object" && f !== null && f.$$typeof === x;
|
|
248
248
|
}
|
|
249
|
-
var m =
|
|
249
|
+
var m = q, x = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), y = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), W = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), j = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), K = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, D = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
m = {
|
|
@@ -254,36 +254,36 @@ React keys must be passed directly to JSX without using spread:
|
|
|
254
254
|
return f();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
257
|
+
var k, A = {}, U = m.react_stack_bottom_frame.bind(
|
|
258
258
|
m,
|
|
259
259
|
o
|
|
260
|
-
)(), G =
|
|
261
|
-
be.Fragment = g, be.jsx = function(f, T,
|
|
260
|
+
)(), G = v(r(o)), E = {};
|
|
261
|
+
be.Fragment = g, be.jsx = function(f, T, O) {
|
|
262
262
|
var Y = 1e4 > K.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return u(
|
|
264
264
|
f,
|
|
265
265
|
T,
|
|
266
|
-
|
|
266
|
+
O,
|
|
267
267
|
!1,
|
|
268
268
|
Y ? Error("react-stack-top-frame") : U,
|
|
269
|
-
Y ?
|
|
269
|
+
Y ? v(r(f)) : G
|
|
270
270
|
);
|
|
271
|
-
}, be.jsxs = function(f, T,
|
|
271
|
+
}, be.jsxs = function(f, T, O) {
|
|
272
272
|
var Y = 1e4 > K.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return u(
|
|
274
274
|
f,
|
|
275
275
|
T,
|
|
276
|
-
|
|
276
|
+
O,
|
|
277
277
|
!0,
|
|
278
278
|
Y ? Error("react-stack-top-frame") : U,
|
|
279
|
-
Y ?
|
|
279
|
+
Y ? v(r(f)) : G
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), be;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ? Ee.exports =
|
|
284
|
+
process.env.NODE_ENV === "production" ? Ee.exports = bt() : Ee.exports = jt();
|
|
285
285
|
var e = Ee.exports;
|
|
286
|
-
function
|
|
286
|
+
function Nt({ size: t = "m", color: s = "default", className: n = "", ...r }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
@@ -294,7 +294,7 @@ function wt({ size: t = "m", color: s = "default", className: n = "", ...r }) {
|
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
const
|
|
297
|
+
const wt = { xs: 12, s: 14, m: 16, l: 20 };
|
|
298
298
|
function ae({
|
|
299
299
|
children: t,
|
|
300
300
|
variant: s = "primary",
|
|
@@ -304,62 +304,62 @@ function ae({
|
|
|
304
304
|
disabled: o = !1,
|
|
305
305
|
state: i = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
308
|
-
href:
|
|
307
|
+
type: c = "button",
|
|
308
|
+
href: d,
|
|
309
309
|
"aria-label": u,
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const m = a && !t, x = i === "loading",
|
|
313
|
+
const m = a && !t, x = i === "loading", b = i === "success", g = i === "error", $ = x || b || g, _ = n === "xs" ? "s" : "m", N = s === "danger" ? "on-accent" : "default", y = wt[n] ?? 16, S = x ? /* @__PURE__ */ e.jsx(Nt, { size: _, color: N }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Re, { size: y, strokeWidth: 2.5 }) }) : g ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ee, { size: y, strokeWidth: 2.5 }) }) : null, B = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${s}`,
|
|
316
316
|
`ds-button--${n}`,
|
|
317
317
|
r && "ds-button--full",
|
|
318
318
|
m && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
321
|
-
|
|
320
|
+
].filter(Boolean).join(" "), M = i !== "idle" ? i : void 0, W = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
|
+
$ ? S : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
322
322
|
t
|
|
323
323
|
] });
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
324
|
+
if (d) {
|
|
325
|
+
const z = (j) => {
|
|
326
326
|
if (o || x) {
|
|
327
|
-
|
|
327
|
+
j.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
j.metaKey || j.ctrlKey || j.button === 1 || (j.preventDefault(), l == null || l(j));
|
|
331
331
|
};
|
|
332
332
|
return /* @__PURE__ */ e.jsx(
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
|
-
className:
|
|
336
|
-
href: o || x ? void 0 :
|
|
337
|
-
onClick:
|
|
335
|
+
className: B,
|
|
336
|
+
href: o || x ? void 0 : d,
|
|
337
|
+
onClick: z,
|
|
338
338
|
"aria-label": u,
|
|
339
339
|
"aria-disabled": o || x ? "true" : void 0,
|
|
340
340
|
"aria-busy": x ? "true" : void 0,
|
|
341
|
-
"data-state":
|
|
341
|
+
"data-state": M,
|
|
342
342
|
...h,
|
|
343
|
-
children:
|
|
343
|
+
children: W
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
return /* @__PURE__ */ e.jsx(
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
|
-
type:
|
|
351
|
-
className:
|
|
350
|
+
type: c,
|
|
351
|
+
className: B,
|
|
352
352
|
disabled: o,
|
|
353
353
|
onClick: x ? void 0 : l,
|
|
354
354
|
"aria-label": u,
|
|
355
355
|
"aria-busy": x ? "true" : void 0,
|
|
356
|
-
"data-state":
|
|
356
|
+
"data-state": M,
|
|
357
357
|
...h,
|
|
358
|
-
children:
|
|
358
|
+
children: W
|
|
359
359
|
}
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function cs({
|
|
363
363
|
label: t,
|
|
364
364
|
error: s,
|
|
365
365
|
hint: n,
|
|
@@ -368,12 +368,12 @@ function us({
|
|
|
368
368
|
iconRight: o,
|
|
369
369
|
onIconRightClick: i,
|
|
370
370
|
size: l = "m",
|
|
371
|
-
disabled:
|
|
372
|
-
id:
|
|
371
|
+
disabled: c,
|
|
372
|
+
id: d,
|
|
373
373
|
...u
|
|
374
374
|
}) {
|
|
375
|
-
const p =
|
|
376
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${r ? "ds-input-wrapper--full" : ""} ${
|
|
375
|
+
const p = d || `input-${q.useId()}`, h = n ? `${p}-hint` : void 0, m = s ? `${p}-error` : void 0, x = m || h;
|
|
376
|
+
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: [
|
|
377
377
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: t }),
|
|
378
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
379
379
|
a && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: a }),
|
|
@@ -382,7 +382,7 @@ function us({
|
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
384
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${o ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
|
|
385
|
-
disabled:
|
|
385
|
+
disabled: c,
|
|
386
386
|
"aria-invalid": s ? "true" : "false",
|
|
387
387
|
"aria-describedby": x,
|
|
388
388
|
...u
|
|
@@ -404,7 +404,7 @@ function us({
|
|
|
404
404
|
/* @__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: m, className: "ds-input-error", role: "alert", children: s }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function ds({
|
|
408
408
|
label: t,
|
|
409
409
|
error: s,
|
|
410
410
|
hint: n,
|
|
@@ -413,10 +413,10 @@ function fs({
|
|
|
413
413
|
disabled: o,
|
|
414
414
|
id: i,
|
|
415
415
|
resize: l = !0,
|
|
416
|
-
rows:
|
|
417
|
-
...
|
|
416
|
+
rows: c = 3,
|
|
417
|
+
...d
|
|
418
418
|
}) {
|
|
419
|
-
const u = i || `textarea-${
|
|
419
|
+
const u = i || `textarea-${q.useId()}`, p = n ? `${u}-hint` : void 0, h = s ? `${u}-error` : void 0, m = h || p;
|
|
420
420
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${r ? "ds-textarea-wrapper--full" : ""} ${o ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
421
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: u, children: t }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
@@ -427,15 +427,15 @@ function fs({
|
|
|
427
427
|
disabled: o,
|
|
428
428
|
"aria-invalid": s ? "true" : "false",
|
|
429
429
|
"aria-describedby": m,
|
|
430
|
-
rows:
|
|
431
|
-
...
|
|
430
|
+
rows: c,
|
|
431
|
+
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
434
|
n && !s && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: n }),
|
|
435
435
|
s && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: s })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function us({
|
|
439
439
|
label: t,
|
|
440
440
|
value: s,
|
|
441
441
|
onChange: n,
|
|
@@ -444,129 +444,129 @@ function ms({
|
|
|
444
444
|
error: o,
|
|
445
445
|
fullWidth: i = !0,
|
|
446
446
|
size: l = "m",
|
|
447
|
-
disabled:
|
|
448
|
-
id:
|
|
447
|
+
disabled: c = !1,
|
|
448
|
+
id: d,
|
|
449
449
|
...u
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = I(!1), [m, x] = I(!1), [
|
|
452
|
-
m || (x(!0),
|
|
451
|
+
const [p, h] = I(!1), [m, x] = I(!1), [b, g] = I({}), [$, _] = I("down"), [N, y] = I(-1), S = R(null), B = R(null), M = R(null), W = R(null), z = d || `select-${q.useId()}`, j = `${z}-label`, F = o ? `${z}-error` : void 0, K = 150, V = (E = !1) => {
|
|
452
|
+
m || (x(!0), y(-1), W.current = setTimeout(() => {
|
|
453
453
|
var f;
|
|
454
|
-
h(!1), x(!1),
|
|
454
|
+
h(!1), x(!1), E && ((f = M.current) == null || f.focus());
|
|
455
455
|
}, K));
|
|
456
|
-
}, D = (
|
|
457
|
-
clearTimeout(
|
|
458
|
-
const f =
|
|
459
|
-
|
|
456
|
+
}, D = (E) => {
|
|
457
|
+
clearTimeout(W.current), x(!1);
|
|
458
|
+
const f = E !== void 0 ? E : Math.max(r.findIndex((T) => T.value === s), 0);
|
|
459
|
+
y(f), h(!0);
|
|
460
460
|
};
|
|
461
|
-
|
|
462
|
-
const
|
|
461
|
+
P(() => () => clearTimeout(W.current), []);
|
|
462
|
+
const v = () => {
|
|
463
463
|
var oe;
|
|
464
|
-
const
|
|
465
|
-
if (
|
|
466
|
-
const f = window.innerHeight, T = f -
|
|
467
|
-
|
|
468
|
-
ne ? { bottom: f -
|
|
464
|
+
const E = (oe = S.current) == null ? void 0 : oe.getBoundingClientRect();
|
|
465
|
+
if (!E) return;
|
|
466
|
+
const f = window.innerHeight, T = f - E.bottom, O = E.top, ne = T < 300 && O > T;
|
|
467
|
+
_(ne ? "up" : "down"), g(
|
|
468
|
+
ne ? { bottom: f - E.top + 4, left: E.left, width: E.width } : { top: E.bottom + 4, left: E.left, width: E.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
471
|
-
|
|
471
|
+
P(() => {
|
|
472
472
|
if (p)
|
|
473
|
-
return
|
|
474
|
-
window.removeEventListener("scroll",
|
|
473
|
+
return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
|
|
474
|
+
window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
|
|
475
475
|
};
|
|
476
|
-
}, [p]),
|
|
477
|
-
const
|
|
478
|
-
S.current && !S.current.contains(f.target) &&
|
|
476
|
+
}, [p]), P(() => {
|
|
477
|
+
const E = (f) => {
|
|
478
|
+
S.current && !S.current.contains(f.target) && B.current && !B.current.contains(f.target) && V();
|
|
479
479
|
};
|
|
480
|
-
return document.addEventListener("mousedown",
|
|
481
|
-
}, [m]),
|
|
480
|
+
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
481
|
+
}, [m]), P(() => {
|
|
482
482
|
var f;
|
|
483
|
-
if (!p || N < 0 || !
|
|
484
|
-
(f =
|
|
483
|
+
if (!p || N < 0 || !B.current) return;
|
|
484
|
+
(f = B.current.querySelectorAll(".ds-select-option")[N]) == null || f.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [N, p]);
|
|
486
|
-
const
|
|
487
|
-
switch (
|
|
486
|
+
const k = (E) => {
|
|
487
|
+
switch (E.key) {
|
|
488
488
|
case "ArrowDown":
|
|
489
|
-
|
|
489
|
+
E.preventDefault(), p ? y((f) => Math.min(f + 1, r.length - 1)) : D();
|
|
490
490
|
break;
|
|
491
491
|
case "ArrowUp":
|
|
492
|
-
|
|
492
|
+
E.preventDefault(), p ? y((f) => Math.max(f - 1, 0)) : D(r.length - 1);
|
|
493
493
|
break;
|
|
494
494
|
case "Home":
|
|
495
|
-
p && (
|
|
495
|
+
p && (E.preventDefault(), y(0));
|
|
496
496
|
break;
|
|
497
497
|
case "End":
|
|
498
|
-
p && (
|
|
498
|
+
p && (E.preventDefault(), y(r.length - 1));
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
|
|
502
|
+
E.preventDefault(), p ? N >= 0 && (n == null || n(r[N].value), V(!0)) : D();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
|
-
p && (
|
|
505
|
+
p && (E.preventDefault(), V(!0));
|
|
506
506
|
break;
|
|
507
507
|
case "Tab":
|
|
508
508
|
p && V(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
}, A = r.find((
|
|
511
|
+
}, A = r.find((E) => E.value === s), U = l === "xs" ? C[1] : l === "small" ? C[2] : C[3], G = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
|
-
ref:
|
|
514
|
+
ref: B,
|
|
515
515
|
"data-ds-portal": "",
|
|
516
516
|
role: "listbox",
|
|
517
|
-
"aria-labelledby": t ?
|
|
517
|
+
"aria-labelledby": t ? j : void 0,
|
|
518
518
|
tabIndex: -1,
|
|
519
519
|
className: [
|
|
520
520
|
"ds-select-dropdown ds-scrollable",
|
|
521
521
|
`ds-select-dropdown--${l}`,
|
|
522
|
-
`ds-select-dropdown--${
|
|
522
|
+
`ds-select-dropdown--${$}`,
|
|
523
523
|
m && "ds-select-dropdown--closing"
|
|
524
524
|
].filter(Boolean).join(" "),
|
|
525
|
-
style:
|
|
526
|
-
children: r.map((
|
|
525
|
+
style: b,
|
|
526
|
+
children: r.map((E, f) => /* @__PURE__ */ e.jsx(
|
|
527
527
|
"button",
|
|
528
528
|
{
|
|
529
|
-
id: `${
|
|
529
|
+
id: `${z}-opt-${f}`,
|
|
530
530
|
type: "button",
|
|
531
531
|
role: "option",
|
|
532
532
|
tabIndex: -1,
|
|
533
|
-
"aria-selected": s ===
|
|
533
|
+
"aria-selected": s === E.value,
|
|
534
534
|
className: [
|
|
535
535
|
"ds-select-option",
|
|
536
536
|
`ds-select-option--${l}`,
|
|
537
|
-
s ===
|
|
537
|
+
s === E.value && "ds-select-option--selected",
|
|
538
538
|
f === N && "ds-select-option--active"
|
|
539
539
|
].filter(Boolean).join(" "),
|
|
540
540
|
onClick: () => {
|
|
541
|
-
n == null || n(
|
|
541
|
+
n == null || n(E.value), V(!0);
|
|
542
542
|
},
|
|
543
|
-
children:
|
|
543
|
+
children: E.label
|
|
544
544
|
},
|
|
545
|
-
|
|
545
|
+
E.value
|
|
546
546
|
))
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${
|
|
550
|
-
t && /* @__PURE__ */ e.jsx("label", { id:
|
|
549
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${c ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
550
|
+
t && /* @__PURE__ */ e.jsx("label", { id: j, className: "ds-select-label", children: t }),
|
|
551
551
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: S, children: /* @__PURE__ */ e.jsxs(
|
|
552
552
|
"button",
|
|
553
553
|
{
|
|
554
|
-
ref:
|
|
554
|
+
ref: M,
|
|
555
555
|
type: "button",
|
|
556
|
-
id:
|
|
556
|
+
id: z,
|
|
557
557
|
role: "combobox",
|
|
558
558
|
"aria-haspopup": "listbox",
|
|
559
559
|
"aria-expanded": p,
|
|
560
|
-
"aria-activedescendant": p && N >= 0 ? `${
|
|
561
|
-
"aria-labelledby": t ?
|
|
560
|
+
"aria-activedescendant": p && N >= 0 ? `${z}-opt-${N}` : void 0,
|
|
561
|
+
"aria-labelledby": t ? j : void 0,
|
|
562
562
|
"aria-invalid": o ? "true" : "false",
|
|
563
|
-
"aria-describedby":
|
|
563
|
+
"aria-describedby": F,
|
|
564
564
|
className: `ds-select-trigger ds-select-trigger--${l} ${o ? "ds-select-trigger--error" : ""}`,
|
|
565
565
|
onClick: () => {
|
|
566
|
-
|
|
566
|
+
c || (p ? V() : D());
|
|
567
567
|
},
|
|
568
|
-
onKeyDown:
|
|
569
|
-
disabled:
|
|
568
|
+
onKeyDown: k,
|
|
569
|
+
disabled: c,
|
|
570
570
|
...u,
|
|
571
571
|
children: [
|
|
572
572
|
/* @__PURE__ */ e.jsx("span", { className: A ? "" : "ds-select-placeholder", children: (A == null ? void 0 : A.label) || a }),
|
|
@@ -575,18 +575,18 @@ function ms({
|
|
|
575
575
|
{
|
|
576
576
|
size: U,
|
|
577
577
|
strokeWidth: 1.5,
|
|
578
|
-
className: `ds-select-icon ${p &&
|
|
578
|
+
className: `ds-select-icon ${p && $ === "down" ? "ds-select-icon--open" : ""} ${p && $ === "up" ? "ds-select-icon--up" : ""}`,
|
|
579
579
|
"aria-hidden": "true"
|
|
580
580
|
}
|
|
581
581
|
)
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
) }),
|
|
585
|
-
o && /* @__PURE__ */ e.jsx("span", { id:
|
|
585
|
+
o && /* @__PURE__ */ e.jsx("span", { id: F, className: "ds-select-error", role: "alert", children: o }),
|
|
586
586
|
typeof document < "u" && me.createPortal(G, document.body)
|
|
587
587
|
] });
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function fs({
|
|
590
590
|
label: t,
|
|
591
591
|
value: s = 0,
|
|
592
592
|
onChange: n,
|
|
@@ -595,42 +595,42 @@ function ps({
|
|
|
595
595
|
step: o = 1,
|
|
596
596
|
size: i = "m",
|
|
597
597
|
disabled: l = !1,
|
|
598
|
-
hint:
|
|
599
|
-
error:
|
|
598
|
+
hint: c,
|
|
599
|
+
error: d,
|
|
600
600
|
...u
|
|
601
601
|
}) {
|
|
602
602
|
const p = () => {
|
|
603
603
|
if (l) return;
|
|
604
|
-
const
|
|
605
|
-
n == null || n(
|
|
604
|
+
const $ = Math.min(Number(s) + o, a);
|
|
605
|
+
n == null || n($);
|
|
606
606
|
}, h = () => {
|
|
607
607
|
if (l) return;
|
|
608
|
-
const
|
|
609
|
-
n == null || n(
|
|
610
|
-
}, m = (
|
|
608
|
+
const $ = Math.max(Number(s) - o, r);
|
|
609
|
+
n == null || n($);
|
|
610
|
+
}, m = ($) => {
|
|
611
611
|
if (l) return;
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
612
|
+
const _ = $.target.value;
|
|
613
|
+
if (_ === "") {
|
|
614
614
|
n == null || n(r);
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
|
-
const N = Number(
|
|
617
|
+
const N = Number(_);
|
|
618
618
|
if (!isNaN(N)) {
|
|
619
|
-
const
|
|
620
|
-
n == null || n(
|
|
619
|
+
const y = Math.min(Math.max(N, r), a);
|
|
620
|
+
n == null || n(y);
|
|
621
621
|
}
|
|
622
622
|
}, x = [
|
|
623
623
|
"ds-stepper-wrapper",
|
|
624
624
|
l && "ds-stepper-wrapper--disabled",
|
|
625
|
-
|
|
626
|
-
].filter(Boolean).join(" "),
|
|
625
|
+
d && "ds-stepper-wrapper--error"
|
|
626
|
+
].filter(Boolean).join(" "), b = [
|
|
627
627
|
"ds-stepper",
|
|
628
628
|
`ds-stepper--${i}`,
|
|
629
629
|
l && "ds-stepper--disabled"
|
|
630
|
-
].filter(Boolean).join(" "), g = i === "xs" ?
|
|
630
|
+
].filter(Boolean).join(" "), g = i === "xs" ? C[1] : i === "small" ? C[2] : C[3];
|
|
631
631
|
return /* @__PURE__ */ e.jsxs("div", { className: x, children: [
|
|
632
632
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
633
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
633
|
+
/* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
634
634
|
/* @__PURE__ */ e.jsx(
|
|
635
635
|
"button",
|
|
636
636
|
{
|
|
@@ -639,7 +639,7 @@ function ps({
|
|
|
639
639
|
onClick: h,
|
|
640
640
|
disabled: l || s <= r,
|
|
641
641
|
"aria-label": "Decrease",
|
|
642
|
-
children: /* @__PURE__ */ e.jsx(
|
|
642
|
+
children: /* @__PURE__ */ e.jsx(rt, { size: g, strokeWidth: 1.5 })
|
|
643
643
|
}
|
|
644
644
|
),
|
|
645
645
|
/* @__PURE__ */ e.jsx(
|
|
@@ -664,15 +664,15 @@ function ps({
|
|
|
664
664
|
onClick: p,
|
|
665
665
|
disabled: l || s >= a,
|
|
666
666
|
"aria-label": "Increase",
|
|
667
|
-
children: /* @__PURE__ */ e.jsx(
|
|
667
|
+
children: /* @__PURE__ */ e.jsx(at, { size: g, strokeWidth: 1.5 })
|
|
668
668
|
}
|
|
669
669
|
)
|
|
670
670
|
] }),
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
c && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: c }),
|
|
672
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
673
673
|
] });
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ms({
|
|
676
676
|
children: t,
|
|
677
677
|
padding: s = "m",
|
|
678
678
|
variant: n = "info",
|
|
@@ -683,10 +683,10 @@ function hs({
|
|
|
683
683
|
disabled: i = !1,
|
|
684
684
|
...l
|
|
685
685
|
}) {
|
|
686
|
-
const
|
|
686
|
+
const d = (r ? "interactive" : n) === "interactive" || a || o, u = [
|
|
687
687
|
"ds-card",
|
|
688
688
|
`ds-card--${s}`,
|
|
689
|
-
|
|
689
|
+
d && "ds-card--interactive"
|
|
690
690
|
].filter(Boolean).join(" ");
|
|
691
691
|
if (o) {
|
|
692
692
|
const m = (x) => {
|
|
@@ -708,7 +708,7 @@ function hs({
|
|
|
708
708
|
}
|
|
709
709
|
);
|
|
710
710
|
}
|
|
711
|
-
const p =
|
|
711
|
+
const p = d && a ? "button" : "div", h = d && a ? {
|
|
712
712
|
type: "button",
|
|
713
713
|
onClick: a,
|
|
714
714
|
disabled: i
|
|
@@ -717,29 +717,29 @@ function hs({
|
|
|
717
717
|
p,
|
|
718
718
|
{
|
|
719
719
|
className: u,
|
|
720
|
-
role:
|
|
720
|
+
role: d && !a ? "article" : void 0,
|
|
721
721
|
...h,
|
|
722
722
|
...l,
|
|
723
723
|
children: t
|
|
724
724
|
}
|
|
725
725
|
);
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function ps({ children: t, ...s }) {
|
|
728
728
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...s, children: t });
|
|
729
729
|
}
|
|
730
|
-
function
|
|
730
|
+
function hs({ children: t, ...s }) {
|
|
731
731
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...s, children: t });
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function xs({ children: t, ...s }) {
|
|
734
734
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...s, children: t });
|
|
735
735
|
}
|
|
736
|
-
function
|
|
736
|
+
function vs({ children: t, ...s }) {
|
|
737
737
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...s, children: t });
|
|
738
738
|
}
|
|
739
|
-
function
|
|
739
|
+
function _s({ children: t, secondary: s = !1, ...n }) {
|
|
740
740
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${s ? "ds-p1--secondary" : ""}`, ...n, children: t });
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function gt({ children: t, secondary: s = !1, ...n }) {
|
|
743
743
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${s ? "ds-p2--secondary" : ""}`, ...n, children: t });
|
|
744
744
|
}
|
|
745
745
|
function Qe({ children: t, secondary: s = !1, ...n }) {
|
|
@@ -759,12 +759,12 @@ function fe({
|
|
|
759
759
|
].filter(Boolean).join(" "), i = r || (["info", "success", "warning", "error"].includes(s) ? "status" : void 0);
|
|
760
760
|
return /* @__PURE__ */ e.jsx("span", { className: o, role: i, ...a, children: t });
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
info:
|
|
764
|
-
success:
|
|
762
|
+
const yt = {
|
|
763
|
+
info: Ie,
|
|
764
|
+
success: De,
|
|
765
765
|
warning: Ae,
|
|
766
766
|
error: Se
|
|
767
|
-
},
|
|
767
|
+
}, bs = q.forwardRef(function({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: n = "info",
|
|
770
770
|
title: r,
|
|
@@ -772,9 +772,9 @@ const kt = {
|
|
|
772
772
|
role: o,
|
|
773
773
|
...i
|
|
774
774
|
}, l) {
|
|
775
|
-
const
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: `ds-alert ds-alert--${n} ${r ? "" : "ds-alert--no-title"}`, role:
|
|
777
|
-
|
|
775
|
+
const c = yt[n], d = o || (n === "error" ? "alert" : "status");
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: `ds-alert ds-alert--${n} ${r ? "" : "ds-alert--no-title"}`, role: d, ...i, children: [
|
|
777
|
+
c && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(c, { size: C[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
779
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
@@ -786,12 +786,12 @@ const kt = {
|
|
|
786
786
|
className: "ds-alert__close",
|
|
787
787
|
onClick: a,
|
|
788
788
|
"aria-label": "Close alert",
|
|
789
|
-
children: /* @__PURE__ */ e.jsx(
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: C[3], strokeWidth: 1.5 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
793
|
-
}),
|
|
794
|
-
function
|
|
793
|
+
}), kt = 200;
|
|
794
|
+
function js({
|
|
795
795
|
children: t,
|
|
796
796
|
title: s,
|
|
797
797
|
onClose: n,
|
|
@@ -800,32 +800,32 @@ function ws({
|
|
|
800
800
|
subHeader: o,
|
|
801
801
|
...i
|
|
802
802
|
}) {
|
|
803
|
-
const l = R(null),
|
|
804
|
-
!n ||
|
|
803
|
+
const l = R(null), c = q.useId(), [d, u] = I(!1), p = () => {
|
|
804
|
+
!n || d || (u(!0), setTimeout(() => {
|
|
805
805
|
u(!1), n();
|
|
806
|
-
},
|
|
806
|
+
}, kt));
|
|
807
807
|
};
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
}, g = (
|
|
812
|
-
var N,
|
|
813
|
-
const
|
|
814
|
-
l.current && !l.current.contains(
|
|
808
|
+
P(() => {
|
|
809
|
+
const b = ($) => {
|
|
810
|
+
$.key === "Escape" && p();
|
|
811
|
+
}, g = ($) => {
|
|
812
|
+
var N, y, S;
|
|
813
|
+
const _ = ((y = (N = $.composedPath) == null ? void 0 : N.call($)) == null ? void 0 : y[0]) ?? $.target;
|
|
814
|
+
l.current && !l.current.contains(_) && !((S = _.closest) != null && S.call(_, "[data-ds-portal]")) && p();
|
|
815
815
|
};
|
|
816
|
-
return document.addEventListener("keydown",
|
|
817
|
-
document.removeEventListener("keydown",
|
|
816
|
+
return document.addEventListener("keydown", b), document.addEventListener("mousedown", g), () => {
|
|
817
|
+
document.removeEventListener("keydown", b), document.removeEventListener("mousedown", g);
|
|
818
818
|
};
|
|
819
|
-
}, [n,
|
|
820
|
-
const h =
|
|
821
|
-
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay",
|
|
819
|
+
}, [n, d]);
|
|
820
|
+
const h = q.Children.toArray(t), m = h.find((b) => (b == null ? void 0 : b.type) === he), x = h.filter((b) => (b == null ? void 0 : b.type) !== he);
|
|
821
|
+
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
824
|
className: [`ds-modal ds-modal--${r}`, a && "ds-modal--scrollable"].filter(Boolean).join(" "),
|
|
825
825
|
ref: l,
|
|
826
826
|
role: "dialog",
|
|
827
827
|
"aria-modal": "true",
|
|
828
|
-
"aria-labelledby": s ?
|
|
828
|
+
"aria-labelledby": s ? c : void 0,
|
|
829
829
|
children: [
|
|
830
830
|
n && /* @__PURE__ */ e.jsx(
|
|
831
831
|
ae,
|
|
@@ -833,13 +833,13 @@ function ws({
|
|
|
833
833
|
className: "ds-modal__close",
|
|
834
834
|
variant: "ghost",
|
|
835
835
|
size: "small",
|
|
836
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
836
|
+
icon: /* @__PURE__ */ e.jsx(ee, { size: C[2], strokeWidth: 1.5 }),
|
|
837
837
|
onClick: p,
|
|
838
838
|
"aria-label": "Close modal"
|
|
839
839
|
}
|
|
840
840
|
),
|
|
841
841
|
(s || o) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
842
|
-
s && /* @__PURE__ */ e.jsx("h3", { id:
|
|
842
|
+
s && /* @__PURE__ */ e.jsx("h3", { id: c, className: "ds-modal__title", children: s }),
|
|
843
843
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: o })
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: x }),
|
|
@@ -849,34 +849,34 @@ function ws({
|
|
|
849
849
|
) });
|
|
850
850
|
}
|
|
851
851
|
function he({ children: t }) {
|
|
852
|
-
return !t ||
|
|
852
|
+
return !t || q.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
|
|
853
853
|
}
|
|
854
|
-
const
|
|
855
|
-
function
|
|
854
|
+
const Et = 320;
|
|
855
|
+
function Ns({
|
|
856
856
|
children: t,
|
|
857
857
|
title: s,
|
|
858
858
|
onClose: n,
|
|
859
859
|
subHeader: r,
|
|
860
860
|
...a
|
|
861
861
|
}) {
|
|
862
|
-
const o = R(null), i =
|
|
863
|
-
!n || l || (
|
|
864
|
-
|
|
865
|
-
},
|
|
862
|
+
const o = R(null), i = q.useId(), [l, c] = I(!1), d = () => {
|
|
863
|
+
!n || l || (c(!0), setTimeout(() => {
|
|
864
|
+
c(!1), n();
|
|
865
|
+
}, Et));
|
|
866
866
|
};
|
|
867
|
-
|
|
868
|
-
const m = (
|
|
869
|
-
|
|
870
|
-
}, x = (
|
|
871
|
-
var
|
|
872
|
-
const g = ((
|
|
873
|
-
o.current && !o.current.contains(g) && !((N = g.closest) != null && N.call(g, "[data-ds-portal]")) &&
|
|
867
|
+
P(() => {
|
|
868
|
+
const m = (b) => {
|
|
869
|
+
b.key === "Escape" && d();
|
|
870
|
+
}, x = (b) => {
|
|
871
|
+
var $, _, N;
|
|
872
|
+
const g = ((_ = ($ = b.composedPath) == null ? void 0 : $.call(b)) == null ? void 0 : _[0]) ?? b.target;
|
|
873
|
+
o.current && !o.current.contains(g) && !((N = g.closest) != null && N.call(g, "[data-ds-portal]")) && d();
|
|
874
874
|
};
|
|
875
875
|
return document.addEventListener("keydown", m), document.addEventListener("mousedown", x), () => {
|
|
876
876
|
document.removeEventListener("keydown", m), document.removeEventListener("mousedown", x);
|
|
877
877
|
};
|
|
878
878
|
}, [n, l]);
|
|
879
|
-
const u =
|
|
879
|
+
const u = q.Children.toArray(t), p = u.find((m) => (m == null ? void 0 : m.type) === he), h = u.filter((m) => (m == null ? void 0 : m.type) !== he);
|
|
880
880
|
return /* @__PURE__ */ e.jsx(
|
|
881
881
|
"div",
|
|
882
882
|
{
|
|
@@ -898,8 +898,8 @@ function gs({
|
|
|
898
898
|
className: "ds-bottom-sheet__close",
|
|
899
899
|
variant: "ghost",
|
|
900
900
|
size: "small",
|
|
901
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
902
|
-
onClick:
|
|
901
|
+
icon: /* @__PURE__ */ e.jsx(ee, { size: C[2], strokeWidth: 1.5 }),
|
|
902
|
+
onClick: d,
|
|
903
903
|
"aria-label": "Close"
|
|
904
904
|
}
|
|
905
905
|
),
|
|
@@ -915,7 +915,7 @@ function gs({
|
|
|
915
915
|
}
|
|
916
916
|
);
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function $t({
|
|
919
919
|
children: t,
|
|
920
920
|
title: s = "Code",
|
|
921
921
|
defaultExpanded: n = !1,
|
|
@@ -925,8 +925,8 @@ function Tt({
|
|
|
925
925
|
className: i = "",
|
|
926
926
|
...l
|
|
927
927
|
}) {
|
|
928
|
-
const [
|
|
929
|
-
u ? a == null || a(!r) :
|
|
928
|
+
const [c, d] = I(n), u = r !== void 0, p = u ? r : c, h = () => {
|
|
929
|
+
u ? a == null || a(!r) : d((x) => !x);
|
|
930
930
|
}, m = [
|
|
931
931
|
"ds-code-accordion",
|
|
932
932
|
`ds-code-accordion--${o}`,
|
|
@@ -946,7 +946,7 @@ function Tt({
|
|
|
946
946
|
/* @__PURE__ */ e.jsx(
|
|
947
947
|
je,
|
|
948
948
|
{
|
|
949
|
-
size:
|
|
949
|
+
size: C[2],
|
|
950
950
|
strokeWidth: 1.5,
|
|
951
951
|
className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
|
|
952
952
|
}
|
|
@@ -957,10 +957,10 @@ function Tt({
|
|
|
957
957
|
/* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__inner", children: /* @__PURE__ */ e.jsx("pre", { className: "ds-code-accordion__pre ds-scrollable", children: /* @__PURE__ */ e.jsx("code", { children: t }) }) }) })
|
|
958
958
|
] });
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
return s ? n ? /* @__PURE__ */ e.jsx(
|
|
960
|
+
function ws({ children: t, block: s = !1, collapsible: n = !1, title: r = "Code", defaultExpanded: a = !1, ...o }) {
|
|
961
|
+
return s ? n ? /* @__PURE__ */ e.jsx($t, { title: r, defaultExpanded: a, ...o, children: t }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...o, children: /* @__PURE__ */ e.jsx("code", { children: t }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...o, children: t });
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function gs({ href: t, children: s, onClick: n, target: r, rel: a, ...o }) {
|
|
964
964
|
const l = r === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
965
965
|
return /* @__PURE__ */ e.jsx(
|
|
966
966
|
"a",
|
|
@@ -975,16 +975,16 @@ function ks({ href: t, children: s, onClick: n, target: r, rel: a, ...o }) {
|
|
|
975
975
|
}
|
|
976
976
|
);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...r, children:
|
|
978
|
+
function ys({ children: t, size: s = "m", variant: n = "ghost", ...r }) {
|
|
979
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...r, children: q.Children.map(t, (a) => q.isValidElement(a) ? q.cloneElement(a, { size: s, variant: n }) : a) });
|
|
980
980
|
}
|
|
981
|
-
function
|
|
982
|
-
const
|
|
981
|
+
function ks({ children: t, selected: s = !1, onClick: n, size: r = "m", variant: a = "ghost", disabled: o = !1, icon: i, href: l, ...c }) {
|
|
982
|
+
const d = i && !t, u = [
|
|
983
983
|
"ds-tab",
|
|
984
984
|
`ds-tab--${r}`,
|
|
985
985
|
`ds-tab--${a}`,
|
|
986
986
|
s && "ds-tab--selected",
|
|
987
|
-
|
|
987
|
+
d && "ds-tab--icon-only"
|
|
988
988
|
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
989
989
|
i && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: i }),
|
|
990
990
|
t
|
|
@@ -1006,7 +1006,7 @@ function $s({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
|
|
|
1006
1006
|
className: u,
|
|
1007
1007
|
href: o ? void 0 : l,
|
|
1008
1008
|
onClick: h,
|
|
1009
|
-
...
|
|
1009
|
+
...c,
|
|
1010
1010
|
children: p
|
|
1011
1011
|
}
|
|
1012
1012
|
);
|
|
@@ -1019,32 +1019,32 @@ function $s({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
|
|
|
1019
1019
|
className: u,
|
|
1020
1020
|
onClick: n,
|
|
1021
1021
|
disabled: o,
|
|
1022
|
-
...
|
|
1022
|
+
...c,
|
|
1023
1023
|
children: p
|
|
1024
1024
|
}
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const o = R(null), i = R(null), [l,
|
|
1027
|
+
function Es({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1 }) {
|
|
1028
|
+
const o = R(null), i = R(null), [l, c] = I(!1), d = R(!1), u = R(null), p = R(null), h = () => {
|
|
1029
1029
|
if (!o.current) return;
|
|
1030
1030
|
const m = o.current.querySelector(`[data-value="${s}"]`);
|
|
1031
1031
|
if (!m) return;
|
|
1032
|
-
const x = o.current.getBoundingClientRect(),
|
|
1033
|
-
i.current ? (i.current.style.transition =
|
|
1032
|
+
const x = o.current.getBoundingClientRect(), b = m.getBoundingClientRect(), g = b.left - x.left, $ = b.width;
|
|
1033
|
+
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = g + "px", i.current.style.width = $ + "px", d.current = !1) : (c(!0), requestAnimationFrame(() => {
|
|
1034
1034
|
if (!i.current || !o.current) return;
|
|
1035
|
-
const
|
|
1036
|
-
if (!
|
|
1037
|
-
const N = o.current.getBoundingClientRect(),
|
|
1038
|
-
i.current.style.transition = "none", i.current.style.left =
|
|
1035
|
+
const _ = o.current.querySelector(`[data-value="${s}"]`);
|
|
1036
|
+
if (!_) return;
|
|
1037
|
+
const N = o.current.getBoundingClientRect(), y = _.getBoundingClientRect();
|
|
1038
|
+
i.current.style.transition = "none", i.current.style.left = y.left - N.left + "px", i.current.style.width = y.width + "px";
|
|
1039
1039
|
}));
|
|
1040
1040
|
};
|
|
1041
1041
|
return p.current = h, nt(() => {
|
|
1042
1042
|
const m = u.current !== s;
|
|
1043
|
-
u.current = s,
|
|
1044
|
-
}),
|
|
1043
|
+
u.current = s, d.current = l && m, h();
|
|
1044
|
+
}), P(() => {
|
|
1045
1045
|
if (!o.current) return;
|
|
1046
1046
|
const m = new ResizeObserver(() => {
|
|
1047
|
-
|
|
1047
|
+
d.current = !1, p.current();
|
|
1048
1048
|
});
|
|
1049
1049
|
return m.observe(o.current), () => m.disconnect();
|
|
1050
1050
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
@@ -1095,8 +1095,8 @@ function Be({
|
|
|
1095
1095
|
padding: o = "m",
|
|
1096
1096
|
...i
|
|
1097
1097
|
}) {
|
|
1098
|
-
const [l,
|
|
1099
|
-
|
|
1098
|
+
const [l, c] = I(n), d = r !== void 0, u = d ? r : l, p = () => {
|
|
1099
|
+
d ? a == null || a(!r) : c((m) => !m);
|
|
1100
1100
|
}, h = [
|
|
1101
1101
|
"ds-accordion",
|
|
1102
1102
|
`ds-accordion--${o}`,
|
|
@@ -1115,7 +1115,7 @@ function Be({
|
|
|
1115
1115
|
/* @__PURE__ */ e.jsx(
|
|
1116
1116
|
je,
|
|
1117
1117
|
{
|
|
1118
|
-
size:
|
|
1118
|
+
size: C[2],
|
|
1119
1119
|
strokeWidth: 1.5,
|
|
1120
1120
|
className: `ds-accordion__icon ${u ? "ds-accordion__icon--expanded" : ""}`
|
|
1121
1121
|
}
|
|
@@ -1127,7 +1127,7 @@ function Be({
|
|
|
1127
1127
|
] });
|
|
1128
1128
|
}
|
|
1129
1129
|
const re = 8, pe = 8;
|
|
1130
|
-
function
|
|
1130
|
+
function Tt(t, s, n) {
|
|
1131
1131
|
const r = window.innerWidth;
|
|
1132
1132
|
let a, o;
|
|
1133
1133
|
switch (t) {
|
|
@@ -1149,7 +1149,7 @@ function Rt(t, s, n) {
|
|
|
1149
1149
|
const i = Math.max(pe, Math.min(r - n.width - pe, o)), l = o - i;
|
|
1150
1150
|
return { top: a, left: i, arrowOffset: l };
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function Rt(t, s, n) {
|
|
1153
1153
|
const r = window.innerWidth, a = window.innerHeight;
|
|
1154
1154
|
if (t.top >= s + re + pe) return "top";
|
|
1155
1155
|
if (a - t.bottom >= s + re + pe) return "bottom";
|
|
@@ -1159,37 +1159,37 @@ function St(t, s, n) {
|
|
|
1159
1159
|
return o === t.top ? "top" : o === a - t.bottom ? "bottom" : o === r - t.right ? "right" : "left";
|
|
1160
1160
|
}
|
|
1161
1161
|
function Le({ children: t, content: s, position: n, ...r }) {
|
|
1162
|
-
const [a, o] = I(!1), [i, l] = I({ visibility: "hidden" }), [
|
|
1162
|
+
const [a, o] = I(!1), [i, l] = I({ visibility: "hidden" }), [c, d] = I(n || "top"), u = R(null), p = R(null), h = R(!1), m = () => {
|
|
1163
1163
|
if (!u.current || !p.current) return;
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1164
|
+
const b = u.current.getBoundingClientRect(), g = p.current.getBoundingClientRect(), $ = n || Rt(b, g.height, g.width), { top: _, left: N, arrowOffset: y } = Tt($, b, g);
|
|
1165
|
+
d($), l({
|
|
1166
1166
|
position: "fixed",
|
|
1167
|
-
top:
|
|
1167
|
+
top: _,
|
|
1168
1168
|
left: N,
|
|
1169
1169
|
visibility: "visible",
|
|
1170
|
-
"--arrow-offset": `${
|
|
1170
|
+
"--arrow-offset": `${y}px`
|
|
1171
1171
|
});
|
|
1172
1172
|
};
|
|
1173
|
-
if (
|
|
1173
|
+
if (P(() => {
|
|
1174
1174
|
if (!a) return;
|
|
1175
1175
|
l({ position: "fixed", visibility: "hidden" });
|
|
1176
|
-
const
|
|
1176
|
+
const b = requestAnimationFrame(m);
|
|
1177
1177
|
return window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1178
|
-
cancelAnimationFrame(
|
|
1178
|
+
cancelAnimationFrame(b), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1179
1179
|
};
|
|
1180
|
-
}, [a, n]),
|
|
1180
|
+
}, [a, n]), P(() => {
|
|
1181
1181
|
if (!a) return;
|
|
1182
|
-
const
|
|
1182
|
+
const b = (g) => {
|
|
1183
1183
|
u.current && !u.current.contains(g.target) && o(!1);
|
|
1184
1184
|
};
|
|
1185
|
-
return document.addEventListener("touchstart",
|
|
1185
|
+
return document.addEventListener("touchstart", b), () => document.removeEventListener("touchstart", b);
|
|
1186
1186
|
}, [a]), !s) return t;
|
|
1187
1187
|
const x = a && /* @__PURE__ */ e.jsx(
|
|
1188
1188
|
"div",
|
|
1189
1189
|
{
|
|
1190
1190
|
ref: p,
|
|
1191
1191
|
"data-ds-portal": "",
|
|
1192
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1192
|
+
className: `ds-tooltip ds-tooltip--${c}`,
|
|
1193
1193
|
role: "tooltip",
|
|
1194
1194
|
style: i,
|
|
1195
1195
|
children: s
|
|
@@ -1207,7 +1207,7 @@ function Le({ children: t, content: s, position: n, ...r }) {
|
|
|
1207
1207
|
h.current || o(!1);
|
|
1208
1208
|
},
|
|
1209
1209
|
onTouchStart: () => {
|
|
1210
|
-
h.current = !0, o((
|
|
1210
|
+
h.current = !0, o((b) => !b);
|
|
1211
1211
|
},
|
|
1212
1212
|
...r,
|
|
1213
1213
|
children: [
|
|
@@ -1217,7 +1217,7 @@ function Le({ children: t, content: s, position: n, ...r }) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
);
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function $s({
|
|
1221
1221
|
checked: t = !1,
|
|
1222
1222
|
onChange: s,
|
|
1223
1223
|
size: n = "m",
|
|
@@ -1226,12 +1226,12 @@ function Rs({
|
|
|
1226
1226
|
id: o,
|
|
1227
1227
|
...i
|
|
1228
1228
|
}) {
|
|
1229
|
-
const l = o || `toggle-${
|
|
1229
|
+
const l = o || `toggle-${q.useId()}`, c = [
|
|
1230
1230
|
"ds-toggle",
|
|
1231
1231
|
`ds-toggle--${n}`,
|
|
1232
1232
|
r && "ds-toggle--disabled"
|
|
1233
1233
|
].filter(Boolean).join(" ");
|
|
1234
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1234
|
+
return /* @__PURE__ */ e.jsxs("label", { className: c, htmlFor: l, children: [
|
|
1235
1235
|
/* @__PURE__ */ e.jsx(
|
|
1236
1236
|
"input",
|
|
1237
1237
|
{
|
|
@@ -1239,7 +1239,7 @@ function Rs({
|
|
|
1239
1239
|
id: l,
|
|
1240
1240
|
className: "ds-toggle__input",
|
|
1241
1241
|
checked: t,
|
|
1242
|
-
onChange: (
|
|
1242
|
+
onChange: (d) => s == null ? void 0 : s(d.target.checked),
|
|
1243
1243
|
disabled: r,
|
|
1244
1244
|
...i
|
|
1245
1245
|
}
|
|
@@ -1248,7 +1248,7 @@ function Rs({
|
|
|
1248
1248
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
|
|
1249
1249
|
] });
|
|
1250
1250
|
}
|
|
1251
|
-
function
|
|
1251
|
+
function Ts({
|
|
1252
1252
|
checked: t = !1,
|
|
1253
1253
|
onChange: s,
|
|
1254
1254
|
size: n = "m",
|
|
@@ -1257,12 +1257,12 @@ function Ss({
|
|
|
1257
1257
|
id: o,
|
|
1258
1258
|
...i
|
|
1259
1259
|
}) {
|
|
1260
|
-
const l = o || `checkbox-${
|
|
1260
|
+
const l = o || `checkbox-${q.useId()}`, c = [
|
|
1261
1261
|
"ds-checkbox",
|
|
1262
1262
|
`ds-checkbox--${n}`,
|
|
1263
1263
|
r && "ds-checkbox--disabled"
|
|
1264
|
-
].filter(Boolean).join(" "),
|
|
1265
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1264
|
+
].filter(Boolean).join(" "), d = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1265
|
+
return /* @__PURE__ */ e.jsxs("label", { className: c, htmlFor: l, children: [
|
|
1266
1266
|
/* @__PURE__ */ e.jsx(
|
|
1267
1267
|
"input",
|
|
1268
1268
|
{
|
|
@@ -1278,7 +1278,7 @@ function Ss({
|
|
|
1278
1278
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: t && /* @__PURE__ */ e.jsx(
|
|
1279
1279
|
Re,
|
|
1280
1280
|
{
|
|
1281
|
-
size:
|
|
1281
|
+
size: d,
|
|
1282
1282
|
strokeWidth: 2.5,
|
|
1283
1283
|
className: "ds-checkbox__icon"
|
|
1284
1284
|
}
|
|
@@ -1286,7 +1286,7 @@ function Ss({
|
|
|
1286
1286
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
|
|
1287
1287
|
] });
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function Rs({
|
|
1290
1290
|
checked: t = !1,
|
|
1291
1291
|
onChange: s,
|
|
1292
1292
|
size: n = "m",
|
|
@@ -1295,33 +1295,33 @@ function As({
|
|
|
1295
1295
|
name: o,
|
|
1296
1296
|
value: i,
|
|
1297
1297
|
id: l,
|
|
1298
|
-
...
|
|
1298
|
+
...c
|
|
1299
1299
|
}) {
|
|
1300
|
-
const
|
|
1300
|
+
const d = l || `radio-${q.useId()}`, u = [
|
|
1301
1301
|
"ds-radio",
|
|
1302
1302
|
`ds-radio--${n}`,
|
|
1303
1303
|
r && "ds-radio--disabled"
|
|
1304
1304
|
].filter(Boolean).join(" ");
|
|
1305
|
-
return /* @__PURE__ */ e.jsxs("label", { className: u, htmlFor:
|
|
1305
|
+
return /* @__PURE__ */ e.jsxs("label", { className: u, htmlFor: d, children: [
|
|
1306
1306
|
/* @__PURE__ */ e.jsx(
|
|
1307
1307
|
"input",
|
|
1308
1308
|
{
|
|
1309
1309
|
type: "radio",
|
|
1310
|
-
id:
|
|
1310
|
+
id: d,
|
|
1311
1311
|
className: "ds-radio__input",
|
|
1312
1312
|
checked: t,
|
|
1313
1313
|
onChange: (p) => s == null ? void 0 : s(p.target.checked),
|
|
1314
1314
|
disabled: r,
|
|
1315
1315
|
name: o,
|
|
1316
1316
|
value: i,
|
|
1317
|
-
...
|
|
1317
|
+
...c
|
|
1318
1318
|
}
|
|
1319
1319
|
),
|
|
1320
1320
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1321
1321
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1322
1322
|
] });
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function St({ width: t, height: s, shape: n = "rect", aspectRatio: r, className: a = "", style: o = {}, ...i }) {
|
|
1325
1325
|
return /* @__PURE__ */ e.jsx(
|
|
1326
1326
|
"span",
|
|
1327
1327
|
{
|
|
@@ -1332,7 +1332,7 @@ function At({ width: t, height: s, shape: n = "rect", aspectRatio: r, className:
|
|
|
1332
1332
|
}
|
|
1333
1333
|
);
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function At({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "", style: a = {}, ...o }) {
|
|
1336
1336
|
return /* @__PURE__ */ e.jsx(
|
|
1337
1337
|
"span",
|
|
1338
1338
|
{
|
|
@@ -1351,20 +1351,20 @@ function It({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "",
|
|
|
1351
1351
|
}
|
|
1352
1352
|
);
|
|
1353
1353
|
}
|
|
1354
|
-
|
|
1354
|
+
St.Text = At;
|
|
1355
1355
|
function Dt(t) {
|
|
1356
1356
|
let s = 2166136261;
|
|
1357
1357
|
for (let n = 0; n < t.length; n++)
|
|
1358
1358
|
s ^= t.charCodeAt(n), s = Math.imul(s, 16777619) >>> 0;
|
|
1359
1359
|
return s % 360;
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1361
|
+
function It(t) {
|
|
1362
1362
|
if (!t) return "";
|
|
1363
1363
|
const s = t.trim().split(/\s+/);
|
|
1364
1364
|
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1367
|
-
const l = Dt(t ?? ""), [
|
|
1366
|
+
function Ss({ seed: t, icon: s, src: n, size: r = 32, className: a = "", style: o = {}, ...i }) {
|
|
1367
|
+
const l = Dt(t ?? ""), [c, d] = I(!1), u = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: It(t) });
|
|
1368
1368
|
return /* @__PURE__ */ e.jsx(
|
|
1369
1369
|
"div",
|
|
1370
1370
|
{
|
|
@@ -1372,11 +1372,11 @@ function Is({ seed: t, icon: s, src: n, size: r = 32, className: a = "", style:
|
|
|
1372
1372
|
style: { width: r, height: r, "--ds-avatar-h": l, ...o },
|
|
1373
1373
|
"aria-hidden": "true",
|
|
1374
1374
|
...i,
|
|
1375
|
-
children: n && !
|
|
1375
|
+
children: n && !c ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => d(!0) }) : u
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function As({
|
|
1380
1380
|
children: t,
|
|
1381
1381
|
size: s = "compact",
|
|
1382
1382
|
stickyTop: n,
|
|
@@ -1406,13 +1406,13 @@ function Ds({
|
|
|
1406
1406
|
}
|
|
1407
1407
|
);
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1409
|
+
function Ds({ children: t, ...s }) {
|
|
1410
1410
|
return /* @__PURE__ */ e.jsx("thead", { ...s, children: t });
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Is({ children: t, ...s }) {
|
|
1413
1413
|
return /* @__PURE__ */ e.jsx("tbody", { ...s, children: t });
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Bs({ children: t, interactive: s, selected: n, subheader: r, exiting: a, updated: o, className: i = "", onClick: l, ...c }) {
|
|
1416
1416
|
return /* @__PURE__ */ e.jsx(
|
|
1417
1417
|
"tr",
|
|
1418
1418
|
{
|
|
@@ -1426,22 +1426,22 @@ function Ps({ children: t, interactive: s, selected: n, subheader: r, exiting: a
|
|
|
1426
1426
|
i
|
|
1427
1427
|
].filter(Boolean).join(" "),
|
|
1428
1428
|
onClick: l,
|
|
1429
|
-
...
|
|
1429
|
+
...c,
|
|
1430
1430
|
children: t
|
|
1431
1431
|
}
|
|
1432
1432
|
);
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1434
|
+
function Ls({ children: t, colSpan: s = 999, ...n }) {
|
|
1435
1435
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: s, children: t }) });
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
const
|
|
1437
|
+
function Ps({ children: t, align: s = "left", sortDir: n, onSort: r, width: a, className: o = "", style: i = {}, ...l }) {
|
|
1438
|
+
const c = !!r || n !== void 0, d = n === "asc" ? ot : n === "desc" ? je : it;
|
|
1439
1439
|
return /* @__PURE__ */ e.jsx(
|
|
1440
1440
|
"th",
|
|
1441
1441
|
{
|
|
1442
1442
|
className: [
|
|
1443
1443
|
"ds-th",
|
|
1444
|
-
|
|
1444
|
+
c ? "ds-th--sortable" : "",
|
|
1445
1445
|
n ? "ds-th--sorted" : "",
|
|
1446
1446
|
s !== "left" ? `ds-table-cell--${s}` : "",
|
|
1447
1447
|
o
|
|
@@ -1449,14 +1449,14 @@ function zs({ children: t, align: s = "left", sortDir: n, onSort: r, width: a, c
|
|
|
1449
1449
|
onClick: r,
|
|
1450
1450
|
style: { width: a, ...i },
|
|
1451
1451
|
...l,
|
|
1452
|
-
children:
|
|
1452
|
+
children: c ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1453
1453
|
t,
|
|
1454
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(
|
|
1454
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
|
|
1455
1455
|
] }) : t
|
|
1456
1456
|
}
|
|
1457
1457
|
);
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function Ms({ children: t, align: s = "left", secondary: n, muted: r, truncate: a, nowrap: o, className: i = "", ...l }) {
|
|
1460
1460
|
return /* @__PURE__ */ e.jsx(
|
|
1461
1461
|
"td",
|
|
1462
1462
|
{
|
|
@@ -1474,7 +1474,7 @@ function Fs({ children: t, align: s = "left", secondary: n, muted: r, truncate:
|
|
|
1474
1474
|
}
|
|
1475
1475
|
);
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function zs({
|
|
1478
1478
|
icon: t,
|
|
1479
1479
|
title: s,
|
|
1480
1480
|
description: n,
|
|
@@ -1497,7 +1497,7 @@ function Cs({
|
|
|
1497
1497
|
}
|
|
1498
1498
|
);
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function Fs({
|
|
1501
1501
|
label: t,
|
|
1502
1502
|
hint: s,
|
|
1503
1503
|
error: n,
|
|
@@ -1506,10 +1506,10 @@ function Ws({
|
|
|
1506
1506
|
htmlFor: o,
|
|
1507
1507
|
children: i,
|
|
1508
1508
|
className: l = "",
|
|
1509
|
-
style:
|
|
1510
|
-
...
|
|
1509
|
+
style: c,
|
|
1510
|
+
...d
|
|
1511
1511
|
}) {
|
|
1512
|
-
const u =
|
|
1512
|
+
const u = q.useId(), p = o ?? u, h = `${p}-hint`, m = `${p}-error`;
|
|
1513
1513
|
return /* @__PURE__ */ e.jsxs(
|
|
1514
1514
|
"div",
|
|
1515
1515
|
{
|
|
@@ -1517,8 +1517,8 @@ function Ws({
|
|
|
1517
1517
|
"data-state": n ? "error" : void 0,
|
|
1518
1518
|
"data-required": r ? "" : void 0,
|
|
1519
1519
|
"data-disabled": a ? "" : void 0,
|
|
1520
|
-
style:
|
|
1521
|
-
...
|
|
1520
|
+
style: c,
|
|
1521
|
+
...d,
|
|
1522
1522
|
children: [
|
|
1523
1523
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: t }),
|
|
1524
1524
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
|
|
@@ -1528,8 +1528,8 @@ function Ws({
|
|
|
1528
1528
|
}
|
|
1529
1529
|
);
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
const
|
|
1531
|
+
function Ws({ label: t, value: s, delta: n, size: r = "m", inline: a = !1, className: o = "", style: i, ...l }) {
|
|
1532
|
+
const c = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1533
1533
|
return /* @__PURE__ */ e.jsxs(
|
|
1534
1534
|
"div",
|
|
1535
1535
|
{
|
|
@@ -1544,12 +1544,12 @@ function Os({ label: t, value: s, delta: n, size: r = "m", inline: a = !1, class
|
|
|
1544
1544
|
children: [
|
|
1545
1545
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: t }),
|
|
1546
1546
|
s != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: s }),
|
|
1547
|
-
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${
|
|
1547
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${c}`, children: n })
|
|
1548
1548
|
]
|
|
1549
1549
|
}
|
|
1550
1550
|
);
|
|
1551
1551
|
}
|
|
1552
|
-
function
|
|
1552
|
+
function Cs({
|
|
1553
1553
|
children: t,
|
|
1554
1554
|
separator: s = "/",
|
|
1555
1555
|
"aria-label": n = "Breadcrumb",
|
|
@@ -1557,7 +1557,7 @@ function Us({
|
|
|
1557
1557
|
style: a,
|
|
1558
1558
|
...o
|
|
1559
1559
|
}) {
|
|
1560
|
-
const i =
|
|
1560
|
+
const i = q.Children.toArray(t).filter(Boolean);
|
|
1561
1561
|
return /* @__PURE__ */ e.jsx(
|
|
1562
1562
|
"nav",
|
|
1563
1563
|
{
|
|
@@ -1565,14 +1565,14 @@ function Us({
|
|
|
1565
1565
|
"aria-label": n,
|
|
1566
1566
|
style: a,
|
|
1567
1567
|
...o,
|
|
1568
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l,
|
|
1568
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l, c) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1569
1569
|
l,
|
|
1570
|
-
|
|
1571
|
-
] },
|
|
1570
|
+
c < i.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: s })
|
|
1571
|
+
] }, c)) })
|
|
1572
1572
|
}
|
|
1573
1573
|
);
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function Os({
|
|
1576
1576
|
page: t,
|
|
1577
1577
|
total: s,
|
|
1578
1578
|
onChange: n,
|
|
@@ -1582,7 +1582,7 @@ function Vs({
|
|
|
1582
1582
|
style: i,
|
|
1583
1583
|
...l
|
|
1584
1584
|
}) {
|
|
1585
|
-
const
|
|
1585
|
+
const c = Bt(t, s, r);
|
|
1586
1586
|
return /* @__PURE__ */ e.jsxs(
|
|
1587
1587
|
"nav",
|
|
1588
1588
|
{
|
|
@@ -1598,20 +1598,20 @@ function Vs({
|
|
|
1598
1598
|
onClick: () => n == null ? void 0 : n(t - 1),
|
|
1599
1599
|
disabled: t <= 1,
|
|
1600
1600
|
"aria-label": "Previous page",
|
|
1601
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1601
|
+
children: /* @__PURE__ */ e.jsx(lt, { size: 16 })
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
|
-
|
|
1605
|
-
(
|
|
1604
|
+
c.map(
|
|
1605
|
+
(d, u) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${u}`) : /* @__PURE__ */ e.jsx(
|
|
1606
1606
|
"button",
|
|
1607
1607
|
{
|
|
1608
|
-
className: `ds-pagination-page${
|
|
1609
|
-
onClick: () =>
|
|
1610
|
-
"aria-current":
|
|
1611
|
-
"aria-label": `Page ${
|
|
1612
|
-
children:
|
|
1608
|
+
className: `ds-pagination-page${d === t ? " ds-pagination-page--current" : ""}`,
|
|
1609
|
+
onClick: () => d !== t && (n == null ? void 0 : n(d)),
|
|
1610
|
+
"aria-current": d === t ? "page" : void 0,
|
|
1611
|
+
"aria-label": `Page ${d}`,
|
|
1612
|
+
children: d
|
|
1613
1613
|
},
|
|
1614
|
-
|
|
1614
|
+
d
|
|
1615
1615
|
)
|
|
1616
1616
|
),
|
|
1617
1617
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1621,121 +1621,68 @@ function Vs({
|
|
|
1621
1621
|
onClick: () => n == null ? void 0 : n(t + 1),
|
|
1622
1622
|
disabled: t >= s,
|
|
1623
1623
|
"aria-label": "Next page",
|
|
1624
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1624
|
+
children: /* @__PURE__ */ e.jsx(ct, { size: 16 })
|
|
1625
1625
|
}
|
|
1626
1626
|
)
|
|
1627
1627
|
]
|
|
1628
1628
|
}
|
|
1629
1629
|
);
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1631
|
+
function Bt(t, s, n) {
|
|
1632
1632
|
if (s <= 7) return Array.from({ length: s }, (i, l) => l + 1);
|
|
1633
1633
|
const r = Math.max(2, t - n), a = Math.min(s - 1, t + n), o = [1];
|
|
1634
1634
|
r > 2 && o.push("…");
|
|
1635
1635
|
for (let i = r; i <= a; i++) o.push(i);
|
|
1636
1636
|
return a < s - 1 && o.push("…"), o.push(s), o;
|
|
1637
1637
|
}
|
|
1638
|
-
const
|
|
1639
|
-
function
|
|
1640
|
-
children: t,
|
|
1641
|
-
title: s,
|
|
1642
|
-
onClose: n,
|
|
1643
|
-
side: r = "right",
|
|
1644
|
-
offsetLeft: a = 0,
|
|
1645
|
-
offsetRight: o = 0,
|
|
1646
|
-
...i
|
|
1647
|
-
}) {
|
|
1648
|
-
const l = R(null), d = H.useId(), [c, u] = I(!1), p = () => {
|
|
1649
|
-
!n || c || (u(!0), setTimeout(() => {
|
|
1650
|
-
u(!1), n();
|
|
1651
|
-
}, Pt));
|
|
1652
|
-
};
|
|
1653
|
-
B(() => {
|
|
1654
|
-
const v = (j) => {
|
|
1655
|
-
j.key === "Escape" && p();
|
|
1656
|
-
}, g = (j) => {
|
|
1657
|
-
var N, k, S;
|
|
1658
|
-
const b = ((k = (N = j.composedPath) == null ? void 0 : N.call(j)) == null ? void 0 : k[0]) ?? j.target;
|
|
1659
|
-
l.current && !l.current.contains(b) && !((S = b.closest) != null && S.call(b, "[data-ds-portal]")) && p();
|
|
1660
|
-
};
|
|
1661
|
-
return document.addEventListener("keydown", v), document.addEventListener("mousedown", g), () => {
|
|
1662
|
-
document.removeEventListener("keydown", v), document.removeEventListener("mousedown", g);
|
|
1663
|
-
};
|
|
1664
|
-
}, [n, c]);
|
|
1665
|
-
const h = H.Children.toArray(t), m = h.find((v) => (v == null ? void 0 : v.type) === Oe), x = h.filter((v) => (v == null ? void 0 : v.type) !== Oe);
|
|
1666
|
-
return /* @__PURE__ */ e.jsx(
|
|
1667
|
-
"div",
|
|
1668
|
-
{
|
|
1669
|
-
className: ["ds-drawer-overlay", c && "ds-drawer-overlay--closing"].filter(Boolean).join(" "),
|
|
1670
|
-
style: { "--ds-drawer-offset-left": `${a}px`, "--ds-drawer-offset-right": `${o}px` },
|
|
1671
|
-
...i,
|
|
1672
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1673
|
-
"aside",
|
|
1674
|
-
{
|
|
1675
|
-
className: ["ds-drawer", c && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1676
|
-
"data-side": r,
|
|
1677
|
-
ref: l,
|
|
1678
|
-
role: "dialog",
|
|
1679
|
-
"aria-modal": "true",
|
|
1680
|
-
"aria-labelledby": s ? d : void 0,
|
|
1681
|
-
children: [
|
|
1682
|
-
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1683
|
-
s && /* @__PURE__ */ e.jsx("h3", { id: d, className: "ds-drawer-title", children: s }),
|
|
1684
|
-
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: p, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(Q, { size: F[2], strokeWidth: 1.5 }) })
|
|
1685
|
-
] }),
|
|
1686
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children: x }),
|
|
1687
|
-
m
|
|
1688
|
-
]
|
|
1689
|
-
}
|
|
1690
|
-
)
|
|
1691
|
-
}
|
|
1692
|
-
);
|
|
1693
|
-
}
|
|
1694
|
-
function Oe({ children: t }) {
|
|
1695
|
-
return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: t });
|
|
1696
|
-
}
|
|
1697
|
-
const Mt = 320;
|
|
1698
|
-
function Hs({
|
|
1638
|
+
const Lt = 300;
|
|
1639
|
+
function Us({
|
|
1699
1640
|
children: t,
|
|
1700
1641
|
title: s,
|
|
1701
1642
|
onClose: n,
|
|
1702
1643
|
subHeader: r,
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1644
|
+
side: a = "right",
|
|
1645
|
+
size: o = "wide",
|
|
1646
|
+
offsetLeft: i = 0,
|
|
1647
|
+
offsetRight: l = 0,
|
|
1648
|
+
keepOpenRef: c,
|
|
1649
|
+
...d
|
|
1706
1650
|
}) {
|
|
1707
|
-
const
|
|
1708
|
-
!n ||
|
|
1709
|
-
|
|
1710
|
-
},
|
|
1651
|
+
const u = R(null), p = q.useId(), [h, m] = I(!1), x = () => {
|
|
1652
|
+
!n || h || (m(!0), setTimeout(() => {
|
|
1653
|
+
m(!1), n();
|
|
1654
|
+
}, Lt));
|
|
1711
1655
|
};
|
|
1712
|
-
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1715
|
-
},
|
|
1716
|
-
var
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1656
|
+
P(() => {
|
|
1657
|
+
const _ = (y) => {
|
|
1658
|
+
y.key === "Escape" && x();
|
|
1659
|
+
}, N = (y) => {
|
|
1660
|
+
var B, M, W, z;
|
|
1661
|
+
const S = ((M = (B = y.composedPath) == null ? void 0 : B.call(y)) == null ? void 0 : M[0]) ?? y.target;
|
|
1662
|
+
(W = c == null ? void 0 : c.current) != null && W.contains(S) || u.current && !u.current.contains(S) && !((z = S.closest) != null && z.call(S, "[data-ds-portal]")) && x();
|
|
1719
1663
|
};
|
|
1720
|
-
return document.addEventListener("keydown",
|
|
1721
|
-
document.removeEventListener("keydown",
|
|
1664
|
+
return document.addEventListener("keydown", _), document.addEventListener("mousedown", N), () => {
|
|
1665
|
+
document.removeEventListener("keydown", _), document.removeEventListener("mousedown", N);
|
|
1722
1666
|
};
|
|
1723
|
-
}, [n, c]);
|
|
1724
|
-
const
|
|
1667
|
+
}, [n, h, c]);
|
|
1668
|
+
const b = q.Children.toArray(t), g = b.find((_) => (_ == null ? void 0 : _.type) === Oe || (_ == null ? void 0 : _.type) === he), $ = b.filter((_) => (_ == null ? void 0 : _.type) !== Oe && (_ == null ? void 0 : _.type) !== he);
|
|
1725
1669
|
return /* @__PURE__ */ e.jsx(
|
|
1726
1670
|
"div",
|
|
1727
1671
|
{
|
|
1728
|
-
className: ["ds-side-page-overlay",
|
|
1729
|
-
|
|
1730
|
-
|
|
1672
|
+
className: ["ds-side-page-overlay", h && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
|
|
1673
|
+
"data-side": a,
|
|
1674
|
+
style: { "--ds-side-page-offset-left": `${i}px`, "--ds-side-page-offset-right": `${l}px` },
|
|
1675
|
+
...d,
|
|
1731
1676
|
children: /* @__PURE__ */ e.jsxs(
|
|
1732
1677
|
"div",
|
|
1733
1678
|
{
|
|
1734
|
-
ref:
|
|
1735
|
-
className: ["ds-side-page",
|
|
1679
|
+
ref: u,
|
|
1680
|
+
className: ["ds-side-page", h && "ds-side-page--closing"].filter(Boolean).join(" "),
|
|
1681
|
+
"data-side": a,
|
|
1682
|
+
"data-size": o,
|
|
1736
1683
|
role: "dialog",
|
|
1737
1684
|
"aria-modal": "true",
|
|
1738
|
-
"aria-labelledby": s ?
|
|
1685
|
+
"aria-labelledby": s ? p : void 0,
|
|
1739
1686
|
children: [
|
|
1740
1687
|
n && /* @__PURE__ */ e.jsx(
|
|
1741
1688
|
ae,
|
|
@@ -1743,55 +1690,55 @@ function Hs({
|
|
|
1743
1690
|
className: "ds-side-page__close",
|
|
1744
1691
|
variant: "ghost",
|
|
1745
1692
|
size: "small",
|
|
1746
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1747
|
-
onClick:
|
|
1693
|
+
icon: /* @__PURE__ */ e.jsx(ee, { size: C[2], strokeWidth: 1.5 }),
|
|
1694
|
+
onClick: x,
|
|
1748
1695
|
"aria-label": "Close"
|
|
1749
1696
|
}
|
|
1750
1697
|
),
|
|
1751
1698
|
(s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-side-page__header", children: [
|
|
1752
|
-
s && /* @__PURE__ */ e.jsx("h3", { id:
|
|
1699
|
+
s && /* @__PURE__ */ e.jsx("h3", { id: p, className: "ds-side-page__title", children: s }),
|
|
1753
1700
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
|
|
1754
1701
|
] }),
|
|
1755
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children:
|
|
1756
|
-
|
|
1702
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: $ }),
|
|
1703
|
+
g
|
|
1757
1704
|
]
|
|
1758
1705
|
}
|
|
1759
1706
|
)
|
|
1760
1707
|
}
|
|
1761
1708
|
);
|
|
1762
1709
|
}
|
|
1763
|
-
function
|
|
1764
|
-
return !t ||
|
|
1710
|
+
function Oe({ children: t }) {
|
|
1711
|
+
return !t || q.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
1765
1712
|
}
|
|
1766
|
-
const ve = Ze({ collapsed: !1, side: "left" }), we = Ze(!1)
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
const i = [
|
|
1713
|
+
const ve = Ze({ collapsed: !1, side: "left" }), we = Ze(!1), Vs = Je(function({
|
|
1714
|
+
children: s,
|
|
1715
|
+
collapsed: n = !1,
|
|
1716
|
+
side: r = "left",
|
|
1717
|
+
onExpand: a,
|
|
1718
|
+
className: o = "",
|
|
1719
|
+
...i
|
|
1720
|
+
}, l) {
|
|
1721
|
+
const c = [
|
|
1776
1722
|
"ds-nav-rail",
|
|
1777
|
-
|
|
1778
|
-
`ds-nav-rail--${
|
|
1779
|
-
|
|
1780
|
-
].filter(Boolean).join(" "),
|
|
1781
|
-
!
|
|
1782
|
-
}, [
|
|
1783
|
-
return /* @__PURE__ */ e.jsx(ve.Provider, { value: { collapsed:
|
|
1723
|
+
n && "ds-nav-rail--collapsed",
|
|
1724
|
+
`ds-nav-rail--${r}`,
|
|
1725
|
+
o
|
|
1726
|
+
].filter(Boolean).join(" "), d = le((u) => {
|
|
1727
|
+
!n || !a || u.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]') || a();
|
|
1728
|
+
}, [n, a]);
|
|
1729
|
+
return /* @__PURE__ */ e.jsx(ve.Provider, { value: { collapsed: n, side: r }, children: /* @__PURE__ */ e.jsx(
|
|
1784
1730
|
"nav",
|
|
1785
1731
|
{
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1732
|
+
ref: l,
|
|
1733
|
+
className: c,
|
|
1734
|
+
onClick: d,
|
|
1735
|
+
"data-expandable": n && a ? "" : void 0,
|
|
1736
|
+
...i,
|
|
1737
|
+
children: s
|
|
1791
1738
|
}
|
|
1792
1739
|
) });
|
|
1793
|
-
}
|
|
1794
|
-
function
|
|
1740
|
+
});
|
|
1741
|
+
function Ys({
|
|
1795
1742
|
icon: t,
|
|
1796
1743
|
label: s,
|
|
1797
1744
|
selected: n = !1,
|
|
@@ -1800,12 +1747,12 @@ function Gs({
|
|
|
1800
1747
|
onClick: o,
|
|
1801
1748
|
count: i,
|
|
1802
1749
|
updated: l = !1,
|
|
1803
|
-
open:
|
|
1804
|
-
onboarding:
|
|
1750
|
+
open: c = !1,
|
|
1751
|
+
onboarding: d = !1,
|
|
1805
1752
|
className: u = "",
|
|
1806
1753
|
...p
|
|
1807
1754
|
}) {
|
|
1808
|
-
const { collapsed: h, side: m } = de(ve), x = de(we),
|
|
1755
|
+
const { collapsed: h, side: m } = de(ve), x = de(we), $ = {
|
|
1809
1756
|
className: [
|
|
1810
1757
|
"ds-nav-rail__item",
|
|
1811
1758
|
u
|
|
@@ -1818,32 +1765,32 @@ function Gs({
|
|
|
1818
1765
|
...{
|
|
1819
1766
|
"data-selected": n || void 0,
|
|
1820
1767
|
"data-disabled": r || void 0,
|
|
1821
|
-
"data-open":
|
|
1822
|
-
"data-onboarding":
|
|
1768
|
+
"data-open": c || void 0,
|
|
1769
|
+
"data-onboarding": d || void 0
|
|
1823
1770
|
},
|
|
1824
1771
|
...p
|
|
1825
|
-
},
|
|
1772
|
+
}, _ = i != null, N = m === "left" ? "right" : "left", y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1826
1773
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1827
1774
|
!h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
|
|
1828
1775
|
!h && l && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
|
|
1829
|
-
!h &&
|
|
1776
|
+
!h && _ && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
|
|
1830
1777
|
h && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
1831
|
-
] }), S = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a,
|
|
1778
|
+
] }), S = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...$, children: y }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...$, children: y });
|
|
1832
1779
|
return h && !x ? /* @__PURE__ */ e.jsx(Le, { content: s, position: N, children: S }) : S;
|
|
1833
1780
|
}
|
|
1834
|
-
function
|
|
1781
|
+
function Hs({ children: t, className: s = "", ...n }) {
|
|
1835
1782
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__body", "ds-scrollable", s].filter(Boolean).join(" "), ...n, children: t });
|
|
1836
1783
|
}
|
|
1837
|
-
function
|
|
1784
|
+
function qs({ children: t, className: s = "", ...n }) {
|
|
1838
1785
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__header", s].filter(Boolean).join(" "), ...n, children: t });
|
|
1839
1786
|
}
|
|
1840
|
-
function
|
|
1787
|
+
function Gs({ children: t, className: s = "", ...n }) {
|
|
1841
1788
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__footer", s].filter(Boolean).join(" "), ...n, children: t });
|
|
1842
1789
|
}
|
|
1843
|
-
function
|
|
1790
|
+
function Ks({ className: t = "", ...s }) {
|
|
1844
1791
|
return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
|
|
1845
1792
|
}
|
|
1846
|
-
function
|
|
1793
|
+
function Xs({ children: t, label: s = "Recents", defaultOpen: n = !0, className: r = "", ...a }) {
|
|
1847
1794
|
const { collapsed: o } = de(ve), [i, l] = I(n);
|
|
1848
1795
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...a, children: [
|
|
1849
1796
|
!o && /* @__PURE__ */ e.jsxs(
|
|
@@ -1851,7 +1798,7 @@ function Qs({ children: t, label: s = "Recents", defaultOpen: n = !0, className:
|
|
|
1851
1798
|
{
|
|
1852
1799
|
type: "button",
|
|
1853
1800
|
className: ["ds-nav-rail__recents-toggle", !i && "ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),
|
|
1854
|
-
onClick: () => l((
|
|
1801
|
+
onClick: () => l((c) => !c),
|
|
1855
1802
|
"aria-expanded": i,
|
|
1856
1803
|
children: [
|
|
1857
1804
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__recents-label", children: s }),
|
|
@@ -1862,14 +1809,14 @@ function Qs({ children: t, label: s = "Recents", defaultOpen: n = !0, className:
|
|
|
1862
1809
|
(i || o) && /* @__PURE__ */ e.jsx("div", { className: "ds-nav-rail__recents-body", children: t })
|
|
1863
1810
|
] });
|
|
1864
1811
|
}
|
|
1865
|
-
const
|
|
1812
|
+
const Js = Je(function({
|
|
1866
1813
|
as: s = "button",
|
|
1867
1814
|
avatar: n,
|
|
1868
1815
|
label: r,
|
|
1869
1816
|
className: a = "",
|
|
1870
1817
|
...o
|
|
1871
1818
|
}, i) {
|
|
1872
|
-
const { collapsed: l, side:
|
|
1819
|
+
const { collapsed: l, side: c } = de(ve), d = de(we), u = c === "left" ? "right" : "left", p = [
|
|
1873
1820
|
"ds-nav-rail__item",
|
|
1874
1821
|
"ds-nav-rail__agent",
|
|
1875
1822
|
a
|
|
@@ -1887,10 +1834,10 @@ const en = rt(function({
|
|
|
1887
1834
|
children: h
|
|
1888
1835
|
}
|
|
1889
1836
|
);
|
|
1890
|
-
return l && !
|
|
1837
|
+
return l && !d ? /* @__PURE__ */ e.jsx(Le, { content: r, position: u, children: m }) : m;
|
|
1891
1838
|
});
|
|
1892
|
-
function
|
|
1893
|
-
const { collapsed:
|
|
1839
|
+
function Zs({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a, onClick: o, className: i = "", ...l }) {
|
|
1840
|
+
const { collapsed: c, side: d } = de(ve), u = de(we), m = {
|
|
1894
1841
|
className: [
|
|
1895
1842
|
"ds-nav-rail__item",
|
|
1896
1843
|
"ds-nav-rail__agent",
|
|
@@ -1907,12 +1854,12 @@ function tn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a,
|
|
|
1907
1854
|
...l
|
|
1908
1855
|
}, x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1909
1856
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1910
|
-
!
|
|
1911
|
-
] }),
|
|
1912
|
-
return
|
|
1857
|
+
!c && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
1858
|
+
] }), b = d === "left" ? "right" : "left", g = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...m, children: x }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...m, children: x });
|
|
1859
|
+
return c && !u ? /* @__PURE__ */ e.jsx(Le, { content: s, position: b, children: g }) : g;
|
|
1913
1860
|
}
|
|
1914
|
-
const
|
|
1915
|
-
function
|
|
1861
|
+
const Ue = 240, Ve = 6, Ye = 8;
|
|
1862
|
+
function Qs({
|
|
1916
1863
|
trigger: t,
|
|
1917
1864
|
title: s,
|
|
1918
1865
|
children: n,
|
|
@@ -1920,47 +1867,47 @@ function sn({
|
|
|
1920
1867
|
onOpenChange: a,
|
|
1921
1868
|
defaultOpen: o = !1
|
|
1922
1869
|
}) {
|
|
1923
|
-
const { side: i } = de(ve), [l,
|
|
1924
|
-
|
|
1925
|
-
}, [
|
|
1926
|
-
|
|
1927
|
-
}, [
|
|
1928
|
-
var
|
|
1929
|
-
const
|
|
1930
|
-
if (!
|
|
1931
|
-
const
|
|
1870
|
+
const { side: i } = de(ve), [l, c] = I(o), d = r !== void 0, u = d ? r : l, [p, h] = I(!1), m = R(null), x = R(null), [b, g] = I({}), $ = le(() => {
|
|
1871
|
+
d ? a == null || a(!0) : c(!0);
|
|
1872
|
+
}, [d, a]), _ = le(() => {
|
|
1873
|
+
d ? a == null || a(!1) : c(!1);
|
|
1874
|
+
}, [d, a]), N = le(() => u ? _() : $(), [u, $, _]), y = le(() => {
|
|
1875
|
+
var F;
|
|
1876
|
+
const B = m.current;
|
|
1877
|
+
if (!B) return;
|
|
1878
|
+
const M = B.getBoundingClientRect(), W = window.innerHeight, z = ((F = x.current) == null ? void 0 : F.offsetHeight) ?? 300, j = Math.max(Ye, Math.min(W - z - Ye, M.top));
|
|
1932
1879
|
g(i === "right" ? {
|
|
1933
1880
|
position: "fixed",
|
|
1934
|
-
top:
|
|
1935
|
-
right: window.innerWidth -
|
|
1936
|
-
width:
|
|
1881
|
+
top: j,
|
|
1882
|
+
right: window.innerWidth - M.left + Ve,
|
|
1883
|
+
width: Ue
|
|
1937
1884
|
} : {
|
|
1938
1885
|
position: "fixed",
|
|
1939
|
-
top:
|
|
1940
|
-
left:
|
|
1941
|
-
width:
|
|
1886
|
+
top: j,
|
|
1887
|
+
left: M.right + Ve,
|
|
1888
|
+
width: Ue
|
|
1942
1889
|
});
|
|
1943
1890
|
}, [i]);
|
|
1944
|
-
|
|
1891
|
+
P(() => {
|
|
1945
1892
|
if (!u) {
|
|
1946
1893
|
h(!1);
|
|
1947
1894
|
return;
|
|
1948
1895
|
}
|
|
1949
|
-
return
|
|
1950
|
-
window.removeEventListener("scroll",
|
|
1896
|
+
return y(), requestAnimationFrame(() => h(!0)), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
|
|
1897
|
+
window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
|
|
1951
1898
|
};
|
|
1952
|
-
}, [u,
|
|
1899
|
+
}, [u, y]), P(() => {
|
|
1953
1900
|
if (!u) return;
|
|
1954
|
-
const
|
|
1955
|
-
var
|
|
1956
|
-
!((
|
|
1957
|
-
},
|
|
1958
|
-
|
|
1901
|
+
const B = (W) => {
|
|
1902
|
+
var z, j;
|
|
1903
|
+
!((z = x.current) != null && z.contains(W.target)) && !((j = m.current) != null && j.contains(W.target)) && _();
|
|
1904
|
+
}, M = (W) => {
|
|
1905
|
+
W.key === "Escape" && _();
|
|
1959
1906
|
};
|
|
1960
|
-
return document.addEventListener("mousedown",
|
|
1961
|
-
document.removeEventListener("mousedown",
|
|
1907
|
+
return document.addEventListener("mousedown", B), document.addEventListener("keydown", M), () => {
|
|
1908
|
+
document.removeEventListener("mousedown", B), document.removeEventListener("keydown", M);
|
|
1962
1909
|
};
|
|
1963
|
-
}, [u,
|
|
1910
|
+
}, [u, _]);
|
|
1964
1911
|
const S = u && /* @__PURE__ */ e.jsxs(
|
|
1965
1912
|
"div",
|
|
1966
1913
|
{
|
|
@@ -1970,7 +1917,7 @@ function sn({
|
|
|
1970
1917
|
`ds-nav-rail-flyout--${i}`,
|
|
1971
1918
|
p && "ds-nav-rail-flyout--visible"
|
|
1972
1919
|
].filter(Boolean).join(" "),
|
|
1973
|
-
style:
|
|
1920
|
+
style: b,
|
|
1974
1921
|
"data-ds-portal": "",
|
|
1975
1922
|
role: "dialog",
|
|
1976
1923
|
"aria-modal": "false",
|
|
@@ -1982,9 +1929,9 @@ function sn({
|
|
|
1982
1929
|
{
|
|
1983
1930
|
type: "button",
|
|
1984
1931
|
className: "ds-nav-rail-flyout__close",
|
|
1985
|
-
onClick:
|
|
1932
|
+
onClick: _,
|
|
1986
1933
|
"aria-label": "Close",
|
|
1987
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1934
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: 16, strokeWidth: 2 })
|
|
1988
1935
|
}
|
|
1989
1936
|
)
|
|
1990
1937
|
] }),
|
|
@@ -1997,13 +1944,13 @@ function sn({
|
|
|
1997
1944
|
typeof document < "u" && me.createPortal(S, document.body)
|
|
1998
1945
|
] });
|
|
1999
1946
|
}
|
|
2000
|
-
const
|
|
2001
|
-
info:
|
|
2002
|
-
success:
|
|
1947
|
+
const Pt = {
|
|
1948
|
+
info: Ie,
|
|
1949
|
+
success: De,
|
|
2003
1950
|
warning: Ae,
|
|
2004
1951
|
error: Se
|
|
2005
1952
|
};
|
|
2006
|
-
function
|
|
1953
|
+
function en({
|
|
2007
1954
|
children: t,
|
|
2008
1955
|
variant: s = "info",
|
|
2009
1956
|
action: n,
|
|
@@ -2012,15 +1959,15 @@ function nn({
|
|
|
2012
1959
|
role: o,
|
|
2013
1960
|
...i
|
|
2014
1961
|
}) {
|
|
2015
|
-
const l =
|
|
1962
|
+
const l = Pt[s], c = o || (s === "error" ? "alert" : "status");
|
|
2016
1963
|
return /* @__PURE__ */ e.jsxs(
|
|
2017
1964
|
"div",
|
|
2018
1965
|
{
|
|
2019
1966
|
className: `ds-banner ds-banner--${s}`,
|
|
2020
|
-
role:
|
|
1967
|
+
role: c,
|
|
2021
1968
|
...i,
|
|
2022
1969
|
children: [
|
|
2023
|
-
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size:
|
|
1970
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: C[2], strokeWidth: 1.5 }) }),
|
|
2024
1971
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: t }),
|
|
2025
1972
|
n && /* @__PURE__ */ e.jsx(
|
|
2026
1973
|
"button",
|
|
@@ -2038,14 +1985,14 @@ function nn({
|
|
|
2038
1985
|
className: "ds-banner-dismiss",
|
|
2039
1986
|
onClick: a,
|
|
2040
1987
|
"aria-label": "Dismiss",
|
|
2041
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1988
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: C[2], strokeWidth: 1.5 })
|
|
2042
1989
|
}
|
|
2043
1990
|
)
|
|
2044
1991
|
]
|
|
2045
1992
|
}
|
|
2046
1993
|
);
|
|
2047
1994
|
}
|
|
2048
|
-
function
|
|
1995
|
+
function tn({
|
|
2049
1996
|
trigger: t,
|
|
2050
1997
|
items: s = [],
|
|
2051
1998
|
open: n,
|
|
@@ -2054,92 +2001,92 @@ function rn({
|
|
|
2054
2001
|
fullWidth: o = !1,
|
|
2055
2002
|
className: i = "",
|
|
2056
2003
|
style: l,
|
|
2057
|
-
...
|
|
2004
|
+
...c
|
|
2058
2005
|
}) {
|
|
2059
|
-
const [
|
|
2006
|
+
const [d, u] = I(!1), [p, h] = I(!1), m = n !== void 0, x = m ? n : d, b = R(null), g = R(null), $ = R(null), _ = R(null), [N, y] = I({}), S = R(null), B = 150, M = () => {
|
|
2060
2007
|
if (m)
|
|
2061
2008
|
r == null || r(!1);
|
|
2062
2009
|
else {
|
|
2063
2010
|
if (p) return;
|
|
2064
2011
|
h(!0), S.current = setTimeout(() => {
|
|
2065
2012
|
u(!1), h(!1);
|
|
2066
|
-
},
|
|
2013
|
+
}, B);
|
|
2067
2014
|
}
|
|
2068
|
-
},
|
|
2069
|
-
const
|
|
2070
|
-
m ? r == null || r(
|
|
2071
|
-
},
|
|
2015
|
+
}, W = () => {
|
|
2016
|
+
const v = !x;
|
|
2017
|
+
m ? r == null || r(v) : v ? (clearTimeout(S.current), h(!1), u(!0)) : M();
|
|
2018
|
+
}, z = () => {
|
|
2072
2019
|
x || (m ? r == null || r(!0) : (clearTimeout(S.current), h(!1), u(!0)));
|
|
2073
2020
|
};
|
|
2074
|
-
|
|
2021
|
+
P(() => () => clearTimeout(S.current), []), P(() => {
|
|
2075
2022
|
if (!x) return;
|
|
2076
|
-
const
|
|
2077
|
-
var
|
|
2078
|
-
const A = (
|
|
2023
|
+
const v = 300, k = () => {
|
|
2024
|
+
var E;
|
|
2025
|
+
const A = (E = b.current) == null ? void 0 : E.getBoundingClientRect();
|
|
2079
2026
|
if (!A) return;
|
|
2080
|
-
const U = window.innerHeight - A.bottom, G = U <
|
|
2081
|
-
|
|
2027
|
+
const U = window.innerHeight - A.bottom, G = U < v + 8 && A.top > U;
|
|
2028
|
+
y(
|
|
2082
2029
|
a === "right" ? G ? { bottom: window.innerHeight - A.top + 4, top: "auto", right: window.innerWidth - A.right } : { top: A.bottom + 4, bottom: "auto", right: window.innerWidth - A.right } : G ? { bottom: window.innerHeight - A.top + 4, top: "auto", left: A.left } : { top: A.bottom + 4, bottom: "auto", left: A.left }
|
|
2083
2030
|
);
|
|
2084
2031
|
};
|
|
2085
|
-
return
|
|
2086
|
-
window.removeEventListener("scroll",
|
|
2032
|
+
return k(), window.addEventListener("scroll", k, !0), window.addEventListener("resize", k), () => {
|
|
2033
|
+
window.removeEventListener("scroll", k, !0), window.removeEventListener("resize", k);
|
|
2087
2034
|
};
|
|
2088
2035
|
}, [x, a]);
|
|
2089
|
-
const
|
|
2090
|
-
var
|
|
2091
|
-
const
|
|
2036
|
+
const j = () => {
|
|
2037
|
+
var k;
|
|
2038
|
+
const v = (k = $.current) == null ? void 0 : k.querySelector(
|
|
2092
2039
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
2093
2040
|
);
|
|
2094
|
-
|
|
2041
|
+
v == null || v.focus();
|
|
2095
2042
|
};
|
|
2096
|
-
|
|
2043
|
+
P(() => {
|
|
2097
2044
|
if (!x) return;
|
|
2098
|
-
const
|
|
2045
|
+
const v = (A) => {
|
|
2099
2046
|
var U, G;
|
|
2100
|
-
!((U =
|
|
2101
|
-
},
|
|
2102
|
-
A.key === "Escape" && (
|
|
2047
|
+
!((U = b.current) != null && U.contains(A.target)) && !((G = g.current) != null && G.contains(A.target)) && M();
|
|
2048
|
+
}, k = (A) => {
|
|
2049
|
+
A.key === "Escape" && (M(), j());
|
|
2103
2050
|
};
|
|
2104
|
-
return document.addEventListener("mousedown",
|
|
2105
|
-
document.removeEventListener("mousedown",
|
|
2051
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", k), () => {
|
|
2052
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", k);
|
|
2106
2053
|
};
|
|
2107
|
-
}, [x]),
|
|
2108
|
-
if (!x || !
|
|
2109
|
-
const
|
|
2110
|
-
|
|
2054
|
+
}, [x]), P(() => {
|
|
2055
|
+
if (!x || !_.current || !g.current) return;
|
|
2056
|
+
const v = F(), k = _.current === "last" ? v[v.length - 1] : v[0];
|
|
2057
|
+
k == null || k.focus(), _.current = null;
|
|
2111
2058
|
}, [x]);
|
|
2112
|
-
const
|
|
2059
|
+
const F = () => g.current ? [...g.current.querySelectorAll(
|
|
2113
2060
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
2114
|
-
)] : [], K = (
|
|
2115
|
-
var
|
|
2116
|
-
if (
|
|
2117
|
-
|
|
2118
|
-
else if (
|
|
2119
|
-
if (
|
|
2120
|
-
|
|
2061
|
+
)] : [], K = (v) => {
|
|
2062
|
+
var k, A;
|
|
2063
|
+
if (v.key === "ArrowDown")
|
|
2064
|
+
v.preventDefault(), x ? (k = F()[0]) == null || k.focus() : (_.current = "first", z());
|
|
2065
|
+
else if (v.key === "ArrowUp")
|
|
2066
|
+
if (v.preventDefault(), !x)
|
|
2067
|
+
_.current = "last", z();
|
|
2121
2068
|
else {
|
|
2122
|
-
const U =
|
|
2069
|
+
const U = F();
|
|
2123
2070
|
(A = U[U.length - 1]) == null || A.focus();
|
|
2124
2071
|
}
|
|
2125
|
-
}, V = (
|
|
2126
|
-
var U, G,
|
|
2127
|
-
const
|
|
2128
|
-
switch (
|
|
2072
|
+
}, V = (v) => {
|
|
2073
|
+
var U, G, E, f;
|
|
2074
|
+
const k = F(), A = k.findIndex((T) => T === document.activeElement);
|
|
2075
|
+
switch (v.key) {
|
|
2129
2076
|
case "ArrowDown":
|
|
2130
|
-
|
|
2077
|
+
v.preventDefault(), (U = k[Math.min(A + 1, k.length - 1)]) == null || U.focus();
|
|
2131
2078
|
break;
|
|
2132
2079
|
case "ArrowUp":
|
|
2133
|
-
|
|
2080
|
+
v.preventDefault(), A <= 0 ? j() : (G = k[A - 1]) == null || G.focus();
|
|
2134
2081
|
break;
|
|
2135
2082
|
case "Home":
|
|
2136
|
-
|
|
2083
|
+
v.preventDefault(), (E = k[0]) == null || E.focus();
|
|
2137
2084
|
break;
|
|
2138
2085
|
case "End":
|
|
2139
|
-
|
|
2086
|
+
v.preventDefault(), (f = k[k.length - 1]) == null || f.focus();
|
|
2140
2087
|
break;
|
|
2141
2088
|
case "Tab":
|
|
2142
|
-
|
|
2089
|
+
M();
|
|
2143
2090
|
break;
|
|
2144
2091
|
}
|
|
2145
2092
|
}, D = x && /* @__PURE__ */ e.jsx(
|
|
@@ -2155,35 +2102,35 @@ function rn({
|
|
|
2155
2102
|
].filter(Boolean).join(" "),
|
|
2156
2103
|
style: N,
|
|
2157
2104
|
onKeyDown: V,
|
|
2158
|
-
children: s.map((
|
|
2159
|
-
if (
|
|
2160
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" },
|
|
2161
|
-
if (
|
|
2105
|
+
children: s.map((v, k) => {
|
|
2106
|
+
if (v.separator)
|
|
2107
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, k);
|
|
2108
|
+
if (v.type === "section")
|
|
2162
2109
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
2163
|
-
|
|
2164
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
2165
|
-
] },
|
|
2166
|
-
const A = !!
|
|
2110
|
+
v.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: v.label }),
|
|
2111
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: v.content })
|
|
2112
|
+
] }, k);
|
|
2113
|
+
const A = !!v.href, U = A ? "a" : "button", G = A ? { href: v.disabled ? void 0 : v.href, "aria-disabled": v.disabled ? "true" : void 0 } : { type: "button", disabled: v.disabled };
|
|
2167
2114
|
return /* @__PURE__ */ e.jsxs(
|
|
2168
2115
|
U,
|
|
2169
2116
|
{
|
|
2170
2117
|
role: "menuitem",
|
|
2171
2118
|
className: [
|
|
2172
2119
|
"ds-dropdown__item",
|
|
2173
|
-
|
|
2120
|
+
v.danger && "ds-dropdown__item--danger"
|
|
2174
2121
|
].filter(Boolean).join(" "),
|
|
2175
2122
|
...G,
|
|
2176
2123
|
onClick: () => {
|
|
2177
|
-
var
|
|
2178
|
-
(
|
|
2124
|
+
var E;
|
|
2125
|
+
(E = v.onClick) == null || E.call(v), M();
|
|
2179
2126
|
},
|
|
2180
2127
|
children: [
|
|
2181
|
-
|
|
2182
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
2183
|
-
|
|
2128
|
+
v.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: v.icon }),
|
|
2129
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: v.label }),
|
|
2130
|
+
v.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: v.shortcut })
|
|
2184
2131
|
]
|
|
2185
2132
|
},
|
|
2186
|
-
|
|
2133
|
+
k
|
|
2187
2134
|
);
|
|
2188
2135
|
})
|
|
2189
2136
|
}
|
|
@@ -2191,17 +2138,17 @@ function rn({
|
|
|
2191
2138
|
return /* @__PURE__ */ e.jsxs(
|
|
2192
2139
|
"div",
|
|
2193
2140
|
{
|
|
2194
|
-
ref:
|
|
2141
|
+
ref: b,
|
|
2195
2142
|
className: ["ds-dropdown", o && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
|
|
2196
2143
|
style: l,
|
|
2197
|
-
...
|
|
2144
|
+
...c,
|
|
2198
2145
|
children: [
|
|
2199
2146
|
/* @__PURE__ */ e.jsx(
|
|
2200
2147
|
"div",
|
|
2201
2148
|
{
|
|
2202
|
-
ref:
|
|
2149
|
+
ref: $,
|
|
2203
2150
|
className: "ds-dropdown__trigger",
|
|
2204
|
-
onClick:
|
|
2151
|
+
onClick: W,
|
|
2205
2152
|
onKeyDown: K,
|
|
2206
2153
|
children: t
|
|
2207
2154
|
}
|
|
@@ -2211,7 +2158,7 @@ function rn({
|
|
|
2211
2158
|
}
|
|
2212
2159
|
);
|
|
2213
2160
|
}
|
|
2214
|
-
function
|
|
2161
|
+
function sn({
|
|
2215
2162
|
value: t = 0,
|
|
2216
2163
|
size: s = "m",
|
|
2217
2164
|
variant: n = "default",
|
|
@@ -2219,7 +2166,7 @@ function an({
|
|
|
2219
2166
|
min: a = 2,
|
|
2220
2167
|
animate: o = !0
|
|
2221
2168
|
}) {
|
|
2222
|
-
const i = Math.min(100, Math.max(0, t)), l = Math.max(a, i),
|
|
2169
|
+
const i = Math.min(100, Math.max(0, t)), l = Math.max(a, i), c = n === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : n;
|
|
2223
2170
|
return /* @__PURE__ */ e.jsxs(
|
|
2224
2171
|
"div",
|
|
2225
2172
|
{
|
|
@@ -2236,7 +2183,7 @@ function an({
|
|
|
2236
2183
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
2237
2184
|
"div",
|
|
2238
2185
|
{
|
|
2239
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
2186
|
+
className: `ds-progress__fill ds-progress__fill--${c}`,
|
|
2240
2187
|
style: { width: `${l}%` }
|
|
2241
2188
|
}
|
|
2242
2189
|
) }),
|
|
@@ -2248,50 +2195,50 @@ function an({
|
|
|
2248
2195
|
}
|
|
2249
2196
|
);
|
|
2250
2197
|
}
|
|
2251
|
-
const
|
|
2252
|
-
function
|
|
2198
|
+
const Mt = (t) => 1 - Math.pow(1 - t, 3), zt = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2199
|
+
function Ft(t, { duration: s = 600 } = {}) {
|
|
2253
2200
|
const [n, r] = I(t), a = R(t), o = R(null);
|
|
2254
|
-
return
|
|
2255
|
-
if (
|
|
2201
|
+
return P(() => {
|
|
2202
|
+
if (zt()) {
|
|
2256
2203
|
r(t), a.current = t;
|
|
2257
2204
|
return;
|
|
2258
2205
|
}
|
|
2259
2206
|
const i = a.current, l = t - i;
|
|
2260
2207
|
if (l === 0) return;
|
|
2261
|
-
let
|
|
2262
|
-
const
|
|
2263
|
-
|
|
2264
|
-
const p = Math.min((u -
|
|
2265
|
-
r(i + l *
|
|
2208
|
+
let c = null;
|
|
2209
|
+
const d = (u) => {
|
|
2210
|
+
c || (c = u);
|
|
2211
|
+
const p = Math.min((u - c) / s, 1);
|
|
2212
|
+
r(i + l * Mt(p)), p < 1 ? o.current = requestAnimationFrame(d) : a.current = t;
|
|
2266
2213
|
};
|
|
2267
|
-
return o.current = requestAnimationFrame(
|
|
2214
|
+
return o.current = requestAnimationFrame(d), () => cancelAnimationFrame(o.current);
|
|
2268
2215
|
}, [t, s]), n;
|
|
2269
2216
|
}
|
|
2270
|
-
function
|
|
2217
|
+
function nn({
|
|
2271
2218
|
value: t,
|
|
2272
2219
|
duration: s = 600,
|
|
2273
2220
|
decimals: n = 0,
|
|
2274
2221
|
prefix: r = "",
|
|
2275
2222
|
suffix: a = ""
|
|
2276
2223
|
}) {
|
|
2277
|
-
const i =
|
|
2224
|
+
const i = Ft(t, { duration: s }).toFixed(n);
|
|
2278
2225
|
return `${r}${i}${a}`;
|
|
2279
2226
|
}
|
|
2280
|
-
function
|
|
2227
|
+
function Wt({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2281
2228
|
const r = R(null), [a, o] = I(!1);
|
|
2282
|
-
return
|
|
2229
|
+
return P(() => {
|
|
2283
2230
|
const i = r.current;
|
|
2284
2231
|
if (!i) return;
|
|
2285
2232
|
const l = new IntersectionObserver(
|
|
2286
|
-
([
|
|
2287
|
-
|
|
2233
|
+
([c]) => {
|
|
2234
|
+
c.isIntersecting ? (o(!0), n && l.disconnect()) : n || o(!1);
|
|
2288
2235
|
},
|
|
2289
2236
|
{ threshold: t, rootMargin: s }
|
|
2290
2237
|
);
|
|
2291
2238
|
return l.observe(i), () => l.disconnect();
|
|
2292
2239
|
}, [t, s, n]), { ref: r, inView: a };
|
|
2293
2240
|
}
|
|
2294
|
-
function
|
|
2241
|
+
function rn({
|
|
2295
2242
|
children: t,
|
|
2296
2243
|
as: s = "div",
|
|
2297
2244
|
once: n = !1,
|
|
@@ -2301,14 +2248,14 @@ function ln({
|
|
|
2301
2248
|
onLeave: i,
|
|
2302
2249
|
...l
|
|
2303
2250
|
}) {
|
|
2304
|
-
const { ref:
|
|
2305
|
-
return
|
|
2306
|
-
|
|
2307
|
-
}, [
|
|
2308
|
-
}
|
|
2309
|
-
const
|
|
2310
|
-
default:
|
|
2311
|
-
success:
|
|
2251
|
+
const { ref: c, inView: d } = Wt({ threshold: r, rootMargin: a, once: n }), u = R(!1);
|
|
2252
|
+
return P(() => {
|
|
2253
|
+
d && !u.current && (o == null || o()), !d && u.current && (i == null || i()), u.current = d;
|
|
2254
|
+
}, [d]), /* @__PURE__ */ e.jsx(s, { ref: c, ...l, children: typeof t == "function" ? t(d) : t });
|
|
2255
|
+
}
|
|
2256
|
+
const He = {
|
|
2257
|
+
default: Ie,
|
|
2258
|
+
success: De,
|
|
2312
2259
|
warning: Ae,
|
|
2313
2260
|
error: Se
|
|
2314
2261
|
};
|
|
@@ -2317,15 +2264,15 @@ const $e = /* @__PURE__ */ new Set();
|
|
|
2317
2264
|
function et() {
|
|
2318
2265
|
$e.forEach((t) => t([...xe]));
|
|
2319
2266
|
}
|
|
2320
|
-
function
|
|
2267
|
+
function Ct(t) {
|
|
2321
2268
|
xe = [...xe, t], et();
|
|
2322
2269
|
}
|
|
2323
|
-
function
|
|
2270
|
+
function Ot(t) {
|
|
2324
2271
|
xe = xe.filter((s) => s.id !== t), et();
|
|
2325
2272
|
}
|
|
2326
|
-
function
|
|
2273
|
+
function an() {
|
|
2327
2274
|
const t = (s, n = {}) => {
|
|
2328
|
-
|
|
2275
|
+
Ct({
|
|
2329
2276
|
id: `${Date.now()}-${Math.random()}`,
|
|
2330
2277
|
message: s,
|
|
2331
2278
|
type: "default",
|
|
@@ -2335,13 +2282,13 @@ function cn() {
|
|
|
2335
2282
|
};
|
|
2336
2283
|
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 };
|
|
2337
2284
|
}
|
|
2338
|
-
function
|
|
2285
|
+
function Ut({ data: t, onDismiss: s }) {
|
|
2339
2286
|
const [n, r] = I(!1), a = R(null);
|
|
2340
|
-
|
|
2287
|
+
P(() => (requestAnimationFrame(() => r(!0)), t.duration > 0 && (a.current = setTimeout(() => o(), t.duration)), () => clearTimeout(a.current)), []);
|
|
2341
2288
|
function o() {
|
|
2342
2289
|
r(!1), setTimeout(() => s(t.id), 250);
|
|
2343
2290
|
}
|
|
2344
|
-
const i =
|
|
2291
|
+
const i = He[t.type] ?? He.default;
|
|
2345
2292
|
return /* @__PURE__ */ e.jsxs(
|
|
2346
2293
|
"div",
|
|
2347
2294
|
{
|
|
@@ -2353,7 +2300,7 @@ function Yt({ data: t, onDismiss: s }) {
|
|
|
2353
2300
|
role: t.type === "error" ? "alert" : "status",
|
|
2354
2301
|
"aria-live": "polite",
|
|
2355
2302
|
children: [
|
|
2356
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(i, { size:
|
|
2303
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(i, { size: C[3], strokeWidth: 1.5 }) }),
|
|
2357
2304
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: t.message }),
|
|
2358
2305
|
/* @__PURE__ */ e.jsx(
|
|
2359
2306
|
"button",
|
|
@@ -2361,26 +2308,26 @@ function Yt({ data: t, onDismiss: s }) {
|
|
|
2361
2308
|
className: "ds-toast__close",
|
|
2362
2309
|
onClick: o,
|
|
2363
2310
|
"aria-label": "Закрыть",
|
|
2364
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2311
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: C[3], strokeWidth: 1.5 })
|
|
2365
2312
|
}
|
|
2366
2313
|
)
|
|
2367
2314
|
]
|
|
2368
2315
|
}
|
|
2369
2316
|
);
|
|
2370
2317
|
}
|
|
2371
|
-
function
|
|
2318
|
+
function on({ position: t = "bottom-right" }) {
|
|
2372
2319
|
const [s, n] = I(() => [...xe]);
|
|
2373
|
-
return
|
|
2374
|
-
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(
|
|
2320
|
+
return P(() => ($e.add(n), () => $e.delete(n)), []), !s.length || typeof document > "u" ? null : me.createPortal(
|
|
2321
|
+
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(Ut, { data: r, onDismiss: Ot }, r.id)) }),
|
|
2375
2322
|
document.body
|
|
2376
2323
|
);
|
|
2377
2324
|
}
|
|
2378
|
-
const
|
|
2325
|
+
const Vt = {
|
|
2379
2326
|
running: /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "info", children: "Running..." }),
|
|
2380
2327
|
success: /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "success", children: "Done" }),
|
|
2381
2328
|
error: /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: "error", children: "Error" })
|
|
2382
2329
|
};
|
|
2383
|
-
function
|
|
2330
|
+
function ln({
|
|
2384
2331
|
label: t,
|
|
2385
2332
|
status: s = "idle",
|
|
2386
2333
|
icon: n,
|
|
@@ -2389,20 +2336,20 @@ function un({
|
|
|
2389
2336
|
expanded: o,
|
|
2390
2337
|
onToggle: i,
|
|
2391
2338
|
children: l,
|
|
2392
|
-
className:
|
|
2393
|
-
...
|
|
2339
|
+
className: c = "",
|
|
2340
|
+
...d
|
|
2394
2341
|
}) {
|
|
2395
2342
|
const u = s === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2396
2343
|
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2397
2344
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: t }),
|
|
2398
|
-
|
|
2345
|
+
Vt[s],
|
|
2399
2346
|
r
|
|
2400
2347
|
] });
|
|
2401
2348
|
return l ? /* @__PURE__ */ e.jsx(
|
|
2402
2349
|
"div",
|
|
2403
2350
|
{
|
|
2404
|
-
className: ["ds-tool-card", u && "ds-tool-card--running",
|
|
2405
|
-
...
|
|
2351
|
+
className: ["ds-tool-card", u && "ds-tool-card--running", c].filter(Boolean).join(" "),
|
|
2352
|
+
...d,
|
|
2406
2353
|
children: /* @__PURE__ */ e.jsx(
|
|
2407
2354
|
Be,
|
|
2408
2355
|
{
|
|
@@ -2418,21 +2365,21 @@ function un({
|
|
|
2418
2365
|
) : /* @__PURE__ */ e.jsx(
|
|
2419
2366
|
"div",
|
|
2420
2367
|
{
|
|
2421
|
-
className: ["ds-tool-card", "ds-tool-card--bubble",
|
|
2422
|
-
...
|
|
2368
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", c].filter(Boolean).join(" "),
|
|
2369
|
+
...d,
|
|
2423
2370
|
children: p
|
|
2424
2371
|
}
|
|
2425
2372
|
);
|
|
2426
2373
|
}
|
|
2427
|
-
function
|
|
2374
|
+
function Yt({
|
|
2428
2375
|
text: t,
|
|
2429
2376
|
size: s = "xs",
|
|
2430
2377
|
timeout: n = 800,
|
|
2431
2378
|
"aria-label": r = "Copy to clipboard",
|
|
2432
2379
|
...a
|
|
2433
2380
|
}) {
|
|
2434
|
-
const [o, i] = I(!1), l = (
|
|
2435
|
-
|
|
2381
|
+
const [o, i] = I(!1), l = (c) => {
|
|
2382
|
+
c.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
|
|
2436
2383
|
i(!0), setTimeout(() => i(!1), n);
|
|
2437
2384
|
});
|
|
2438
2385
|
};
|
|
@@ -2442,16 +2389,16 @@ function qt({
|
|
|
2442
2389
|
variant: "ghost",
|
|
2443
2390
|
size: s,
|
|
2444
2391
|
state: o ? "success" : "idle",
|
|
2445
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2392
|
+
icon: /* @__PURE__ */ e.jsx(dt, { size: C[1], strokeWidth: 1.5 }),
|
|
2446
2393
|
"aria-label": r,
|
|
2447
2394
|
onClick: l,
|
|
2448
2395
|
...a
|
|
2449
2396
|
}
|
|
2450
2397
|
);
|
|
2451
2398
|
}
|
|
2452
|
-
function
|
|
2399
|
+
function cn({ content: t, streaming: s = !1, ...n }) {
|
|
2453
2400
|
const [r, a] = I(s);
|
|
2454
|
-
return
|
|
2401
|
+
return P(() => {
|
|
2455
2402
|
a(!!s);
|
|
2456
2403
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2457
2404
|
Be,
|
|
@@ -2460,8 +2407,8 @@ function fn({ content: t, streaming: s = !1, ...n }) {
|
|
|
2460
2407
|
onToggle: a,
|
|
2461
2408
|
padding: "s",
|
|
2462
2409
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2463
|
-
/* @__PURE__ */ e.jsx(
|
|
2464
|
-
/* @__PURE__ */ e.jsx(
|
|
2410
|
+
/* @__PURE__ */ e.jsx(ut, { size: C[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2411
|
+
/* @__PURE__ */ e.jsx(gt, { secondary: !0, children: "Thinking" })
|
|
2465
2412
|
] }),
|
|
2466
2413
|
...n,
|
|
2467
2414
|
children: /* @__PURE__ */ e.jsxs(Qe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
@@ -2471,7 +2418,7 @@ function fn({ content: t, streaming: s = !1, ...n }) {
|
|
|
2471
2418
|
}
|
|
2472
2419
|
);
|
|
2473
2420
|
}
|
|
2474
|
-
function
|
|
2421
|
+
function dn({
|
|
2475
2422
|
count: t,
|
|
2476
2423
|
current: s = 0,
|
|
2477
2424
|
done: n = [],
|
|
@@ -2482,8 +2429,8 @@ function mn({
|
|
|
2482
2429
|
...l
|
|
2483
2430
|
}) {
|
|
2484
2431
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", o].filter(Boolean).join(" "), ...l, children: [
|
|
2485
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (
|
|
2486
|
-
const u =
|
|
2432
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (c, d) => {
|
|
2433
|
+
const u = d === s, p = n.includes(d) && !u, h = r && (d <= s || n.includes(d)), m = [
|
|
2487
2434
|
"ds-step-indicator__dot",
|
|
2488
2435
|
u && "ds-step-indicator__dot--active",
|
|
2489
2436
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2495,12 +2442,12 @@ function mn({
|
|
|
2495
2442
|
className: m,
|
|
2496
2443
|
role: "tab",
|
|
2497
2444
|
"aria-selected": u,
|
|
2498
|
-
"aria-label": `Step ${
|
|
2499
|
-
disabled: !h ||
|
|
2500
|
-
onClick: () => r == null ? void 0 : r(
|
|
2445
|
+
"aria-label": `Step ${d + 1}`,
|
|
2446
|
+
disabled: !h || d === s,
|
|
2447
|
+
onClick: () => r == null ? void 0 : r(d),
|
|
2501
2448
|
children: p ? /* @__PURE__ */ e.jsx(Re, { size: 8, strokeWidth: 3 }) : null
|
|
2502
2449
|
},
|
|
2503
|
-
|
|
2450
|
+
d
|
|
2504
2451
|
);
|
|
2505
2452
|
}) }),
|
|
2506
2453
|
a && /* @__PURE__ */ e.jsxs(Qe, { secondary: !0, className: "ds-step-indicator__counter", children: [
|
|
@@ -2510,7 +2457,7 @@ function mn({
|
|
|
2510
2457
|
] })
|
|
2511
2458
|
] });
|
|
2512
2459
|
}
|
|
2513
|
-
function
|
|
2460
|
+
function un({
|
|
2514
2461
|
content: t,
|
|
2515
2462
|
isStreaming: s = !1,
|
|
2516
2463
|
cursor: n = "line",
|
|
@@ -2519,14 +2466,14 @@ function pn({
|
|
|
2519
2466
|
...o
|
|
2520
2467
|
}) {
|
|
2521
2468
|
const i = R(t);
|
|
2522
|
-
return
|
|
2469
|
+
return P(() => {
|
|
2523
2470
|
t !== i.current && (r == null || r(t), i.current = t);
|
|
2524
2471
|
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...o, children: [
|
|
2525
2472
|
t,
|
|
2526
2473
|
s && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2527
2474
|
] });
|
|
2528
2475
|
}
|
|
2529
|
-
function
|
|
2476
|
+
function fn({
|
|
2530
2477
|
role: t = "assistant",
|
|
2531
2478
|
header: s,
|
|
2532
2479
|
footer: n,
|
|
@@ -2536,26 +2483,26 @@ function hn({
|
|
|
2536
2483
|
className: i = "",
|
|
2537
2484
|
...l
|
|
2538
2485
|
}) {
|
|
2539
|
-
const
|
|
2486
|
+
const c = [
|
|
2540
2487
|
"ds-chat-message",
|
|
2541
2488
|
`ds-chat-message--${t}`,
|
|
2542
2489
|
a && "ds-chat-message--streaming",
|
|
2543
2490
|
i
|
|
2544
2491
|
].filter(Boolean).join(" ");
|
|
2545
|
-
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2492
|
+
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className: c, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: o }) }) : t === "user" ? /* @__PURE__ */ e.jsxs("div", { className: c, ...l, children: [
|
|
2546
2493
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: r }),
|
|
2547
2494
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: o }),
|
|
2548
2495
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2549
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2496
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: c, ...l, children: [
|
|
2550
2497
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: s }),
|
|
2551
2498
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: r }),
|
|
2552
2499
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: o }),
|
|
2553
2500
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2554
2501
|
] });
|
|
2555
2502
|
}
|
|
2556
|
-
function
|
|
2503
|
+
function mn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2557
2504
|
const r = R(!1), a = R(0);
|
|
2558
|
-
|
|
2505
|
+
P(() => {
|
|
2559
2506
|
const o = s == null ? void 0 : s.current;
|
|
2560
2507
|
if (!o) return;
|
|
2561
2508
|
const i = () => {
|
|
@@ -2563,12 +2510,12 @@ function xn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
|
2563
2510
|
!l && o.scrollTop < a.current && (r.current = !0), l && (r.current = !1), a.current = o.scrollTop;
|
|
2564
2511
|
};
|
|
2565
2512
|
return o.addEventListener("scroll", i, { passive: !0 }), () => o.removeEventListener("scroll", i);
|
|
2566
|
-
}, [s]),
|
|
2513
|
+
}, [s]), P(() => {
|
|
2567
2514
|
const o = s == null ? void 0 : s.current;
|
|
2568
2515
|
o && (n && r.current || (o.scrollTop = o.scrollHeight));
|
|
2569
2516
|
}, t);
|
|
2570
2517
|
}
|
|
2571
|
-
function
|
|
2518
|
+
function Ht({
|
|
2572
2519
|
prompts: t,
|
|
2573
2520
|
enabled: s,
|
|
2574
2521
|
typingSpeed: n = 38,
|
|
@@ -2577,36 +2524,36 @@ function Gt({
|
|
|
2577
2524
|
betweenTime: o = 380,
|
|
2578
2525
|
manualPauseMs: i = 5e3
|
|
2579
2526
|
}) {
|
|
2580
|
-
const [l,
|
|
2581
|
-
|
|
2527
|
+
const [l, c] = I(0), [d, u] = I(""), p = R("typing"), h = R(0), m = R(0), x = R(null), b = R(0);
|
|
2528
|
+
P(() => {
|
|
2582
2529
|
m.current = l;
|
|
2583
|
-
}, [l]),
|
|
2530
|
+
}, [l]), P(() => {
|
|
2584
2531
|
if (x.current && (clearTimeout(x.current), x.current = null), !s || t.length === 0) {
|
|
2585
2532
|
u(""), h.current = 0, p.current = "typing";
|
|
2586
2533
|
return;
|
|
2587
2534
|
}
|
|
2588
|
-
const
|
|
2535
|
+
const y = () => {
|
|
2589
2536
|
const S = Date.now();
|
|
2590
|
-
if (
|
|
2591
|
-
x.current = setTimeout(
|
|
2537
|
+
if (b.current > S) {
|
|
2538
|
+
x.current = setTimeout(y, b.current - S);
|
|
2592
2539
|
return;
|
|
2593
2540
|
}
|
|
2594
|
-
const
|
|
2595
|
-
p.current === "typing" ? (h.current += 1, u(
|
|
2541
|
+
const B = t[m.current % t.length] ?? "";
|
|
2542
|
+
p.current === "typing" ? (h.current += 1, u(B.slice(0, h.current)), h.current >= B.length ? (p.current = "holding", x.current = setTimeout(y, a)) : x.current = setTimeout(y, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(y, r)) : (h.current = Math.max(0, h.current - 1), u(B.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", m.current = (m.current + 1) % t.length, c(m.current), x.current = setTimeout(y, o)) : x.current = setTimeout(y, r));
|
|
2596
2543
|
};
|
|
2597
|
-
return x.current = setTimeout(
|
|
2544
|
+
return x.current = setTimeout(y, 260), () => {
|
|
2598
2545
|
x.current && clearTimeout(x.current);
|
|
2599
2546
|
};
|
|
2600
2547
|
}, [s, t, n, r, a, o]);
|
|
2601
|
-
const g = (
|
|
2548
|
+
const g = (y) => {
|
|
2602
2549
|
if (t.length === 0) return;
|
|
2603
|
-
const S = (
|
|
2604
|
-
m.current = S, h.current =
|
|
2605
|
-
},
|
|
2606
|
-
return { displayed:
|
|
2550
|
+
const S = (y % t.length + t.length) % t.length, B = t[S];
|
|
2551
|
+
m.current = S, h.current = B.length, p.current = "holding", b.current = Date.now() + i, c(S), u(B);
|
|
2552
|
+
}, $ = () => g(m.current + 1), _ = () => g(m.current - 1), N = t[l % t.length] ?? "";
|
|
2553
|
+
return { displayed: d, currentPrompt: N, index: l, next: $, prev: _ };
|
|
2607
2554
|
}
|
|
2608
|
-
let
|
|
2609
|
-
function
|
|
2555
|
+
let qt = 0;
|
|
2556
|
+
function pn({
|
|
2610
2557
|
value: t = "",
|
|
2611
2558
|
onChange: s,
|
|
2612
2559
|
onSubmit: n,
|
|
@@ -2615,64 +2562,64 @@ function vn({
|
|
|
2615
2562
|
loading: o = !1,
|
|
2616
2563
|
disabled: i = !1,
|
|
2617
2564
|
placeholder: l = "Let's get things done...",
|
|
2618
|
-
animatedPlaceholders:
|
|
2619
|
-
attachments:
|
|
2565
|
+
animatedPlaceholders: c,
|
|
2566
|
+
attachments: d,
|
|
2620
2567
|
images: u,
|
|
2621
2568
|
onAttachFiles: p,
|
|
2622
2569
|
onAttachImages: h,
|
|
2623
2570
|
onRemoveAttachment: m,
|
|
2624
2571
|
onRemoveImage: x,
|
|
2625
|
-
acceptImage:
|
|
2572
|
+
acceptImage: b,
|
|
2626
2573
|
acceptFile: g,
|
|
2627
|
-
maxImages:
|
|
2628
|
-
maxImageSize:
|
|
2574
|
+
maxImages: $,
|
|
2575
|
+
maxImageSize: _,
|
|
2629
2576
|
leftSlot: N,
|
|
2630
|
-
rightSlot:
|
|
2577
|
+
rightSlot: y,
|
|
2631
2578
|
className: S = "",
|
|
2632
|
-
...
|
|
2579
|
+
...B
|
|
2633
2580
|
}) {
|
|
2634
|
-
const
|
|
2635
|
-
const L = ++
|
|
2636
|
-
V((X) => [...X, { id: L, msg:
|
|
2637
|
-
},
|
|
2581
|
+
const M = R(null), W = R(null), z = R(0), [j, F] = I(!1), [K, V] = I([]), D = (w) => {
|
|
2582
|
+
const L = ++qt;
|
|
2583
|
+
V((X) => [...X, { id: L, msg: w }]), setTimeout(() => V((X) => X.filter((J) => J.id !== L)), 6e3);
|
|
2584
|
+
}, v = (w) => V((L) => L.filter((X) => X.id !== w)), k = (w) => w.type.startsWith("image/"), A = () => !0, U = b ?? k, G = g ?? A, E = (w) => {
|
|
2638
2585
|
const L = [], X = [], J = [], Z = [];
|
|
2639
|
-
let te = 0, ue =
|
|
2640
|
-
for (const se of
|
|
2641
|
-
U(se) ?
|
|
2586
|
+
let te = 0, ue = $ != null ? $ - ((u == null ? void 0 : u.length) ?? 0) : 1 / 0;
|
|
2587
|
+
for (const se of w)
|
|
2588
|
+
U(se) ? _ && se.size > _ ? J.push(se.name) : ue > 0 ? (L.push(se), ue--) : te++ : G(se) ? X.push(se) : Z.push(se.name);
|
|
2642
2589
|
return { imageFiles: L, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te };
|
|
2643
|
-
}, f = (
|
|
2644
|
-
const { imageFiles: L, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te } =
|
|
2645
|
-
J.length && D(`File${J.length > 1 ? "s" : ""} too large${
|
|
2590
|
+
}, f = (w) => {
|
|
2591
|
+
const { imageFiles: L, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te } = E(w);
|
|
2592
|
+
J.length && D(`File${J.length > 1 ? "s" : ""} too large${_ ? ` (max ${_ / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && D(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), te && D(`Max ${$} images per message`), h && L.length && h(L);
|
|
2646
2593
|
const ue = X.concat(h ? [] : L);
|
|
2647
2594
|
p && ue.length && p(ue);
|
|
2648
2595
|
};
|
|
2649
|
-
|
|
2650
|
-
const
|
|
2651
|
-
|
|
2652
|
-
}, [t]),
|
|
2653
|
-
const
|
|
2596
|
+
P(() => {
|
|
2597
|
+
const w = W.current;
|
|
2598
|
+
w && (w.style.height = "auto", w.style.height = `${Math.min(w.scrollHeight, 200)}px`);
|
|
2599
|
+
}, [t]), P(() => {
|
|
2600
|
+
const w = (L) => {
|
|
2654
2601
|
var J, Z, te;
|
|
2655
2602
|
if (o || i) return;
|
|
2656
2603
|
const X = (J = L.target) == null ? void 0 : J.tagName;
|
|
2657
|
-
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z = L.target) != null && Z.isContentEditable || L.ctrlKey || L.metaKey || L.altKey || L.key.length !== 1 && L.key !== "Backspace" && L.key !== "Delete" || (te =
|
|
2604
|
+
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z = L.target) != null && Z.isContentEditable || L.ctrlKey || L.metaKey || L.altKey || L.key.length !== 1 && L.key !== "Backspace" && L.key !== "Delete" || (te = W.current) == null || te.focus();
|
|
2658
2605
|
};
|
|
2659
|
-
return document.addEventListener("keydown",
|
|
2606
|
+
return document.addEventListener("keydown", w), () => document.removeEventListener("keydown", w);
|
|
2660
2607
|
}, [o, i]);
|
|
2661
|
-
const T = (
|
|
2662
|
-
|
|
2663
|
-
},
|
|
2664
|
-
|
|
2665
|
-
}, Y = (
|
|
2666
|
-
|
|
2667
|
-
const L = Array.from(
|
|
2608
|
+
const T = (w) => {
|
|
2609
|
+
w.preventDefault(), z.current++, w.dataTransfer.types.includes("Files") && F(!0);
|
|
2610
|
+
}, O = (w) => {
|
|
2611
|
+
w.preventDefault(), z.current--, z.current === 0 && F(!1);
|
|
2612
|
+
}, Y = (w) => w.preventDefault(), ne = (w) => {
|
|
2613
|
+
w.preventDefault(), z.current = 0, F(!1);
|
|
2614
|
+
const L = Array.from(w.dataTransfer.files);
|
|
2668
2615
|
L.length && f(L);
|
|
2669
|
-
}, oe = (
|
|
2670
|
-
const L = Array.from(
|
|
2671
|
-
|
|
2672
|
-
},
|
|
2616
|
+
}, oe = (w) => {
|
|
2617
|
+
const L = Array.from(w.target.files || []);
|
|
2618
|
+
M.current && (M.current.value = ""), L.length && f(L);
|
|
2619
|
+
}, H = (w) => {
|
|
2673
2620
|
var se;
|
|
2674
2621
|
if (!h) return;
|
|
2675
|
-
const L = (se =
|
|
2622
|
+
const L = (se = w.clipboardData) == null ? void 0 : se.items;
|
|
2676
2623
|
if (!L) return;
|
|
2677
2624
|
const X = [];
|
|
2678
2625
|
for (const st of L) {
|
|
@@ -2680,33 +2627,33 @@ function vn({
|
|
|
2680
2627
|
Me && X.push(Me);
|
|
2681
2628
|
}
|
|
2682
2629
|
if (X.length === 0) return;
|
|
2683
|
-
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ue } =
|
|
2684
|
-
Z.length && D(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), te.length && D(`Skipped unsupported file${te.length > 1 ? "s" : ""}: ${te.join(", ")}`), ue && D(`Max ${
|
|
2685
|
-
},
|
|
2686
|
-
prompts:
|
|
2687
|
-
enabled:
|
|
2688
|
-
}), ge = (
|
|
2689
|
-
if (
|
|
2690
|
-
if (
|
|
2691
|
-
|
|
2630
|
+
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ue } = E(X);
|
|
2631
|
+
Z.length && D(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), te.length && D(`Skipped unsupported file${te.length > 1 ? "s" : ""}: ${te.join(", ")}`), ue && D(`Max ${$} images per message`), J.length && (w.preventDefault(), h(J));
|
|
2632
|
+
}, Q = !o && !i && !!(c != null && c.length) && t.length === 0, ie = Ht({
|
|
2633
|
+
prompts: c ?? [],
|
|
2634
|
+
enabled: Q
|
|
2635
|
+
}), ge = (w) => {
|
|
2636
|
+
if (Q) {
|
|
2637
|
+
if (w.key === "ArrowDown" || w.key === "ArrowRight") {
|
|
2638
|
+
w.preventDefault(), ie.next();
|
|
2692
2639
|
return;
|
|
2693
2640
|
}
|
|
2694
|
-
if (
|
|
2695
|
-
|
|
2641
|
+
if (w.key === "ArrowUp" || w.key === "ArrowLeft") {
|
|
2642
|
+
w.preventDefault(), ie.prev();
|
|
2696
2643
|
return;
|
|
2697
2644
|
}
|
|
2698
|
-
if (
|
|
2699
|
-
|
|
2645
|
+
if (w.key === "Tab" && !w.shiftKey) {
|
|
2646
|
+
w.preventDefault(), s == null || s(ie.currentPrompt);
|
|
2700
2647
|
return;
|
|
2701
2648
|
}
|
|
2702
2649
|
}
|
|
2703
|
-
a == null || a(
|
|
2704
|
-
}, tt = (t.trim() || (u == null ? void 0 : u.length) > 0 || (
|
|
2705
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", S].filter(Boolean).join(" "), ...
|
|
2650
|
+
a == null || a(w);
|
|
2651
|
+
}, tt = (t.trim() || (u == null ? void 0 : u.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, Pe = p || h;
|
|
2652
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", S].filter(Boolean).join(" "), ...B, children: [
|
|
2706
2653
|
Pe && /* @__PURE__ */ e.jsx(
|
|
2707
2654
|
"input",
|
|
2708
2655
|
{
|
|
2709
|
-
ref:
|
|
2656
|
+
ref: M,
|
|
2710
2657
|
type: "file",
|
|
2711
2658
|
multiple: !0,
|
|
2712
2659
|
accept: "*/*",
|
|
@@ -2717,33 +2664,33 @@ function vn({
|
|
|
2717
2664
|
/* @__PURE__ */ e.jsxs(
|
|
2718
2665
|
"div",
|
|
2719
2666
|
{
|
|
2720
|
-
className: ["ds-prompt-input__box",
|
|
2667
|
+
className: ["ds-prompt-input__box", j && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2721
2668
|
onDragEnter: T,
|
|
2722
|
-
onDragLeave:
|
|
2669
|
+
onDragLeave: O,
|
|
2723
2670
|
onDragOver: Y,
|
|
2724
2671
|
onDrop: ne,
|
|
2725
2672
|
children: [
|
|
2726
|
-
|
|
2673
|
+
j && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2727
2674
|
/* @__PURE__ */ e.jsx(
|
|
2728
2675
|
"textarea",
|
|
2729
2676
|
{
|
|
2730
|
-
ref:
|
|
2677
|
+
ref: W,
|
|
2731
2678
|
value: t,
|
|
2732
|
-
onChange: (
|
|
2679
|
+
onChange: (w) => s == null ? void 0 : s(w.target.value),
|
|
2733
2680
|
onKeyDown: ge,
|
|
2734
|
-
onPaste:
|
|
2735
|
-
placeholder:
|
|
2681
|
+
onPaste: H,
|
|
2682
|
+
placeholder: Q ? "" : l,
|
|
2736
2683
|
disabled: o || i,
|
|
2737
2684
|
rows: 1,
|
|
2738
|
-
className: ["ds-prompt-input__textarea",
|
|
2685
|
+
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2739
2686
|
}
|
|
2740
2687
|
),
|
|
2741
|
-
|
|
2688
|
+
Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
|
|
2742
2689
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
|
|
2743
2690
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2744
2691
|
] }),
|
|
2745
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((
|
|
2746
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2692
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((w, L) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2693
|
+
/* @__PURE__ */ e.jsx("img", { src: w.preview, alt: "" }),
|
|
2747
2694
|
/* @__PURE__ */ e.jsx(
|
|
2748
2695
|
"button",
|
|
2749
2696
|
{
|
|
@@ -2751,33 +2698,33 @@ function vn({
|
|
|
2751
2698
|
onClick: () => x == null ? void 0 : x(L),
|
|
2752
2699
|
"aria-label": "Remove image",
|
|
2753
2700
|
type: "button",
|
|
2754
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2701
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: 12, strokeWidth: 2 })
|
|
2755
2702
|
}
|
|
2756
2703
|
)
|
|
2757
2704
|
] }, L)) }),
|
|
2758
|
-
K.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: K.map((
|
|
2759
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2705
|
+
K.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: K.map((w) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2706
|
+
/* @__PURE__ */ e.jsx("span", { children: w.msg }),
|
|
2760
2707
|
/* @__PURE__ */ e.jsx(
|
|
2761
2708
|
"button",
|
|
2762
2709
|
{
|
|
2763
2710
|
type: "button",
|
|
2764
2711
|
className: "ds-prompt-input__warning-close",
|
|
2765
|
-
onClick: () =>
|
|
2712
|
+
onClick: () => v(w.id),
|
|
2766
2713
|
"aria-label": "Dismiss",
|
|
2767
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2714
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: C[1], strokeWidth: 1.5 })
|
|
2768
2715
|
}
|
|
2769
2716
|
)
|
|
2770
|
-
] },
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2717
|
+
] }, w.id)) }),
|
|
2718
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((w, L) => /* @__PURE__ */ e.jsx(fe, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2719
|
+
w.uploading ? /* @__PURE__ */ e.jsx(ft, { size: C[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(ze, { size: C[1], strokeWidth: 1.5 }),
|
|
2720
|
+
w.filename,
|
|
2721
|
+
w.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2775
2722
|
"button",
|
|
2776
2723
|
{
|
|
2777
2724
|
type: "button",
|
|
2778
2725
|
className: "ds-prompt-input__remove-btn",
|
|
2779
2726
|
onClick: () => m == null ? void 0 : m(L),
|
|
2780
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2727
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: C[1], strokeWidth: 1.5 })
|
|
2781
2728
|
}
|
|
2782
2729
|
)
|
|
2783
2730
|
] }) }, L)) }),
|
|
@@ -2787,23 +2734,23 @@ function vn({
|
|
|
2787
2734
|
{
|
|
2788
2735
|
variant: "ghost",
|
|
2789
2736
|
size: "xs",
|
|
2790
|
-
icon: /* @__PURE__ */ e.jsx(ze, { size:
|
|
2737
|
+
icon: /* @__PURE__ */ e.jsx(ze, { size: C[2], strokeWidth: 1.5 }),
|
|
2791
2738
|
"aria-label": "Attach files",
|
|
2792
2739
|
onClick: () => {
|
|
2793
|
-
var
|
|
2794
|
-
return (
|
|
2740
|
+
var w;
|
|
2741
|
+
return (w = M.current) == null ? void 0 : w.click();
|
|
2795
2742
|
}
|
|
2796
2743
|
}
|
|
2797
2744
|
),
|
|
2798
2745
|
N,
|
|
2799
|
-
|
|
2746
|
+
y,
|
|
2800
2747
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2801
2748
|
o ? /* @__PURE__ */ e.jsx(
|
|
2802
2749
|
ae,
|
|
2803
2750
|
{
|
|
2804
2751
|
variant: "primary",
|
|
2805
2752
|
size: "xs",
|
|
2806
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2753
|
+
icon: /* @__PURE__ */ e.jsx(mt, { size: C[2], strokeWidth: 1.5 }),
|
|
2807
2754
|
onClick: r,
|
|
2808
2755
|
"aria-label": "Stop"
|
|
2809
2756
|
}
|
|
@@ -2812,7 +2759,7 @@ function vn({
|
|
|
2812
2759
|
{
|
|
2813
2760
|
variant: "primary",
|
|
2814
2761
|
size: "xs",
|
|
2815
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2762
|
+
icon: /* @__PURE__ */ e.jsx(pt, { size: C[2], strokeWidth: 1.5 }),
|
|
2816
2763
|
onClick: n,
|
|
2817
2764
|
disabled: !tt,
|
|
2818
2765
|
"aria-label": "Send"
|
|
@@ -2824,8 +2771,8 @@ function vn({
|
|
|
2824
2771
|
)
|
|
2825
2772
|
] });
|
|
2826
2773
|
}
|
|
2827
|
-
const
|
|
2828
|
-
function
|
|
2774
|
+
const qe = { fast: 0, standard: 1, premium: 2 }, Ge = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
2775
|
+
function hn({
|
|
2829
2776
|
models: t = [],
|
|
2830
2777
|
value: s,
|
|
2831
2778
|
onChange: n,
|
|
@@ -2834,60 +2781,60 @@ function _n({
|
|
|
2834
2781
|
showAutoOption: o = !1,
|
|
2835
2782
|
groupByTier: i = !0,
|
|
2836
2783
|
className: l = "",
|
|
2837
|
-
...
|
|
2784
|
+
...c
|
|
2838
2785
|
}) {
|
|
2839
|
-
const [
|
|
2840
|
-
|
|
2841
|
-
if (!
|
|
2842
|
-
const
|
|
2786
|
+
const [d, u] = I(!1), p = R(null), h = R(null), m = R(null), [x, b] = I({}), g = t.filter((j) => !a || j.name === "auto" ? !0 : (qe[j.tier] ?? 1) >= (qe[a] ?? 1)), $ = g.find((j) => j.name === "auto"), _ = g.filter((j) => j.name !== "auto"), N = t.find((j) => j.name === s), S = new Set(_.map((j) => j.tier).filter(Boolean)).size > 1;
|
|
2787
|
+
P(() => {
|
|
2788
|
+
if (!d) return;
|
|
2789
|
+
const j = 320, F = () => {
|
|
2843
2790
|
var A;
|
|
2844
2791
|
const D = (A = h.current) == null ? void 0 : A.getBoundingClientRect();
|
|
2845
2792
|
if (!D) return;
|
|
2846
|
-
const
|
|
2847
|
-
|
|
2793
|
+
const v = window.innerHeight - D.bottom, k = v < j + 8 && D.top > v;
|
|
2794
|
+
b({
|
|
2848
2795
|
position: "fixed",
|
|
2849
2796
|
zIndex: "var(--z-dropdown, 500)",
|
|
2850
2797
|
left: D.left,
|
|
2851
|
-
...
|
|
2798
|
+
...k ? { bottom: window.innerHeight - D.top + 4, top: "auto" } : { top: D.bottom + 4, bottom: "auto" }
|
|
2852
2799
|
});
|
|
2853
2800
|
};
|
|
2854
|
-
|
|
2801
|
+
F(), window.addEventListener("scroll", F, !0), window.addEventListener("resize", F);
|
|
2855
2802
|
const K = (D) => {
|
|
2856
|
-
var
|
|
2857
|
-
!((
|
|
2803
|
+
var v, k;
|
|
2804
|
+
!((v = p.current) != null && v.contains(D.target)) && !((k = m.current) != null && k.contains(D.target)) && u(!1);
|
|
2858
2805
|
}, V = (D) => {
|
|
2859
2806
|
D.key === "Escape" && u(!1);
|
|
2860
2807
|
};
|
|
2861
2808
|
return document.addEventListener("mousedown", K), document.addEventListener("keydown", V), () => {
|
|
2862
|
-
window.removeEventListener("scroll",
|
|
2809
|
+
window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F), document.removeEventListener("mousedown", K), document.removeEventListener("keydown", V);
|
|
2863
2810
|
};
|
|
2864
|
-
}, [
|
|
2865
|
-
const
|
|
2866
|
-
n == null || n(
|
|
2867
|
-
},
|
|
2811
|
+
}, [d]);
|
|
2812
|
+
const B = (j) => {
|
|
2813
|
+
n == null || n(j), u(!1);
|
|
2814
|
+
}, M = (j) => /* @__PURE__ */ e.jsxs(
|
|
2868
2815
|
"button",
|
|
2869
2816
|
{
|
|
2870
2817
|
type: "button",
|
|
2871
2818
|
className: [
|
|
2872
2819
|
"ds-model-picker__item",
|
|
2873
|
-
|
|
2820
|
+
j.name === s && "ds-model-picker__item--active"
|
|
2874
2821
|
].filter(Boolean).join(" "),
|
|
2875
|
-
onClick: () =>
|
|
2822
|
+
onClick: () => B(j.name),
|
|
2876
2823
|
children: [
|
|
2877
|
-
|
|
2878
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
2879
|
-
S &&
|
|
2824
|
+
j.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: j.icon }) : /* @__PURE__ */ e.jsx(Fe, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2825
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: j.displayName || j.name }),
|
|
2826
|
+
S && j.tier && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: Ge[j.tier] || "default", children: j.tier })
|
|
2880
2827
|
]
|
|
2881
2828
|
},
|
|
2882
|
-
|
|
2883
|
-
),
|
|
2884
|
-
const
|
|
2885
|
-
return
|
|
2886
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
2887
|
-
...
|
|
2829
|
+
j.name
|
|
2830
|
+
), W = () => !i || !S ? _.map(M) : ["fast", "standard", "premium"].flatMap((j) => {
|
|
2831
|
+
const F = _.filter((K) => K.tier === j);
|
|
2832
|
+
return F.length ? [
|
|
2833
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": j, children: j.charAt(0).toUpperCase() + j.slice(1) }, `lbl-${j}`),
|
|
2834
|
+
...F.map(M)
|
|
2888
2835
|
] : [];
|
|
2889
|
-
}),
|
|
2890
|
-
o &&
|
|
2836
|
+
}), z = d && /* @__PURE__ */ e.jsxs("div", { ref: m, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: x, children: [
|
|
2837
|
+
o && $ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2891
2838
|
/* @__PURE__ */ e.jsxs(
|
|
2892
2839
|
"button",
|
|
2893
2840
|
{
|
|
@@ -2897,23 +2844,23 @@ function _n({
|
|
|
2897
2844
|
"ds-model-picker__item--auto",
|
|
2898
2845
|
s === "auto" && "ds-model-picker__item--active"
|
|
2899
2846
|
].filter(Boolean).join(" "),
|
|
2900
|
-
onClick: () =>
|
|
2847
|
+
onClick: () => B("auto"),
|
|
2901
2848
|
children: [
|
|
2902
|
-
/* @__PURE__ */ e.jsx(
|
|
2849
|
+
/* @__PURE__ */ e.jsx(ht, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2903
2850
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
2904
2851
|
]
|
|
2905
2852
|
}
|
|
2906
2853
|
),
|
|
2907
|
-
|
|
2854
|
+
_.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
2908
2855
|
] }),
|
|
2909
|
-
|
|
2856
|
+
W()
|
|
2910
2857
|
] });
|
|
2911
2858
|
return /* @__PURE__ */ e.jsxs(
|
|
2912
2859
|
"div",
|
|
2913
2860
|
{
|
|
2914
2861
|
ref: p,
|
|
2915
2862
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2916
|
-
...
|
|
2863
|
+
...c,
|
|
2917
2864
|
children: [
|
|
2918
2865
|
/* @__PURE__ */ e.jsxs(
|
|
2919
2866
|
"button",
|
|
@@ -2921,52 +2868,52 @@ function _n({
|
|
|
2921
2868
|
ref: h,
|
|
2922
2869
|
type: "button",
|
|
2923
2870
|
className: "ds-model-picker__trigger",
|
|
2924
|
-
onClick: () => u((
|
|
2871
|
+
onClick: () => u((j) => !j),
|
|
2925
2872
|
"aria-haspopup": "listbox",
|
|
2926
|
-
"aria-expanded":
|
|
2873
|
+
"aria-expanded": d,
|
|
2927
2874
|
children: [
|
|
2928
2875
|
N != null && N.icon ? /* @__PURE__ */ e.jsx("span", { children: N.icon }) : /* @__PURE__ */ e.jsx(Fe, { size: 12, strokeWidth: 1.5 }),
|
|
2929
2876
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (N == null ? void 0 : N.displayName) || (N == null ? void 0 : N.name) || s }),
|
|
2930
|
-
S && (N == null ? void 0 : N.tier) && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant:
|
|
2877
|
+
S && (N == null ? void 0 : N.tier) && /* @__PURE__ */ e.jsx(fe, { size: "xs", variant: Ge[N.tier] || "default", children: N.tier })
|
|
2931
2878
|
]
|
|
2932
2879
|
}
|
|
2933
2880
|
),
|
|
2934
|
-
typeof document < "u" && me.createPortal(
|
|
2881
|
+
typeof document < "u" && me.createPortal(z, document.body)
|
|
2935
2882
|
]
|
|
2936
2883
|
}
|
|
2937
2884
|
);
|
|
2938
2885
|
}
|
|
2939
|
-
const
|
|
2886
|
+
const Gt = ({ filename: t, pages: s }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
2940
2887
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: t }),
|
|
2941
2888
|
s.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Te(s) })
|
|
2942
2889
|
] });
|
|
2943
2890
|
function Te(t) {
|
|
2944
2891
|
return t != null && t.length ? "p. " + t.join(", ") : null;
|
|
2945
2892
|
}
|
|
2946
|
-
function
|
|
2893
|
+
function Kt(t) {
|
|
2947
2894
|
const s = /* @__PURE__ */ new Map();
|
|
2948
2895
|
for (const n of t)
|
|
2949
2896
|
s.has(n.filename) || s.set(n.filename, { filename: n.filename, url: n.url, items: [] }), s.get(n.filename).items.push(n);
|
|
2950
2897
|
return [...s.values()];
|
|
2951
2898
|
}
|
|
2952
|
-
function
|
|
2899
|
+
function xn({
|
|
2953
2900
|
sources: t = [],
|
|
2954
2901
|
layout: s = "list",
|
|
2955
2902
|
title: n = "Sources",
|
|
2956
2903
|
maxVisible: r = 5,
|
|
2957
2904
|
onSourceClick: a
|
|
2958
2905
|
}) {
|
|
2959
|
-
const [o, i] = I(!1), l =
|
|
2906
|
+
const [o, i] = I(!1), l = Kt(t), c = l.length > r, d = o ? l : l.slice(0, r), u = t.some((h) => h.snippet), p = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2960
2907
|
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2961
|
-
|
|
2962
|
-
const m = h.items.map((
|
|
2908
|
+
d.map((h) => {
|
|
2909
|
+
const m = h.items.map((b) => b.page).filter(Boolean), x = !!a;
|
|
2963
2910
|
return /* @__PURE__ */ e.jsxs(
|
|
2964
2911
|
"div",
|
|
2965
2912
|
{
|
|
2966
2913
|
className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2967
2914
|
onClick: x ? () => a(h.items[0]) : void 0,
|
|
2968
2915
|
children: [
|
|
2969
|
-
/* @__PURE__ */ e.jsx(
|
|
2916
|
+
/* @__PURE__ */ e.jsx(xt, { size: C[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2970
2917
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2971
2918
|
m.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Te(m) })
|
|
2972
2919
|
]
|
|
@@ -2974,26 +2921,26 @@ function bn({
|
|
|
2974
2921
|
h.filename
|
|
2975
2922
|
);
|
|
2976
2923
|
}),
|
|
2977
|
-
|
|
2924
|
+
c && !o && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2978
2925
|
"+",
|
|
2979
2926
|
l.length - r,
|
|
2980
2927
|
" more sources"
|
|
2981
2928
|
] })
|
|
2982
2929
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2983
2930
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2984
|
-
|
|
2985
|
-
const m = h.items.map((
|
|
2931
|
+
d.map((h) => {
|
|
2932
|
+
const m = h.items.map((b) => b.page).filter(Boolean), x = !!a;
|
|
2986
2933
|
return u ? /* @__PURE__ */ e.jsx(
|
|
2987
2934
|
Be,
|
|
2988
2935
|
{
|
|
2989
|
-
title: /* @__PURE__ */ e.jsx(
|
|
2936
|
+
title: /* @__PURE__ */ e.jsx(Gt, { filename: h.filename, pages: m }),
|
|
2990
2937
|
padding: "s",
|
|
2991
|
-
children: h.items.map((
|
|
2938
|
+
children: h.items.map((b, g) => /* @__PURE__ */ e.jsx(
|
|
2992
2939
|
"div",
|
|
2993
2940
|
{
|
|
2994
2941
|
className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2995
|
-
onClick: x ? () => a(
|
|
2996
|
-
children:
|
|
2942
|
+
onClick: x ? () => a(b) : void 0,
|
|
2943
|
+
children: b.snippet ?? `p. ${b.page}`
|
|
2997
2944
|
},
|
|
2998
2945
|
g
|
|
2999
2946
|
))
|
|
@@ -3012,17 +2959,17 @@ function bn({
|
|
|
3012
2959
|
h.filename
|
|
3013
2960
|
);
|
|
3014
2961
|
}),
|
|
3015
|
-
|
|
2962
|
+
c && !o && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
3016
2963
|
"+",
|
|
3017
2964
|
l.length - r,
|
|
3018
2965
|
" more sources"
|
|
3019
2966
|
] })
|
|
3020
2967
|
] });
|
|
3021
2968
|
}
|
|
3022
|
-
function
|
|
2969
|
+
function Ke(t) {
|
|
3023
2970
|
return t >= 1e6 ? (t / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : t >= 1e3 ? (t / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(t);
|
|
3024
2971
|
}
|
|
3025
|
-
function
|
|
2972
|
+
function vn({
|
|
3026
2973
|
used: t,
|
|
3027
2974
|
limit: s,
|
|
3028
2975
|
size: n = "s",
|
|
@@ -3031,7 +2978,7 @@ function jn({
|
|
|
3031
2978
|
warningThreshold: o = 0.8,
|
|
3032
2979
|
errorThreshold: i = 1
|
|
3033
2980
|
}) {
|
|
3034
|
-
const l = s > 0 ? t / s : 0,
|
|
2981
|
+
const l = s > 0 ? t / s : 0, c = Math.min(l * 100, 100), d = l >= i ? "error" : l >= o ? "warning" : "normal";
|
|
3035
2982
|
return /* @__PURE__ */ e.jsxs(
|
|
3036
2983
|
"div",
|
|
3037
2984
|
{
|
|
@@ -3043,15 +2990,15 @@ function jn({
|
|
|
3043
2990
|
/* @__PURE__ */ e.jsx("div", { className: "ds-token-counter__track", children: /* @__PURE__ */ e.jsx(
|
|
3044
2991
|
"div",
|
|
3045
2992
|
{
|
|
3046
|
-
className: `ds-token-counter__fill ds-token-counter__fill--${
|
|
3047
|
-
style: { width: `${
|
|
2993
|
+
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2994
|
+
style: { width: `${c}%` }
|
|
3048
2995
|
}
|
|
3049
2996
|
) }),
|
|
3050
|
-
(r || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${
|
|
2997
|
+
(r || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
3051
2998
|
r && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
3052
|
-
|
|
2999
|
+
Ke(t),
|
|
3053
3000
|
" / ",
|
|
3054
|
-
|
|
3001
|
+
Ke(s)
|
|
3055
3002
|
] }),
|
|
3056
3003
|
a && /* @__PURE__ */ e.jsxs("span", { style: { marginLeft: "auto" }, children: [
|
|
3057
3004
|
Math.round(l * 100),
|
|
@@ -3062,42 +3009,42 @@ function jn({
|
|
|
3062
3009
|
}
|
|
3063
3010
|
);
|
|
3064
3011
|
}
|
|
3065
|
-
const
|
|
3066
|
-
function
|
|
3012
|
+
const Xe = 5;
|
|
3013
|
+
function Xt(t) {
|
|
3067
3014
|
return t < 0.34 ? "low" : t < 0.67 ? "medium" : "high";
|
|
3068
3015
|
}
|
|
3069
|
-
function
|
|
3016
|
+
function _n({
|
|
3070
3017
|
value: t = 0,
|
|
3071
3018
|
size: s = "xs",
|
|
3072
3019
|
showLabel: n = "none",
|
|
3073
3020
|
layout: r = "inline"
|
|
3074
3021
|
}) {
|
|
3075
|
-
const a = Math.max(0, Math.min(1, t)), o = Math.round(a *
|
|
3022
|
+
const a = Math.max(0, Math.min(1, t)), o = Math.round(a * Xe), i = Xt(a);
|
|
3076
3023
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
3077
3024
|
"ds-confidence-bar",
|
|
3078
3025
|
`ds-confidence-bar--${s}`,
|
|
3079
3026
|
`ds-confidence-bar--${i}`,
|
|
3080
3027
|
r === "block" && "ds-confidence-bar--block"
|
|
3081
3028
|
].filter(Boolean).join(" "), children: [
|
|
3082
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length:
|
|
3029
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Xe }, (l, c) => /* @__PURE__ */ e.jsx(
|
|
3083
3030
|
"div",
|
|
3084
3031
|
{
|
|
3085
|
-
className: `ds-confidence-bar__seg${
|
|
3032
|
+
className: `ds-confidence-bar__seg${c < o ? " ds-confidence-bar__seg--filled" : ""}`
|
|
3086
3033
|
},
|
|
3087
|
-
|
|
3034
|
+
c
|
|
3088
3035
|
)) }),
|
|
3089
3036
|
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
3090
3037
|
] });
|
|
3091
3038
|
}
|
|
3092
|
-
const
|
|
3039
|
+
const Jt = { add: "+", remove: "-", context: " " };
|
|
3093
3040
|
function ye({ line: t, lineNumbers: s }) {
|
|
3094
3041
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${t.type}`, children: [
|
|
3095
3042
|
s && t.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: t.lineNo }),
|
|
3096
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children:
|
|
3043
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Jt[t.type] }),
|
|
3097
3044
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: t.text })
|
|
3098
3045
|
] });
|
|
3099
3046
|
}
|
|
3100
|
-
function
|
|
3047
|
+
function bn({
|
|
3101
3048
|
lines: t = [],
|
|
3102
3049
|
layout: s = "inline",
|
|
3103
3050
|
wordWrap: n = !1,
|
|
@@ -3111,21 +3058,21 @@ function wn({
|
|
|
3111
3058
|
n && "ds-diff-view--wrap"
|
|
3112
3059
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
3113
3060
|
if (s === "split") {
|
|
3114
|
-
const
|
|
3061
|
+
const c = t.filter((u) => u.type === "remove" || u.type === "context"), d = t.filter((u) => u.type === "add" || u.type === "context");
|
|
3115
3062
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3116
3063
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: o }),
|
|
3117
3064
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
|
|
3118
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children:
|
|
3119
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children:
|
|
3065
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((u, p) => /* @__PURE__ */ e.jsx(ye, { line: u, lineNumbers: r }, p)) }),
|
|
3066
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((u, p) => /* @__PURE__ */ e.jsx(ye, { line: u, lineNumbers: r }, p)) })
|
|
3120
3067
|
] })
|
|
3121
3068
|
] });
|
|
3122
3069
|
}
|
|
3123
3070
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3124
3071
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: o }),
|
|
3125
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((
|
|
3072
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((c, d) => /* @__PURE__ */ e.jsx(ye, { line: c, lineNumbers: r }, d)) })
|
|
3126
3073
|
] });
|
|
3127
3074
|
}
|
|
3128
|
-
function
|
|
3075
|
+
function Zt({
|
|
3129
3076
|
value: t = "idle",
|
|
3130
3077
|
onLike: s,
|
|
3131
3078
|
onDislike: n,
|
|
@@ -3155,9 +3102,9 @@ function es({
|
|
|
3155
3102
|
"aria-label": "Like",
|
|
3156
3103
|
"aria-pressed": t === "liked",
|
|
3157
3104
|
children: /* @__PURE__ */ e.jsx(
|
|
3158
|
-
|
|
3105
|
+
vt,
|
|
3159
3106
|
{
|
|
3160
|
-
size:
|
|
3107
|
+
size: C[1],
|
|
3161
3108
|
strokeWidth: 1.5,
|
|
3162
3109
|
fill: t === "liked" ? "currentColor" : "none"
|
|
3163
3110
|
}
|
|
@@ -3176,9 +3123,9 @@ function es({
|
|
|
3176
3123
|
"aria-label": "Dislike",
|
|
3177
3124
|
"aria-pressed": t === "disliked",
|
|
3178
3125
|
children: /* @__PURE__ */ e.jsx(
|
|
3179
|
-
|
|
3126
|
+
_t,
|
|
3180
3127
|
{
|
|
3181
|
-
size:
|
|
3128
|
+
size: C[1],
|
|
3182
3129
|
strokeWidth: 1.5,
|
|
3183
3130
|
fill: t === "disliked" ? "currentColor" : "none"
|
|
3184
3131
|
}
|
|
@@ -3189,7 +3136,7 @@ function es({
|
|
|
3189
3136
|
}
|
|
3190
3137
|
);
|
|
3191
3138
|
}
|
|
3192
|
-
function
|
|
3139
|
+
function Qt(t) {
|
|
3193
3140
|
const s = t instanceof Date ? t : new Date(t);
|
|
3194
3141
|
if (isNaN(s)) return null;
|
|
3195
3142
|
const n = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(n.getFullYear(), n.getMonth(), n.getDate()), o = new Date(a - 864e5);
|
|
@@ -3198,7 +3145,7 @@ function ts(t) {
|
|
|
3198
3145
|
const i = s.getDate(), l = s.toLocaleString([], { month: "short" });
|
|
3199
3146
|
return `${i} ${l} ${r}`;
|
|
3200
3147
|
}
|
|
3201
|
-
function
|
|
3148
|
+
function jn({
|
|
3202
3149
|
role: t = "assistant",
|
|
3203
3150
|
text: s,
|
|
3204
3151
|
timestamp: n,
|
|
@@ -3208,29 +3155,29 @@ function gn({
|
|
|
3208
3155
|
className: i = "",
|
|
3209
3156
|
...l
|
|
3210
3157
|
}) {
|
|
3211
|
-
const
|
|
3212
|
-
return !
|
|
3158
|
+
const c = t === "assistant" && (a || o), d = !!s, u = n ? Qt(n) : null;
|
|
3159
|
+
return !c && !d && !u ? null : /* @__PURE__ */ e.jsxs(
|
|
3213
3160
|
"div",
|
|
3214
3161
|
{
|
|
3215
3162
|
className: ["ds-message-footer", `ds-message-footer--${t}`, i].filter(Boolean).join(" "),
|
|
3216
3163
|
...l,
|
|
3217
3164
|
children: [
|
|
3218
3165
|
t === "user" && u && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: u }),
|
|
3219
|
-
|
|
3220
|
-
|
|
3166
|
+
c && /* @__PURE__ */ e.jsx(Zt, { className: "ds-message-action", value: r, onLike: a, onDislike: o }),
|
|
3167
|
+
d && /* @__PURE__ */ e.jsx(Yt, { className: "ds-message-action", text: s }),
|
|
3221
3168
|
t === "assistant" && u && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: u })
|
|
3222
3169
|
]
|
|
3223
3170
|
}
|
|
3224
3171
|
);
|
|
3225
3172
|
}
|
|
3226
|
-
function
|
|
3173
|
+
function Nn({ label: t, className: s = "", ...n }) {
|
|
3227
3174
|
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", s].filter(Boolean).join(" "), ...n, children: [
|
|
3228
3175
|
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
3229
3176
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: t })
|
|
3230
3177
|
] });
|
|
3231
3178
|
}
|
|
3232
|
-
function
|
|
3233
|
-
const o = t === "dark", i = s ?? o, l = o ? "rgba(255,250,250,0.05)" : "var(--color-border-light)",
|
|
3179
|
+
function wn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
3180
|
+
const o = t === "dark", i = s ?? o, l = o ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", c = o ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
3234
3181
|
return /* @__PURE__ */ e.jsx(
|
|
3235
3182
|
"div",
|
|
3236
3183
|
{
|
|
@@ -3255,8 +3202,8 @@ function kn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
|
3255
3202
|
backgroundImage: [
|
|
3256
3203
|
`linear-gradient(${l} 1px, transparent 1px)`,
|
|
3257
3204
|
`linear-gradient(90deg, ${l} 1px, transparent 1px)`,
|
|
3258
|
-
`linear-gradient(${
|
|
3259
|
-
`linear-gradient(90deg, ${
|
|
3205
|
+
`linear-gradient(${c} 1px, transparent 1px)`,
|
|
3206
|
+
`linear-gradient(90deg, ${c} 1px, transparent 1px)`
|
|
3260
3207
|
].join(", "),
|
|
3261
3208
|
backgroundSize: "80px 80px, 80px 80px, 16px 16px, 16px 16px",
|
|
3262
3209
|
backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
|
|
@@ -3270,7 +3217,7 @@ function kn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
|
3270
3217
|
}
|
|
3271
3218
|
);
|
|
3272
3219
|
}
|
|
3273
|
-
function
|
|
3220
|
+
function gn({ children: t, axis: s = "y", style: n, className: r = "", ...a }) {
|
|
3274
3221
|
const o = s === "x" ? { overflowX: "auto", overflowY: "hidden" } : s === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
3275
3222
|
return /* @__PURE__ */ e.jsx(
|
|
3276
3223
|
"div",
|
|
@@ -3282,11 +3229,11 @@ function En({ children: t, axis: s = "y", style: n, className: r = "", ...a }) {
|
|
|
3282
3229
|
}
|
|
3283
3230
|
);
|
|
3284
3231
|
}
|
|
3285
|
-
const ke = 280,
|
|
3286
|
-
function
|
|
3232
|
+
const ke = 280, es = 22, ts = 14, ce = 8, Ne = 6, ss = 200;
|
|
3233
|
+
function ns(t) {
|
|
3287
3234
|
return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
|
|
3288
3235
|
}
|
|
3289
|
-
function
|
|
3236
|
+
function rs(t, s, n, r) {
|
|
3290
3237
|
const a = window.innerWidth, o = window.innerHeight;
|
|
3291
3238
|
if (o - t.bottom >= s + r + ce) return "bottom";
|
|
3292
3239
|
if (t.top >= s + r + ce) return "top";
|
|
@@ -3295,26 +3242,26 @@ function os(t, s, n, r) {
|
|
|
3295
3242
|
const i = Math.max(t.top, o - t.bottom, a - t.right, t.left);
|
|
3296
3243
|
return i === o - t.bottom ? "bottom" : i === t.top ? "top" : i === a - t.right ? "right" : "left";
|
|
3297
3244
|
}
|
|
3298
|
-
function
|
|
3245
|
+
function as(t, s, n, r, a) {
|
|
3299
3246
|
const o = window.innerWidth, i = window.innerHeight;
|
|
3300
|
-
let l,
|
|
3247
|
+
let l, c;
|
|
3301
3248
|
switch (t) {
|
|
3302
3249
|
case "top":
|
|
3303
|
-
l = s.top - n - a,
|
|
3250
|
+
l = s.top - n - a, c = s.left + s.width / 2 - r / 2;
|
|
3304
3251
|
break;
|
|
3305
3252
|
case "bottom":
|
|
3306
|
-
l = s.bottom + a,
|
|
3253
|
+
l = s.bottom + a, c = s.left + s.width / 2 - r / 2;
|
|
3307
3254
|
break;
|
|
3308
3255
|
case "left":
|
|
3309
|
-
l = s.top + s.height / 2 - n / 2,
|
|
3256
|
+
l = s.top + s.height / 2 - n / 2, c = s.left - r - a;
|
|
3310
3257
|
break;
|
|
3311
3258
|
default:
|
|
3312
|
-
l = s.top + s.height / 2 - n / 2,
|
|
3259
|
+
l = s.top + s.height / 2 - n / 2, c = s.right + a;
|
|
3313
3260
|
}
|
|
3314
|
-
const
|
|
3315
|
-
return { top: Math.max(ce, Math.min(i - n - ce, l)), left:
|
|
3261
|
+
const d = Math.max(ce, Math.min(o - r - ce, c));
|
|
3262
|
+
return { top: Math.max(ce, Math.min(i - n - ce, l)), left: d, arrowOffset: c - d };
|
|
3316
3263
|
}
|
|
3317
|
-
function
|
|
3264
|
+
function yn({
|
|
3318
3265
|
steps: t,
|
|
3319
3266
|
currentStep: s,
|
|
3320
3267
|
onNext: n,
|
|
@@ -3323,83 +3270,83 @@ function $n({
|
|
|
3323
3270
|
onFinish: o,
|
|
3324
3271
|
overlay: i = !0,
|
|
3325
3272
|
ring: l = !0,
|
|
3326
|
-
labelNext:
|
|
3327
|
-
labelBack:
|
|
3273
|
+
labelNext: c = "Next",
|
|
3274
|
+
labelBack: d = "Back",
|
|
3328
3275
|
labelSkip: u = "Skip tour",
|
|
3329
3276
|
labelFinish: p = "Done",
|
|
3330
3277
|
statePrimary: h = "idle",
|
|
3331
3278
|
stateBack: m = "idle"
|
|
3332
3279
|
}) {
|
|
3333
|
-
const x = R(null),
|
|
3334
|
-
|
|
3335
|
-
const [
|
|
3336
|
-
const D =
|
|
3280
|
+
const x = R(null), b = R(t), g = R(s), $ = R(l);
|
|
3281
|
+
b.current = t, g.current = s, $.current = l;
|
|
3282
|
+
const [_, N] = I(!1), [y, S] = I({ position: "fixed", visibility: "hidden", width: ke }), [B, M] = I("bottom"), [W, z] = I(null), j = R(!1), F = t[s], K = s === t.length - 1, V = le(() => {
|
|
3283
|
+
const D = b.current[g.current];
|
|
3337
3284
|
if (!D || !x.current) return;
|
|
3338
|
-
const
|
|
3339
|
-
if (!
|
|
3340
|
-
const
|
|
3341
|
-
|
|
3285
|
+
const v = ns(D.target);
|
|
3286
|
+
if (!v) return;
|
|
3287
|
+
const k = v.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, G = ke, E = $.current ? es : ts, f = D.position || rs(k, U, G, E), { top: T, left: O, arrowOffset: Y } = as(f, k, U, G, E);
|
|
3288
|
+
M(f), S({
|
|
3342
3289
|
position: "fixed",
|
|
3343
3290
|
top: T,
|
|
3344
|
-
left:
|
|
3291
|
+
left: O,
|
|
3345
3292
|
width: ke,
|
|
3346
3293
|
visibility: "visible",
|
|
3347
3294
|
"--arrow-offset": `${Y}px`
|
|
3348
|
-
}),
|
|
3349
|
-
top:
|
|
3350
|
-
left:
|
|
3351
|
-
width:
|
|
3352
|
-
height:
|
|
3295
|
+
}), z({
|
|
3296
|
+
top: k.top - Ne,
|
|
3297
|
+
left: k.left - Ne,
|
|
3298
|
+
width: k.width + Ne * 2,
|
|
3299
|
+
height: k.height + Ne * 2
|
|
3353
3300
|
});
|
|
3354
3301
|
}, []);
|
|
3355
|
-
return
|
|
3302
|
+
return P(() => {
|
|
3356
3303
|
window.addEventListener("scroll", V, !0), window.addEventListener("resize", V);
|
|
3357
3304
|
const D = requestAnimationFrame(() => {
|
|
3358
|
-
V(), N(!0),
|
|
3305
|
+
V(), N(!0), j.current = !0;
|
|
3359
3306
|
});
|
|
3360
3307
|
return () => {
|
|
3361
3308
|
cancelAnimationFrame(D), window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", V);
|
|
3362
3309
|
};
|
|
3363
|
-
}, []),
|
|
3364
|
-
if (!
|
|
3310
|
+
}, []), P(() => {
|
|
3311
|
+
if (!j.current) return;
|
|
3365
3312
|
N(!1);
|
|
3366
3313
|
const D = setTimeout(() => {
|
|
3367
|
-
S((
|
|
3314
|
+
S((v) => ({ ...v, visibility: "hidden" })), requestAnimationFrame(() => {
|
|
3368
3315
|
V(), N(!0);
|
|
3369
3316
|
});
|
|
3370
|
-
},
|
|
3317
|
+
}, ss + 20);
|
|
3371
3318
|
return () => clearTimeout(D);
|
|
3372
|
-
}, [s]),
|
|
3373
|
-
|
|
3374
|
-
}, [
|
|
3375
|
-
const D = (
|
|
3376
|
-
|
|
3319
|
+
}, [s]), P(() => {
|
|
3320
|
+
_ && x.current && x.current.focus({ preventScroll: !0 });
|
|
3321
|
+
}, [_]), P(() => {
|
|
3322
|
+
const D = (v) => {
|
|
3323
|
+
v.key === "Escape" && a();
|
|
3377
3324
|
};
|
|
3378
3325
|
return document.addEventListener("keydown", D), () => document.removeEventListener("keydown", D);
|
|
3379
|
-
}, [a]),
|
|
3380
|
-
if (!
|
|
3381
|
-
const D = (
|
|
3382
|
-
if (
|
|
3383
|
-
const
|
|
3326
|
+
}, [a]), P(() => {
|
|
3327
|
+
if (!_) return;
|
|
3328
|
+
const D = (v) => {
|
|
3329
|
+
if (v.key !== "Tab" || !x.current) return;
|
|
3330
|
+
const k = Array.from(
|
|
3384
3331
|
x.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
|
|
3385
3332
|
);
|
|
3386
|
-
if (!
|
|
3387
|
-
const A =
|
|
3388
|
-
|
|
3333
|
+
if (!k.length) return;
|
|
3334
|
+
const A = k[0], U = k[k.length - 1];
|
|
3335
|
+
v.shiftKey && document.activeElement === A ? (v.preventDefault(), U.focus()) : !v.shiftKey && document.activeElement === U && (v.preventDefault(), A.focus());
|
|
3389
3336
|
};
|
|
3390
3337
|
return document.addEventListener("keydown", D), () => document.removeEventListener("keydown", D);
|
|
3391
|
-
}, [
|
|
3338
|
+
}, [_]), !F || typeof document > "u" ? null : me.createPortal(
|
|
3392
3339
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3393
|
-
|
|
3340
|
+
W && /* @__PURE__ */ e.jsx(
|
|
3394
3341
|
"div",
|
|
3395
3342
|
{
|
|
3396
3343
|
className: [
|
|
3397
3344
|
"ds-coachmark__spotlight",
|
|
3398
3345
|
i && "ds-coachmark__spotlight--overlay",
|
|
3399
3346
|
!l && "ds-coachmark__spotlight--no-ring",
|
|
3400
|
-
|
|
3347
|
+
_ && "ds-coachmark__spotlight--visible"
|
|
3401
3348
|
].filter(Boolean).join(" "),
|
|
3402
|
-
style:
|
|
3349
|
+
style: W,
|
|
3403
3350
|
"aria-hidden": "true"
|
|
3404
3351
|
}
|
|
3405
3352
|
),
|
|
@@ -3411,13 +3358,13 @@ function $n({
|
|
|
3411
3358
|
role: "dialog",
|
|
3412
3359
|
"aria-modal": "false",
|
|
3413
3360
|
"aria-live": "polite",
|
|
3414
|
-
"aria-label":
|
|
3361
|
+
"aria-label": F.title ?? `Step ${s + 1} of ${t.length}`,
|
|
3415
3362
|
className: [
|
|
3416
3363
|
"ds-coachmark__bubble",
|
|
3417
|
-
`ds-coachmark__bubble--${
|
|
3418
|
-
|
|
3364
|
+
`ds-coachmark__bubble--${B}`,
|
|
3365
|
+
_ && "ds-coachmark__bubble--visible"
|
|
3419
3366
|
].filter(Boolean).join(" "),
|
|
3420
|
-
style:
|
|
3367
|
+
style: y,
|
|
3421
3368
|
tabIndex: -1,
|
|
3422
3369
|
children: [
|
|
3423
3370
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3427,11 +3374,11 @@ function $n({
|
|
|
3427
3374
|
className: "ds-coachmark__close",
|
|
3428
3375
|
onClick: a,
|
|
3429
3376
|
"aria-label": u,
|
|
3430
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3377
|
+
children: /* @__PURE__ */ e.jsx(ee, { size: 16, strokeWidth: 2 })
|
|
3431
3378
|
}
|
|
3432
3379
|
),
|
|
3433
|
-
|
|
3434
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children:
|
|
3380
|
+
F.title && /* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__title", children: F.title }),
|
|
3381
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children: F.content }),
|
|
3435
3382
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer", children: [
|
|
3436
3383
|
t.length > 1 && /* @__PURE__ */ e.jsxs("span", { className: "ds-coachmark__counter", children: [
|
|
3437
3384
|
s + 1,
|
|
@@ -3439,8 +3386,8 @@ function $n({
|
|
|
3439
3386
|
t.length
|
|
3440
3387
|
] }),
|
|
3441
3388
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
|
|
3442
|
-
s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state: m, onClick: r, children:
|
|
3443
|
-
/* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick: K ? o : n, children: K ? p :
|
|
3389
|
+
s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state: m, onClick: r, children: d }),
|
|
3390
|
+
/* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick: K ? o : n, children: K ? p : c })
|
|
3444
3391
|
] })
|
|
3445
3392
|
] })
|
|
3446
3393
|
]
|
|
@@ -3450,8 +3397,8 @@ function $n({
|
|
|
3450
3397
|
document.body
|
|
3451
3398
|
);
|
|
3452
3399
|
}
|
|
3453
|
-
function
|
|
3454
|
-
const { storageKey: n } = s, [r, a] = I(0), [o, i] = I(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done",
|
|
3400
|
+
function kn(t, s = {}) {
|
|
3401
|
+
const { storageKey: n } = s, [r, a] = I(0), [o, i] = I(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = le(() => {
|
|
3455
3402
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3456
3403
|
}, [n]);
|
|
3457
3404
|
return {
|
|
@@ -3460,13 +3407,13 @@ function Tn(t, s = {}) {
|
|
|
3460
3407
|
start: () => {
|
|
3461
3408
|
l() || (a(0), i(!0));
|
|
3462
3409
|
},
|
|
3463
|
-
next: () => a((
|
|
3464
|
-
back: () => a((
|
|
3465
|
-
skip:
|
|
3466
|
-
finish:
|
|
3410
|
+
next: () => a((d) => Math.min(d + 1, t.length - 1)),
|
|
3411
|
+
back: () => a((d) => Math.max(d - 1, 0)),
|
|
3412
|
+
skip: c,
|
|
3413
|
+
finish: c
|
|
3467
3414
|
};
|
|
3468
3415
|
}
|
|
3469
|
-
function
|
|
3416
|
+
function En() {
|
|
3470
3417
|
const t = R(null), s = le(() => {
|
|
3471
3418
|
const n = t.current;
|
|
3472
3419
|
if (!n) return;
|
|
@@ -3480,94 +3427,92 @@ function Rn() {
|
|
|
3480
3427
|
}
|
|
3481
3428
|
export {
|
|
3482
3429
|
Be as Accordion,
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3430
|
+
bs as Alert,
|
|
3431
|
+
nn as AnimatedNumber,
|
|
3432
|
+
Ss as Avatar,
|
|
3486
3433
|
fe as Badge,
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3434
|
+
en as Banner,
|
|
3435
|
+
Ns as BottomSheet,
|
|
3436
|
+
Cs as Breadcrumb,
|
|
3490
3437
|
ae as Button,
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
xs as
|
|
3507
|
-
vs as
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
gn as MessageFooter,
|
|
3515
|
-
ws as Modal,
|
|
3438
|
+
ms as Card,
|
|
3439
|
+
fn as ChatMessage,
|
|
3440
|
+
Ts as Checkbox,
|
|
3441
|
+
yn as Coachmark,
|
|
3442
|
+
ws as Code,
|
|
3443
|
+
$t as CodeAccordion,
|
|
3444
|
+
_n as ConfidenceBar,
|
|
3445
|
+
Yt as CopyButton,
|
|
3446
|
+
bn as DiffView,
|
|
3447
|
+
tn as Dropdown,
|
|
3448
|
+
zs as EmptyState,
|
|
3449
|
+
wn as EngineerGrid,
|
|
3450
|
+
Fs as FormField,
|
|
3451
|
+
ps as H1,
|
|
3452
|
+
hs as H2,
|
|
3453
|
+
xs as H3,
|
|
3454
|
+
vs as H4,
|
|
3455
|
+
rn as InView,
|
|
3456
|
+
cs as Input,
|
|
3457
|
+
gs as Link,
|
|
3458
|
+
Zt as MessageFeedback,
|
|
3459
|
+
jn as MessageFooter,
|
|
3460
|
+
js as Modal,
|
|
3516
3461
|
he as ModalFooter,
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3462
|
+
hn as ModelPicker,
|
|
3463
|
+
Vs as NavRail,
|
|
3464
|
+
Zs as NavRailAgent,
|
|
3465
|
+
Hs as NavRailBody,
|
|
3466
|
+
Js as NavRailCustomItem,
|
|
3467
|
+
Ks as NavRailDivider,
|
|
3468
|
+
Qs as NavRailFlyout,
|
|
3469
|
+
Gs as NavRailFooter,
|
|
3470
|
+
qs as NavRailHeader,
|
|
3471
|
+
Ys as NavRailItem,
|
|
3472
|
+
Xs as NavRailRecents,
|
|
3473
|
+
_s as P1,
|
|
3474
|
+
gt as P2,
|
|
3530
3475
|
Qe as P3,
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3476
|
+
Os as Pagination,
|
|
3477
|
+
sn as ProgressBar,
|
|
3478
|
+
pn as PromptInput,
|
|
3479
|
+
Rs as Radio,
|
|
3480
|
+
cn as ReasoningBlock,
|
|
3481
|
+
gn as Scrollable,
|
|
3482
|
+
Es as SegmentedControl,
|
|
3483
|
+
us as Select,
|
|
3484
|
+
Us as SidePage,
|
|
3485
|
+
Oe as SidePageFooter,
|
|
3486
|
+
St as Skeleton,
|
|
3487
|
+
xn as SourcesPanel,
|
|
3488
|
+
Nt as Spinner,
|
|
3489
|
+
Ws as Stat,
|
|
3490
|
+
dn as StepIndicator,
|
|
3491
|
+
fs as Stepper,
|
|
3492
|
+
un as StreamingText,
|
|
3493
|
+
ks as Tab,
|
|
3494
|
+
As as Table,
|
|
3495
|
+
Is as TableBody,
|
|
3496
|
+
Ds as TableHead,
|
|
3497
|
+
Bs as TableRow,
|
|
3498
|
+
Ls as TableSubheaderRow,
|
|
3499
|
+
ys as Tabs,
|
|
3500
|
+
Ms as Td,
|
|
3501
|
+
ds as Textarea,
|
|
3502
|
+
Ps as Th,
|
|
3503
|
+
Nn as ThinkingDot,
|
|
3504
|
+
on as ToastContainer,
|
|
3505
|
+
$s as Toggle,
|
|
3506
|
+
vn as TokenCounter,
|
|
3507
|
+
ln as ToolCallBubble,
|
|
3508
|
+
ln as ToolCallCard,
|
|
3564
3509
|
Le as Tooltip,
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3510
|
+
C as iconSizes,
|
|
3511
|
+
Ft as useAnimatedNumber,
|
|
3512
|
+
Ht as useAnimatedPlaceholder,
|
|
3513
|
+
kn as useCoachmark,
|
|
3514
|
+
Wt as useInView,
|
|
3515
|
+
En as useShake,
|
|
3516
|
+
mn as useStreamScroll,
|
|
3517
|
+
an as useToast
|
|
3573
3518
|
};
|