@donkit-ai/design-system 1.4.44 → 1.4.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +11 -0
- package/dist/index.es.js +927 -863
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Check as
|
|
1
|
+
import U, { useState as D, useRef as k, useEffect as B, useLayoutEffect as Ve } from "react";
|
|
2
|
+
import { Check as we, X as te, ChevronDown as xe, Minus as Ye, Plus as qe, XCircle as ge, AlertTriangle as ye, CheckCircle as ke, Info as Ee, ChevronUp as He, ChevronsUpDown as Ke, ChevronLeft as Xe, ChevronRight as Ge, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Se, Square as es, ArrowUp as ss, Zap as ts, Cpu as De, FileText as ns, ThumbsUp as rs, ThumbsDown as as } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const I = {
|
|
5
5
|
1: 16,
|
|
@@ -8,7 +8,7 @@ const I = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var _e = { exports: {} }, fe = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -18,29 +18,29 @@ var je = { exports: {} }, ue = {};
|
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
21
|
+
var Ie;
|
|
22
22
|
function os() {
|
|
23
|
-
if (
|
|
24
|
-
|
|
23
|
+
if (Ie) return fe;
|
|
24
|
+
Ie = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
26
|
-
function
|
|
26
|
+
function n(o, a, r) {
|
|
27
27
|
var i = null;
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (r !== void 0 && (i = "" + r), a.key !== void 0 && (i = "" + a.key), "key" in a) {
|
|
29
|
+
r = {};
|
|
30
30
|
for (var l in a)
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return a =
|
|
31
|
+
l !== "key" && (r[l] = a[l]);
|
|
32
|
+
} else r = a;
|
|
33
|
+
return a = r.ref, {
|
|
34
34
|
$$typeof: s,
|
|
35
35
|
type: o,
|
|
36
36
|
key: i,
|
|
37
37
|
ref: a !== void 0 ? a : null,
|
|
38
|
-
props:
|
|
38
|
+
props: r
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return fe.Fragment = t, fe.jsx = n, fe.jsxs = n, fe;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var me = {};
|
|
44
44
|
/**
|
|
45
45
|
* @license React
|
|
46
46
|
* react-jsx-runtime.development.js
|
|
@@ -61,13 +61,13 @@ function is() {
|
|
|
61
61
|
switch (c) {
|
|
62
62
|
case R:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case L:
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case $:
|
|
67
67
|
return "StrictMode";
|
|
68
68
|
case A:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case
|
|
70
|
+
case q:
|
|
71
71
|
return "SuspenseList";
|
|
72
72
|
case v:
|
|
73
73
|
return "Activity";
|
|
@@ -99,7 +99,7 @@ function is() {
|
|
|
99
99
|
function t(c) {
|
|
100
100
|
return "" + c;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function n(c) {
|
|
103
103
|
try {
|
|
104
104
|
t(c);
|
|
105
105
|
var w = !1;
|
|
@@ -108,8 +108,8 @@ function is() {
|
|
|
108
108
|
}
|
|
109
109
|
if (w) {
|
|
110
110
|
w = console;
|
|
111
|
-
var
|
|
112
|
-
return
|
|
111
|
+
var P = w.error, O = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
|
|
112
|
+
return P.call(
|
|
113
113
|
w,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
115
|
O
|
|
@@ -131,45 +131,45 @@ function is() {
|
|
|
131
131
|
var c = X.A;
|
|
132
132
|
return c === null ? null : c.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function r() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(c) {
|
|
138
|
-
if (
|
|
138
|
+
if (V.call(c, "key")) {
|
|
139
139
|
var w = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
140
140
|
if (w && w.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return c.key !== void 0;
|
|
143
143
|
}
|
|
144
144
|
function l(c, w) {
|
|
145
|
-
function
|
|
146
|
-
|
|
145
|
+
function P() {
|
|
146
|
+
E || (E = !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
|
w
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
get:
|
|
151
|
+
P.isReactWarning = !0, Object.defineProperty(c, "key", {
|
|
152
|
+
get: P,
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function m() {
|
|
157
157
|
var c = s(this.type);
|
|
158
|
-
return
|
|
158
|
+
return M[c] || (M[c] = !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
|
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
161
161
|
}
|
|
162
|
-
function d(c, w,
|
|
163
|
-
var W =
|
|
162
|
+
function d(c, w, P, O, ne, ae) {
|
|
163
|
+
var W = P.ref;
|
|
164
164
|
return c = {
|
|
165
165
|
$$typeof: b,
|
|
166
166
|
type: c,
|
|
167
167
|
key: w,
|
|
168
|
-
props:
|
|
168
|
+
props: P,
|
|
169
169
|
_owner: O
|
|
170
170
|
}, (W !== void 0 ? W : null) !== null ? Object.defineProperty(c, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
172
|
+
get: m
|
|
173
173
|
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -184,7 +184,7 @@ function is() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: ne
|
|
188
188
|
}), Object.defineProperty(c, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
@@ -192,7 +192,7 @@ function is() {
|
|
|
192
192
|
value: ae
|
|
193
193
|
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function f(c, w, P, O, ne, ae) {
|
|
196
196
|
var W = w.children;
|
|
197
197
|
if (W !== void 0)
|
|
198
198
|
if (O)
|
|
@@ -205,10 +205,10 @@ function is() {
|
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
207
|
else p(W);
|
|
208
|
-
if (
|
|
208
|
+
if (V.call(w, "key")) {
|
|
209
209
|
W = s(c);
|
|
210
|
-
var Q = Object.keys(w).filter(function(
|
|
211
|
-
return
|
|
210
|
+
var Q = Object.keys(w).filter(function(be) {
|
|
211
|
+
return be !== "key";
|
|
212
212
|
});
|
|
213
213
|
O = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", g[W + O] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -223,20 +223,20 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
W
|
|
224
224
|
), g[W + O] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (W = null,
|
|
227
|
-
|
|
226
|
+
if (W = null, P !== void 0 && (n(P), W = "" + P), i(w) && (n(w.key), W = "" + w.key), "key" in w) {
|
|
227
|
+
P = {};
|
|
228
228
|
for (var oe in w)
|
|
229
|
-
oe !== "key" && (
|
|
230
|
-
} else
|
|
229
|
+
oe !== "key" && (P[oe] = w[oe]);
|
|
230
|
+
} else P = w;
|
|
231
231
|
return W && l(
|
|
232
|
-
|
|
232
|
+
P,
|
|
233
233
|
typeof c == "function" ? c.displayName || c.name || "Unknown" : c
|
|
234
234
|
), d(
|
|
235
235
|
c,
|
|
236
236
|
W,
|
|
237
|
-
|
|
237
|
+
P,
|
|
238
238
|
a(),
|
|
239
|
-
|
|
239
|
+
ne,
|
|
240
240
|
ae
|
|
241
241
|
);
|
|
242
242
|
}
|
|
@@ -246,48 +246,48 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
function h(c) {
|
|
247
247
|
return typeof c == "object" && c !== null && c.$$typeof === b;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var u = U, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), T = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), q = Symbol.for("react.suspense_list"), H = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), v = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), X = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, x = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
u = {
|
|
253
253
|
react_stack_bottom_frame: function(c) {
|
|
254
254
|
return c();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
)(), G = N(o(
|
|
261
|
-
|
|
257
|
+
var E, M = {}, K = u.react_stack_bottom_frame.bind(
|
|
258
|
+
u,
|
|
259
|
+
r
|
|
260
|
+
)(), G = N(o(r)), g = {};
|
|
261
|
+
me.Fragment = R, me.jsx = function(c, w, P) {
|
|
262
262
|
var O = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
263
|
-
return
|
|
263
|
+
return f(
|
|
264
264
|
c,
|
|
265
265
|
w,
|
|
266
|
-
|
|
266
|
+
P,
|
|
267
267
|
!1,
|
|
268
|
-
O ? Error("react-stack-top-frame") :
|
|
268
|
+
O ? Error("react-stack-top-frame") : K,
|
|
269
269
|
O ? N(o(c)) : G
|
|
270
270
|
);
|
|
271
|
-
},
|
|
271
|
+
}, me.jsxs = function(c, w, P) {
|
|
272
272
|
var O = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
273
|
-
return
|
|
273
|
+
return f(
|
|
274
274
|
c,
|
|
275
275
|
w,
|
|
276
|
-
|
|
276
|
+
P,
|
|
277
277
|
!0,
|
|
278
|
-
O ? Error("react-stack-top-frame") :
|
|
278
|
+
O ? Error("react-stack-top-frame") : K,
|
|
279
279
|
O ? N(o(c)) : G
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
|
-
}()),
|
|
282
|
+
}()), me;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
286
|
-
function ls({ size: s = "m", color: t = "default", className:
|
|
284
|
+
process.env.NODE_ENV === "production" ? _e.exports = os() : _e.exports = is();
|
|
285
|
+
var e = _e.exports;
|
|
286
|
+
function ls({ size: s = "m", color: t = "default", className: n = "", ...o }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
290
|
-
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${t}`,
|
|
290
|
+
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${t}`, n].filter(Boolean).join(" "),
|
|
291
291
|
role: "status",
|
|
292
292
|
"aria-label": "Loading",
|
|
293
293
|
...o
|
|
@@ -295,35 +295,35 @@ function ls({ size: s = "m", color: t = "default", className: r = "", ...o }) {
|
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
297
|
const cs = { xs: 12, s: 14, m: 16, l: 20 };
|
|
298
|
-
function
|
|
298
|
+
function ce({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
301
|
-
size:
|
|
301
|
+
size: n = "m",
|
|
302
302
|
fullWidth: o = !1,
|
|
303
303
|
icon: a,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: r = !1,
|
|
305
305
|
state: i = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
307
|
+
type: m = "button",
|
|
308
308
|
href: d,
|
|
309
|
-
"aria-label":
|
|
309
|
+
"aria-label": f,
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const
|
|
313
|
+
const u = a && !s, b = i === "loading", j = i === "success", R = i === "error", $ = b || j || R, L = n === "xs" ? "s" : "m", y = t === "danger" ? "on-accent" : "default", T = cs[n] ?? 16, z = b ? /* @__PURE__ */ e.jsx(ls, { size: L, color: y }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(we, { size: T, strokeWidth: 2.5 }) }) : R ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(te, { size: T, strokeWidth: 2.5 }) }) : null, A = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
|
-
`ds-button--${
|
|
316
|
+
`ds-button--${n}`,
|
|
317
317
|
o && "ds-button--full",
|
|
318
|
-
|
|
318
|
+
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
320
|
+
].filter(Boolean).join(" "), q = i !== "idle" ? i : void 0, H = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
321
|
$ ? z : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
322
322
|
s
|
|
323
323
|
] });
|
|
324
324
|
if (d) {
|
|
325
325
|
const F = (v) => {
|
|
326
|
-
if (
|
|
326
|
+
if (r || b) {
|
|
327
327
|
v.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
@@ -333,12 +333,12 @@ function me({
|
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: A,
|
|
336
|
-
href:
|
|
336
|
+
href: r || b ? void 0 : d,
|
|
337
337
|
onClick: F,
|
|
338
|
-
"aria-label":
|
|
339
|
-
"aria-disabled":
|
|
338
|
+
"aria-label": f,
|
|
339
|
+
"aria-disabled": r || b ? "true" : void 0,
|
|
340
340
|
"aria-busy": b ? "true" : void 0,
|
|
341
|
-
"data-state":
|
|
341
|
+
"data-state": q,
|
|
342
342
|
...h,
|
|
343
343
|
children: H
|
|
344
344
|
}
|
|
@@ -347,33 +347,33 @@ function me({
|
|
|
347
347
|
return /* @__PURE__ */ e.jsx(
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
|
-
type:
|
|
350
|
+
type: m,
|
|
351
351
|
className: A,
|
|
352
|
-
disabled:
|
|
352
|
+
disabled: r,
|
|
353
353
|
onClick: b ? void 0 : l,
|
|
354
|
-
"aria-label":
|
|
354
|
+
"aria-label": f,
|
|
355
355
|
"aria-busy": b ? "true" : void 0,
|
|
356
|
-
"data-state":
|
|
356
|
+
"data-state": q,
|
|
357
357
|
...h,
|
|
358
358
|
children: H
|
|
359
359
|
}
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Vs({
|
|
363
363
|
label: s,
|
|
364
364
|
error: t,
|
|
365
|
-
hint:
|
|
365
|
+
hint: n,
|
|
366
366
|
fullWidth: o = !0,
|
|
367
367
|
icon: a,
|
|
368
|
-
iconRight:
|
|
368
|
+
iconRight: r,
|
|
369
369
|
onIconRightClick: i,
|
|
370
370
|
size: l = "m",
|
|
371
|
-
disabled:
|
|
371
|
+
disabled: m,
|
|
372
372
|
id: d,
|
|
373
|
-
...
|
|
373
|
+
...f
|
|
374
374
|
}) {
|
|
375
|
-
const p = d || `input-${
|
|
376
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${o ? "ds-input-wrapper--full" : ""} ${
|
|
375
|
+
const p = d || `input-${U.useId()}`, h = n ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, b = u || h;
|
|
376
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${o ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
377
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
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 }),
|
|
@@ -381,14 +381,14 @@ function Us({
|
|
|
381
381
|
"input",
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
|
-
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${
|
|
385
|
-
disabled:
|
|
384
|
+
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${r ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
385
|
+
disabled: m,
|
|
386
386
|
"aria-invalid": t ? "true" : "false",
|
|
387
387
|
"aria-describedby": b,
|
|
388
|
-
...
|
|
388
|
+
...f
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
|
|
391
|
+
r && /* @__PURE__ */ e.jsx(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
@@ -396,94 +396,94 @@ function Us({
|
|
|
396
396
|
onClick: i,
|
|
397
397
|
tabIndex: -1,
|
|
398
398
|
"aria-label": "Toggle visibility",
|
|
399
|
-
children:
|
|
399
|
+
children: r
|
|
400
400
|
}
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
403
|
-
|
|
404
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id:
|
|
403
|
+
n && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: n }),
|
|
404
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: u, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Ys({
|
|
408
408
|
label: s,
|
|
409
409
|
error: t,
|
|
410
|
-
hint:
|
|
410
|
+
hint: n,
|
|
411
411
|
fullWidth: o = !0,
|
|
412
412
|
size: a = "m",
|
|
413
|
-
disabled:
|
|
413
|
+
disabled: r,
|
|
414
414
|
id: i,
|
|
415
415
|
resize: l = !0,
|
|
416
|
-
rows:
|
|
416
|
+
rows: m = 3,
|
|
417
417
|
...d
|
|
418
418
|
}) {
|
|
419
|
-
const
|
|
420
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${o ? "ds-textarea-wrapper--full" : ""} ${
|
|
421
|
-
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor:
|
|
419
|
+
const f = i || `textarea-${U.useId()}`, p = n ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, u = h || p;
|
|
420
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${o ? "ds-textarea-wrapper--full" : ""} ${r ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
|
+
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
423
423
|
"textarea",
|
|
424
424
|
{
|
|
425
|
-
id:
|
|
425
|
+
id: f,
|
|
426
426
|
className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: r,
|
|
428
428
|
"aria-invalid": t ? "true" : "false",
|
|
429
|
-
"aria-describedby":
|
|
430
|
-
rows:
|
|
429
|
+
"aria-describedby": u,
|
|
430
|
+
rows: m,
|
|
431
431
|
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
|
|
434
|
+
n && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: n }),
|
|
435
435
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function qs({
|
|
439
439
|
label: s,
|
|
440
440
|
value: t,
|
|
441
|
-
onChange:
|
|
441
|
+
onChange: n,
|
|
442
442
|
options: o = [],
|
|
443
443
|
placeholder: a = "Select option",
|
|
444
|
-
error:
|
|
444
|
+
error: r,
|
|
445
445
|
fullWidth: i = !0,
|
|
446
446
|
size: l = "m",
|
|
447
|
-
disabled:
|
|
447
|
+
disabled: m = !1,
|
|
448
448
|
id: d,
|
|
449
|
-
...
|
|
449
|
+
...f
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = D(!1), [
|
|
452
|
-
|
|
451
|
+
const [p, h] = D(!1), [u, b] = D(!1), [j, R] = D({}), [$, L] = D("down"), [y, T] = D(-1), z = k(null), A = k(null), q = k(null), H = k(null), F = d || `select-${U.useId()}`, v = `${F}-label`, C = r ? `${F}-error` : void 0, X = 150, V = (g = !1) => {
|
|
452
|
+
u || (b(!0), T(-1), H.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
|
-
h(!1), b(!1), g && ((c =
|
|
454
|
+
h(!1), b(!1), g && ((c = q.current) == null || c.focus());
|
|
455
455
|
}, X));
|
|
456
456
|
}, x = (g) => {
|
|
457
457
|
clearTimeout(H.current), b(!1);
|
|
458
458
|
const c = g !== void 0 ? g : Math.max(o.findIndex((w) => w.value === t), 0);
|
|
459
459
|
T(c), h(!0);
|
|
460
460
|
};
|
|
461
|
-
|
|
461
|
+
B(() => () => clearTimeout(H.current), []);
|
|
462
462
|
const N = () => {
|
|
463
463
|
var ae;
|
|
464
464
|
const g = (ae = z.current) == null ? void 0 : ae.getBoundingClientRect();
|
|
465
465
|
if (!g) return;
|
|
466
|
-
const c = window.innerHeight, w = c - g.bottom,
|
|
467
|
-
|
|
468
|
-
|
|
466
|
+
const c = window.innerHeight, w = c - g.bottom, P = g.top, ne = w < 300 && P > w;
|
|
467
|
+
L(ne ? "up" : "down"), R(
|
|
468
|
+
ne ? { bottom: c - g.top + 4, left: g.left, width: g.width } : { top: g.bottom + 4, left: g.left, width: g.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
471
|
-
|
|
471
|
+
B(() => {
|
|
472
472
|
if (p)
|
|
473
473
|
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
474
474
|
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
475
475
|
};
|
|
476
|
-
}, [p]),
|
|
476
|
+
}, [p]), B(() => {
|
|
477
477
|
const g = (c) => {
|
|
478
|
-
z.current && !z.current.contains(c.target) && A.current && !A.current.contains(c.target) &&
|
|
478
|
+
z.current && !z.current.contains(c.target) && A.current && !A.current.contains(c.target) && V();
|
|
479
479
|
};
|
|
480
480
|
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
481
|
-
}, [
|
|
481
|
+
}, [u]), B(() => {
|
|
482
482
|
var c;
|
|
483
483
|
if (!p || y < 0 || !A.current) return;
|
|
484
484
|
(c = A.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [y, p]);
|
|
486
|
-
const
|
|
486
|
+
const E = (g) => {
|
|
487
487
|
switch (g.key) {
|
|
488
488
|
case "ArrowDown":
|
|
489
489
|
g.preventDefault(), p ? T((c) => Math.min(c + 1, o.length - 1)) : x();
|
|
@@ -499,16 +499,16 @@ function Ys({
|
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
g.preventDefault(), p ? y >= 0 && (
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (n == null || n(o[y].value), V(!0)) : x();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
|
-
p && (g.preventDefault(),
|
|
505
|
+
p && (g.preventDefault(), V(!0));
|
|
506
506
|
break;
|
|
507
507
|
case "Tab":
|
|
508
|
-
p &&
|
|
508
|
+
p && V(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
},
|
|
511
|
+
}, M = o.find((g) => g.value === t), K = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], G = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
514
|
ref: A,
|
|
@@ -519,7 +519,7 @@ function Ys({
|
|
|
519
519
|
"ds-select-dropdown ds-scrollable",
|
|
520
520
|
`ds-select-dropdown--${l}`,
|
|
521
521
|
`ds-select-dropdown--${$}`,
|
|
522
|
-
|
|
522
|
+
u && "ds-select-dropdown--closing"
|
|
523
523
|
].filter(Boolean).join(" "),
|
|
524
524
|
style: j,
|
|
525
525
|
children: o.map((g, c) => /* @__PURE__ */ e.jsx(
|
|
@@ -537,7 +537,7 @@ function Ys({
|
|
|
537
537
|
c === y && "ds-select-option--active"
|
|
538
538
|
].filter(Boolean).join(" "),
|
|
539
539
|
onClick: () => {
|
|
540
|
-
|
|
540
|
+
n == null || n(g.value), V(!0);
|
|
541
541
|
},
|
|
542
542
|
children: g.label
|
|
543
543
|
},
|
|
@@ -545,12 +545,12 @@ function Ys({
|
|
|
545
545
|
))
|
|
546
546
|
}
|
|
547
547
|
);
|
|
548
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${
|
|
548
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
549
549
|
s && /* @__PURE__ */ e.jsx("label", { id: v, className: "ds-select-label", children: s }),
|
|
550
550
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: z, children: /* @__PURE__ */ e.jsxs(
|
|
551
551
|
"button",
|
|
552
552
|
{
|
|
553
|
-
ref:
|
|
553
|
+
ref: q,
|
|
554
554
|
type: "button",
|
|
555
555
|
id: F,
|
|
556
556
|
role: "combobox",
|
|
@@ -558,21 +558,21 @@ function Ys({
|
|
|
558
558
|
"aria-expanded": p,
|
|
559
559
|
"aria-activedescendant": p && y >= 0 ? `${F}-opt-${y}` : void 0,
|
|
560
560
|
"aria-labelledby": s ? v : void 0,
|
|
561
|
-
"aria-invalid":
|
|
561
|
+
"aria-invalid": r ? "true" : "false",
|
|
562
562
|
"aria-describedby": C,
|
|
563
|
-
className: `ds-select-trigger ds-select-trigger--${l} ${
|
|
563
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${r ? "ds-select-trigger--error" : ""}`,
|
|
564
564
|
onClick: () => {
|
|
565
|
-
|
|
565
|
+
m || (p ? V() : x());
|
|
566
566
|
},
|
|
567
|
-
onKeyDown:
|
|
568
|
-
disabled:
|
|
569
|
-
...
|
|
567
|
+
onKeyDown: E,
|
|
568
|
+
disabled: m,
|
|
569
|
+
...f,
|
|
570
570
|
children: [
|
|
571
|
-
/* @__PURE__ */ e.jsx("span", { className:
|
|
571
|
+
/* @__PURE__ */ e.jsx("span", { className: M ? "" : "ds-select-placeholder", children: (M == null ? void 0 : M.label) || a }),
|
|
572
572
|
/* @__PURE__ */ e.jsx(
|
|
573
|
-
|
|
573
|
+
xe,
|
|
574
574
|
{
|
|
575
|
-
size:
|
|
575
|
+
size: K,
|
|
576
576
|
strokeWidth: 1.5,
|
|
577
577
|
className: `ds-select-icon ${p && $ === "down" ? "ds-select-icon--open" : ""} ${p && $ === "up" ? "ds-select-icon--up" : ""}`,
|
|
578
578
|
"aria-hidden": "true"
|
|
@@ -581,42 +581,42 @@ function Ys({
|
|
|
581
581
|
]
|
|
582
582
|
}
|
|
583
583
|
) }),
|
|
584
|
-
|
|
584
|
+
r && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: r }),
|
|
585
585
|
typeof document < "u" && pe.createPortal(G, document.body)
|
|
586
586
|
] });
|
|
587
587
|
}
|
|
588
588
|
function Hs({
|
|
589
589
|
label: s,
|
|
590
590
|
value: t = 0,
|
|
591
|
-
onChange:
|
|
591
|
+
onChange: n,
|
|
592
592
|
min: o = 0,
|
|
593
593
|
max: a = 100,
|
|
594
|
-
step:
|
|
594
|
+
step: r = 1,
|
|
595
595
|
size: i = "m",
|
|
596
596
|
disabled: l = !1,
|
|
597
|
-
hint:
|
|
597
|
+
hint: m,
|
|
598
598
|
error: d,
|
|
599
|
-
...
|
|
599
|
+
...f
|
|
600
600
|
}) {
|
|
601
601
|
const p = () => {
|
|
602
602
|
if (l) return;
|
|
603
|
-
const $ = Math.min(Number(t) +
|
|
604
|
-
|
|
603
|
+
const $ = Math.min(Number(t) + r, a);
|
|
604
|
+
n == null || n($);
|
|
605
605
|
}, h = () => {
|
|
606
606
|
if (l) return;
|
|
607
|
-
const $ = Math.max(Number(t) -
|
|
608
|
-
|
|
609
|
-
},
|
|
607
|
+
const $ = Math.max(Number(t) - r, o);
|
|
608
|
+
n == null || n($);
|
|
609
|
+
}, u = ($) => {
|
|
610
610
|
if (l) return;
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
613
|
-
|
|
611
|
+
const L = $.target.value;
|
|
612
|
+
if (L === "") {
|
|
613
|
+
n == null || n(o);
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
|
-
const y = Number(
|
|
616
|
+
const y = Number(L);
|
|
617
617
|
if (!isNaN(y)) {
|
|
618
618
|
const T = Math.min(Math.max(y, o), a);
|
|
619
|
-
|
|
619
|
+
n == null || n(T);
|
|
620
620
|
}
|
|
621
621
|
}, b = [
|
|
622
622
|
"ds-stepper-wrapper",
|
|
@@ -647,12 +647,12 @@ function Hs({
|
|
|
647
647
|
type: "number",
|
|
648
648
|
className: "ds-stepper-input",
|
|
649
649
|
value: t,
|
|
650
|
-
onChange:
|
|
650
|
+
onChange: u,
|
|
651
651
|
min: o,
|
|
652
652
|
max: a,
|
|
653
|
-
step:
|
|
653
|
+
step: r,
|
|
654
654
|
disabled: l,
|
|
655
|
-
...
|
|
655
|
+
...f
|
|
656
656
|
}
|
|
657
657
|
),
|
|
658
658
|
/* @__PURE__ */ e.jsx(
|
|
@@ -663,32 +663,32 @@ function Hs({
|
|
|
663
663
|
onClick: p,
|
|
664
664
|
disabled: l || t >= a,
|
|
665
665
|
"aria-label": "Increase",
|
|
666
|
-
children: /* @__PURE__ */ e.jsx(
|
|
666
|
+
children: /* @__PURE__ */ e.jsx(qe, { size: R, strokeWidth: 1.5 })
|
|
667
667
|
}
|
|
668
668
|
)
|
|
669
669
|
] }),
|
|
670
|
-
|
|
670
|
+
m && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: m }),
|
|
671
671
|
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
672
672
|
] });
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Ks({
|
|
675
675
|
children: s,
|
|
676
676
|
padding: t = "m",
|
|
677
|
-
variant:
|
|
677
|
+
variant: n = "info",
|
|
678
678
|
hover: o = !1,
|
|
679
679
|
// deprecated, use variant="interactive"
|
|
680
680
|
onClick: a,
|
|
681
|
-
href:
|
|
681
|
+
href: r,
|
|
682
682
|
disabled: i = !1,
|
|
683
683
|
...l
|
|
684
684
|
}) {
|
|
685
|
-
const d = (o ? "interactive" :
|
|
685
|
+
const d = (o ? "interactive" : n) === "interactive" || a || r, f = [
|
|
686
686
|
"ds-card",
|
|
687
687
|
`ds-card--${t}`,
|
|
688
688
|
d && "ds-card--interactive"
|
|
689
689
|
].filter(Boolean).join(" ");
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
690
|
+
if (r) {
|
|
691
|
+
const u = (b) => {
|
|
692
692
|
if (i) {
|
|
693
693
|
b.preventDefault();
|
|
694
694
|
return;
|
|
@@ -698,9 +698,9 @@ function qs({
|
|
|
698
698
|
return /* @__PURE__ */ e.jsx(
|
|
699
699
|
"a",
|
|
700
700
|
{
|
|
701
|
-
className:
|
|
702
|
-
href: i ? void 0 :
|
|
703
|
-
onClick:
|
|
701
|
+
className: f,
|
|
702
|
+
href: i ? void 0 : r,
|
|
703
|
+
onClick: u,
|
|
704
704
|
"aria-disabled": i ? "true" : void 0,
|
|
705
705
|
...l,
|
|
706
706
|
children: s
|
|
@@ -715,7 +715,7 @@ function qs({
|
|
|
715
715
|
return /* @__PURE__ */ e.jsx(
|
|
716
716
|
p,
|
|
717
717
|
{
|
|
718
|
-
className:
|
|
718
|
+
className: f,
|
|
719
719
|
role: d && !a ? "article" : void 0,
|
|
720
720
|
...h,
|
|
721
721
|
...l,
|
|
@@ -723,60 +723,60 @@ function qs({
|
|
|
723
723
|
}
|
|
724
724
|
);
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function Xs({ children: s, ...t }) {
|
|
727
727
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...t, children: s });
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function Gs({ children: s, ...t }) {
|
|
730
730
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...t, children: s });
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function Js({ children: s, ...t }) {
|
|
733
733
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...t, children: s });
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Zs({ children: s, ...t }) {
|
|
736
736
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...
|
|
738
|
+
function Qs({ children: s, secondary: t = !1, ...n }) {
|
|
739
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...n, children: s });
|
|
740
740
|
}
|
|
741
|
-
function ds({ children: s, secondary: t = !1, ...
|
|
742
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...
|
|
741
|
+
function ds({ children: s, secondary: t = !1, ...n }) {
|
|
742
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...n, children: s });
|
|
743
743
|
}
|
|
744
|
-
function Fe({ children: s, secondary: t = !1, ...
|
|
745
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...
|
|
744
|
+
function Fe({ children: s, secondary: t = !1, ...n }) {
|
|
745
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...n, children: s });
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function de({
|
|
748
748
|
children: s,
|
|
749
749
|
variant: t = "default",
|
|
750
|
-
size:
|
|
750
|
+
size: n = "m",
|
|
751
751
|
role: o,
|
|
752
752
|
...a
|
|
753
753
|
}) {
|
|
754
|
-
const
|
|
754
|
+
const r = [
|
|
755
755
|
"ds-badge",
|
|
756
756
|
`ds-badge--${t}`,
|
|
757
|
-
`ds-badge--${
|
|
757
|
+
`ds-badge--${n}`
|
|
758
758
|
].filter(Boolean).join(" "), i = o || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
759
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
759
|
+
return /* @__PURE__ */ e.jsx("span", { className: r, role: i, ...a, children: s });
|
|
760
760
|
}
|
|
761
761
|
const us = {
|
|
762
|
-
info:
|
|
763
|
-
success:
|
|
764
|
-
warning:
|
|
765
|
-
error:
|
|
762
|
+
info: Ee,
|
|
763
|
+
success: ke,
|
|
764
|
+
warning: ye,
|
|
765
|
+
error: ge
|
|
766
766
|
};
|
|
767
|
-
function
|
|
767
|
+
function et({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: t = "info",
|
|
770
|
-
title:
|
|
770
|
+
title: n,
|
|
771
771
|
onClose: o,
|
|
772
772
|
role: a,
|
|
773
|
-
...
|
|
773
|
+
...r
|
|
774
774
|
}) {
|
|
775
775
|
const i = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${n ? "" : "ds-alert--no-title"}`, role: l, ...r, children: [
|
|
777
777
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(i, { size: I[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
|
-
|
|
779
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: n }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
781
781
|
] }),
|
|
782
782
|
o && /* @__PURE__ */ e.jsx(
|
|
@@ -786,27 +786,27 @@ function Qs({
|
|
|
786
786
|
className: "ds-alert__close",
|
|
787
787
|
onClick: o,
|
|
788
788
|
"aria-label": "Close alert",
|
|
789
|
-
children: /* @__PURE__ */ e.jsx(
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(te, { size: I[3], strokeWidth: 1.5 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
793
793
|
}
|
|
794
794
|
const fs = 200;
|
|
795
|
-
function
|
|
795
|
+
function st({
|
|
796
796
|
children: s,
|
|
797
797
|
title: t,
|
|
798
|
-
onClose:
|
|
798
|
+
onClose: n,
|
|
799
799
|
size: o = "m",
|
|
800
800
|
scrollable: a = !1,
|
|
801
|
-
subHeader:
|
|
801
|
+
subHeader: r,
|
|
802
802
|
...i
|
|
803
803
|
}) {
|
|
804
|
-
const l =
|
|
805
|
-
!
|
|
806
|
-
|
|
804
|
+
const l = k(null), m = U.useId(), [d, f] = D(!1), p = () => {
|
|
805
|
+
!n || d || (f(!0), setTimeout(() => {
|
|
806
|
+
f(!1), n();
|
|
807
807
|
}, fs));
|
|
808
808
|
};
|
|
809
|
-
|
|
809
|
+
B(() => {
|
|
810
810
|
const j = ($) => {
|
|
811
811
|
$.key === "Escape" && p();
|
|
812
812
|
}, R = ($) => {
|
|
@@ -815,8 +815,8 @@ function et({
|
|
|
815
815
|
return document.addEventListener("keydown", j), document.addEventListener("mousedown", R), () => {
|
|
816
816
|
document.removeEventListener("keydown", j), document.removeEventListener("mousedown", R);
|
|
817
817
|
};
|
|
818
|
-
}, [
|
|
819
|
-
const h =
|
|
818
|
+
}, [n, d]);
|
|
819
|
+
const h = U.Children.toArray(s), u = h.find((j) => (j == null ? void 0 : j.type) === he), b = h.filter((j) => (j == null ? void 0 : j.type) !== he);
|
|
820
820
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
|
|
821
821
|
"div",
|
|
822
822
|
{
|
|
@@ -824,52 +824,115 @@ function et({
|
|
|
824
824
|
ref: l,
|
|
825
825
|
role: "dialog",
|
|
826
826
|
"aria-modal": "true",
|
|
827
|
-
"aria-labelledby": t ?
|
|
827
|
+
"aria-labelledby": t ? m : void 0,
|
|
828
828
|
children: [
|
|
829
|
-
(t ||
|
|
830
|
-
(t ||
|
|
831
|
-
t && /* @__PURE__ */ e.jsx("h3", { id:
|
|
832
|
-
|
|
833
|
-
|
|
829
|
+
(t || n || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
830
|
+
(t || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header-row", children: [
|
|
831
|
+
t && /* @__PURE__ */ e.jsx("h3", { id: m, className: "ds-modal__title", children: t }),
|
|
832
|
+
n && /* @__PURE__ */ e.jsx(
|
|
833
|
+
ce,
|
|
834
834
|
{
|
|
835
835
|
variant: "ghost",
|
|
836
836
|
size: "small",
|
|
837
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
837
|
+
icon: /* @__PURE__ */ e.jsx(te, { size: I[2], strokeWidth: 1.5 }),
|
|
838
838
|
onClick: p,
|
|
839
839
|
"aria-label": "Close modal"
|
|
840
840
|
}
|
|
841
841
|
)
|
|
842
842
|
] }),
|
|
843
|
-
|
|
843
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: r })
|
|
844
844
|
] }),
|
|
845
845
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: b }),
|
|
846
|
-
|
|
846
|
+
u
|
|
847
847
|
]
|
|
848
848
|
}
|
|
849
849
|
) });
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
return !s ||
|
|
851
|
+
function he({ children: s }) {
|
|
852
|
+
return !s || U.Children.count(s) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: s });
|
|
853
|
+
}
|
|
854
|
+
const ms = 320;
|
|
855
|
+
function tt({
|
|
856
|
+
children: s,
|
|
857
|
+
title: t,
|
|
858
|
+
onClose: n,
|
|
859
|
+
subHeader: o,
|
|
860
|
+
...a
|
|
861
|
+
}) {
|
|
862
|
+
const r = k(null), i = U.useId(), [l, m] = D(!1), d = () => {
|
|
863
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
864
|
+
m(!1), n();
|
|
865
|
+
}, ms));
|
|
866
|
+
};
|
|
867
|
+
B(() => {
|
|
868
|
+
const u = (j) => {
|
|
869
|
+
j.key === "Escape" && d();
|
|
870
|
+
}, b = (j) => {
|
|
871
|
+
r.current && !r.current.contains(j.target) && d();
|
|
872
|
+
};
|
|
873
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
874
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
875
|
+
};
|
|
876
|
+
}, [n, l]);
|
|
877
|
+
const f = U.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === he), h = f.filter((u) => (u == null ? void 0 : u.type) !== he);
|
|
878
|
+
return /* @__PURE__ */ e.jsx(
|
|
879
|
+
"div",
|
|
880
|
+
{
|
|
881
|
+
className: ["ds-bottom-sheet-overlay", l && "ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),
|
|
882
|
+
...a,
|
|
883
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
884
|
+
"div",
|
|
885
|
+
{
|
|
886
|
+
ref: r,
|
|
887
|
+
className: ["ds-bottom-sheet", l && "ds-bottom-sheet--closing"].filter(Boolean).join(" "),
|
|
888
|
+
role: "dialog",
|
|
889
|
+
"aria-modal": "true",
|
|
890
|
+
"aria-labelledby": t ? i : void 0,
|
|
891
|
+
children: [
|
|
892
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__handle", "aria-hidden": "true" }),
|
|
893
|
+
(t || n || o) && /* @__PURE__ */ e.jsxs("div", { className: "ds-bottom-sheet__header", children: [
|
|
894
|
+
(t || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-bottom-sheet__header-row", children: [
|
|
895
|
+
t && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-bottom-sheet__title", children: t }),
|
|
896
|
+
n && /* @__PURE__ */ e.jsx(
|
|
897
|
+
ce,
|
|
898
|
+
{
|
|
899
|
+
variant: "ghost",
|
|
900
|
+
size: "small",
|
|
901
|
+
icon: /* @__PURE__ */ e.jsx(te, { size: I[2], strokeWidth: 1.5 }),
|
|
902
|
+
onClick: d,
|
|
903
|
+
"aria-label": "Close"
|
|
904
|
+
}
|
|
905
|
+
)
|
|
906
|
+
] }),
|
|
907
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__subheader", children: o })
|
|
908
|
+
] }),
|
|
909
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: h }),
|
|
910
|
+
p
|
|
911
|
+
]
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
}
|
|
915
|
+
);
|
|
853
916
|
}
|
|
854
|
-
function
|
|
917
|
+
function ps({
|
|
855
918
|
children: s,
|
|
856
919
|
title: t = "Code",
|
|
857
|
-
defaultExpanded:
|
|
920
|
+
defaultExpanded: n = !1,
|
|
858
921
|
expanded: o,
|
|
859
922
|
onToggle: a,
|
|
860
|
-
padding:
|
|
923
|
+
padding: r = "s",
|
|
861
924
|
className: i = "",
|
|
862
925
|
...l
|
|
863
926
|
}) {
|
|
864
|
-
const [
|
|
865
|
-
|
|
866
|
-
},
|
|
927
|
+
const [m, d] = D(n), f = o !== void 0, p = f ? o : m, h = () => {
|
|
928
|
+
f ? a == null || a(!o) : d((b) => !b);
|
|
929
|
+
}, u = [
|
|
867
930
|
"ds-code-accordion",
|
|
868
|
-
`ds-code-accordion--${
|
|
931
|
+
`ds-code-accordion--${r}`,
|
|
869
932
|
p && "ds-code-accordion--expanded",
|
|
870
933
|
i
|
|
871
934
|
].filter(Boolean).join(" ");
|
|
872
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
935
|
+
return /* @__PURE__ */ e.jsxs("div", { className: u, ...l, children: [
|
|
873
936
|
/* @__PURE__ */ e.jsxs(
|
|
874
937
|
"button",
|
|
875
938
|
{
|
|
@@ -880,7 +943,7 @@ function ms({
|
|
|
880
943
|
children: [
|
|
881
944
|
/* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: t }),
|
|
882
945
|
/* @__PURE__ */ e.jsx(
|
|
883
|
-
|
|
946
|
+
xe,
|
|
884
947
|
{
|
|
885
948
|
size: I[2],
|
|
886
949
|
strokeWidth: 1.5,
|
|
@@ -893,29 +956,29 @@ function ms({
|
|
|
893
956
|
/* @__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: s }) }) }) })
|
|
894
957
|
] });
|
|
895
958
|
}
|
|
896
|
-
function
|
|
897
|
-
return t ?
|
|
959
|
+
function nt({ children: s, block: t = !1, collapsible: n = !1, title: o = "Code", defaultExpanded: a = !1, ...r }) {
|
|
960
|
+
return t ? n ? /* @__PURE__ */ e.jsx(ps, { title: o, defaultExpanded: a, ...r, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...r, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...r, children: s });
|
|
898
961
|
}
|
|
899
|
-
function
|
|
962
|
+
function rt({ href: s, children: t, onClick: n, target: o, rel: a, ...r }) {
|
|
900
963
|
const l = o === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
901
964
|
return /* @__PURE__ */ e.jsx(
|
|
902
965
|
"a",
|
|
903
966
|
{
|
|
904
967
|
href: s,
|
|
905
968
|
className: "ds-link",
|
|
906
|
-
onClick:
|
|
969
|
+
onClick: n,
|
|
907
970
|
target: o,
|
|
908
971
|
rel: l,
|
|
909
|
-
...
|
|
972
|
+
...r,
|
|
910
973
|
children: t
|
|
911
974
|
}
|
|
912
975
|
);
|
|
913
976
|
}
|
|
914
|
-
function
|
|
915
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...o, children:
|
|
977
|
+
function at({ children: s, size: t = "m", variant: n = "ghost", ...o }) {
|
|
978
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...o, children: U.Children.map(s, (a) => U.isValidElement(a) ? U.cloneElement(a, { size: t, variant: n }) : a) });
|
|
916
979
|
}
|
|
917
|
-
function
|
|
918
|
-
const d = i && !s,
|
|
980
|
+
function ot({ children: s, selected: t = !1, onClick: n, size: o = "m", variant: a = "ghost", disabled: r = !1, icon: i, href: l, ...m }) {
|
|
981
|
+
const d = i && !s, f = [
|
|
919
982
|
"ds-tab",
|
|
920
983
|
`ds-tab--${o}`,
|
|
921
984
|
`ds-tab--${a}`,
|
|
@@ -926,23 +989,23 @@ function nt({ children: s, selected: t = !1, onClick: r, size: o = "m", variant:
|
|
|
926
989
|
s
|
|
927
990
|
] });
|
|
928
991
|
if (l) {
|
|
929
|
-
const h = (
|
|
930
|
-
if (
|
|
931
|
-
|
|
992
|
+
const h = (u) => {
|
|
993
|
+
if (r) {
|
|
994
|
+
u.preventDefault();
|
|
932
995
|
return;
|
|
933
996
|
}
|
|
934
|
-
|
|
997
|
+
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), n == null || n(u));
|
|
935
998
|
};
|
|
936
999
|
return /* @__PURE__ */ e.jsx(
|
|
937
1000
|
"a",
|
|
938
1001
|
{
|
|
939
1002
|
role: "tab",
|
|
940
1003
|
"aria-current": t ? "page" : void 0,
|
|
941
|
-
"aria-disabled":
|
|
942
|
-
className:
|
|
943
|
-
href:
|
|
1004
|
+
"aria-disabled": r ? "true" : void 0,
|
|
1005
|
+
className: f,
|
|
1006
|
+
href: r ? void 0 : l,
|
|
944
1007
|
onClick: h,
|
|
945
|
-
...
|
|
1008
|
+
...m,
|
|
946
1009
|
children: p
|
|
947
1010
|
}
|
|
948
1011
|
);
|
|
@@ -952,37 +1015,37 @@ function nt({ children: s, selected: t = !1, onClick: r, size: o = "m", variant:
|
|
|
952
1015
|
{
|
|
953
1016
|
role: "tab",
|
|
954
1017
|
"aria-selected": t,
|
|
955
|
-
className:
|
|
956
|
-
onClick:
|
|
957
|
-
disabled:
|
|
958
|
-
...
|
|
1018
|
+
className: f,
|
|
1019
|
+
onClick: n,
|
|
1020
|
+
disabled: r,
|
|
1021
|
+
...m,
|
|
959
1022
|
children: p
|
|
960
1023
|
}
|
|
961
1024
|
);
|
|
962
1025
|
}
|
|
963
|
-
function
|
|
964
|
-
const
|
|
965
|
-
if (!
|
|
966
|
-
const
|
|
967
|
-
if (!
|
|
968
|
-
const b =
|
|
969
|
-
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = R + "px", i.current.style.width = $ + "px", d.current = !1) : (
|
|
970
|
-
if (!i.current || !
|
|
971
|
-
const
|
|
972
|
-
if (!
|
|
973
|
-
const y =
|
|
1026
|
+
function it({ options: s, value: t, onChange: n, size: o = "m", disabled: a = !1 }) {
|
|
1027
|
+
const r = k(null), i = k(null), [l, m] = D(!1), d = k(!1), f = k(null), p = k(null), h = () => {
|
|
1028
|
+
if (!r.current) return;
|
|
1029
|
+
const u = r.current.querySelector(`[data-value="${t}"]`);
|
|
1030
|
+
if (!u) return;
|
|
1031
|
+
const b = r.current.getBoundingClientRect(), j = u.getBoundingClientRect(), R = j.left - b.left, $ = j.width;
|
|
1032
|
+
i.current ? (i.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = R + "px", i.current.style.width = $ + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
1033
|
+
if (!i.current || !r.current) return;
|
|
1034
|
+
const L = r.current.querySelector(`[data-value="${t}"]`);
|
|
1035
|
+
if (!L) return;
|
|
1036
|
+
const y = r.current.getBoundingClientRect(), T = L.getBoundingClientRect();
|
|
974
1037
|
i.current.style.transition = "none", i.current.style.left = T.left - y.left + "px", i.current.style.width = T.width + "px";
|
|
975
1038
|
}));
|
|
976
1039
|
};
|
|
977
1040
|
return p.current = h, Ve(() => {
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
}),
|
|
981
|
-
if (!
|
|
982
|
-
const
|
|
1041
|
+
const u = f.current !== t;
|
|
1042
|
+
f.current = t, d.current = l && u, h();
|
|
1043
|
+
}), B(() => {
|
|
1044
|
+
if (!r.current) return;
|
|
1045
|
+
const u = new ResizeObserver(() => {
|
|
983
1046
|
d.current = !1, p.current();
|
|
984
1047
|
});
|
|
985
|
-
return
|
|
1048
|
+
return u.observe(r.current), () => u.disconnect();
|
|
986
1049
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
987
1050
|
"div",
|
|
988
1051
|
{
|
|
@@ -991,7 +1054,7 @@ function at({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1
|
|
|
991
1054
|
`ds-seg--${o}`,
|
|
992
1055
|
a && "ds-seg--disabled"
|
|
993
1056
|
].filter(Boolean).join(" "),
|
|
994
|
-
ref:
|
|
1057
|
+
ref: r,
|
|
995
1058
|
role: "group",
|
|
996
1059
|
children: [
|
|
997
1060
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -1002,41 +1065,41 @@ function at({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1
|
|
|
1002
1065
|
"aria-hidden": "true"
|
|
1003
1066
|
}
|
|
1004
1067
|
),
|
|
1005
|
-
s.map((
|
|
1068
|
+
s.map((u) => /* @__PURE__ */ e.jsxs(
|
|
1006
1069
|
"button",
|
|
1007
1070
|
{
|
|
1008
1071
|
type: "button",
|
|
1009
|
-
"data-value":
|
|
1010
|
-
className: ["ds-seg__btn", t ===
|
|
1011
|
-
onClick: () => !a &&
|
|
1012
|
-
"aria-pressed": t ===
|
|
1072
|
+
"data-value": u.value,
|
|
1073
|
+
className: ["ds-seg__btn", t === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1074
|
+
onClick: () => !a && n(u.value),
|
|
1075
|
+
"aria-pressed": t === u.value,
|
|
1013
1076
|
disabled: a,
|
|
1014
1077
|
children: [
|
|
1015
|
-
|
|
1016
|
-
|
|
1078
|
+
u.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: u.icon }),
|
|
1079
|
+
u.label
|
|
1017
1080
|
]
|
|
1018
1081
|
},
|
|
1019
|
-
|
|
1082
|
+
u.value
|
|
1020
1083
|
))
|
|
1021
1084
|
]
|
|
1022
1085
|
}
|
|
1023
1086
|
);
|
|
1024
1087
|
}
|
|
1025
|
-
function
|
|
1088
|
+
function $e({
|
|
1026
1089
|
children: s,
|
|
1027
1090
|
title: t,
|
|
1028
|
-
defaultExpanded:
|
|
1091
|
+
defaultExpanded: n = !1,
|
|
1029
1092
|
expanded: o,
|
|
1030
1093
|
onToggle: a,
|
|
1031
|
-
padding:
|
|
1094
|
+
padding: r = "m",
|
|
1032
1095
|
...i
|
|
1033
1096
|
}) {
|
|
1034
|
-
const [l,
|
|
1035
|
-
d ? a == null || a(!o) :
|
|
1097
|
+
const [l, m] = D(n), d = o !== void 0, f = d ? o : l, p = () => {
|
|
1098
|
+
d ? a == null || a(!o) : m((u) => !u);
|
|
1036
1099
|
}, h = [
|
|
1037
1100
|
"ds-accordion",
|
|
1038
|
-
`ds-accordion--${
|
|
1039
|
-
|
|
1101
|
+
`ds-accordion--${r}`,
|
|
1102
|
+
f && "ds-accordion--expanded"
|
|
1040
1103
|
].filter(Boolean).join(" ");
|
|
1041
1104
|
return /* @__PURE__ */ e.jsxs("div", { className: h, ...i, children: [
|
|
1042
1105
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -1045,15 +1108,15 @@ function Ee({
|
|
|
1045
1108
|
type: "button",
|
|
1046
1109
|
className: "ds-accordion__header",
|
|
1047
1110
|
onClick: p,
|
|
1048
|
-
"aria-expanded":
|
|
1111
|
+
"aria-expanded": f,
|
|
1049
1112
|
children: [
|
|
1050
1113
|
/* @__PURE__ */ e.jsx("span", { className: "ds-accordion__title", children: t }),
|
|
1051
1114
|
/* @__PURE__ */ e.jsx(
|
|
1052
|
-
|
|
1115
|
+
xe,
|
|
1053
1116
|
{
|
|
1054
1117
|
size: I[2],
|
|
1055
1118
|
strokeWidth: 1.5,
|
|
1056
|
-
className: `ds-accordion__icon ${
|
|
1119
|
+
className: `ds-accordion__icon ${f ? "ds-accordion__icon--expanded" : ""}`
|
|
1057
1120
|
}
|
|
1058
1121
|
)
|
|
1059
1122
|
]
|
|
@@ -1063,60 +1126,60 @@ function Ee({
|
|
|
1063
1126
|
] });
|
|
1064
1127
|
}
|
|
1065
1128
|
const re = 8, le = 8;
|
|
1066
|
-
function
|
|
1129
|
+
function hs(s, t, n) {
|
|
1067
1130
|
const o = window.innerWidth;
|
|
1068
|
-
let a,
|
|
1131
|
+
let a, r;
|
|
1069
1132
|
switch (s) {
|
|
1070
1133
|
case "top":
|
|
1071
|
-
a = t.top -
|
|
1134
|
+
a = t.top - n.height - re, r = t.left + t.width / 2 - n.width / 2;
|
|
1072
1135
|
break;
|
|
1073
1136
|
case "bottom":
|
|
1074
|
-
a = t.bottom + re,
|
|
1137
|
+
a = t.bottom + re, r = t.left + t.width / 2 - n.width / 2;
|
|
1075
1138
|
break;
|
|
1076
1139
|
case "left":
|
|
1077
|
-
a = t.top + t.height / 2 -
|
|
1140
|
+
a = t.top + t.height / 2 - n.height / 2, r = t.left - n.width - re;
|
|
1078
1141
|
break;
|
|
1079
1142
|
case "right":
|
|
1080
|
-
a = t.top + t.height / 2 -
|
|
1143
|
+
a = t.top + t.height / 2 - n.height / 2, r = t.right + re;
|
|
1081
1144
|
break;
|
|
1082
1145
|
default:
|
|
1083
|
-
a = t.bottom + re,
|
|
1146
|
+
a = t.bottom + re, r = t.left;
|
|
1084
1147
|
}
|
|
1085
|
-
const i = Math.max(le, Math.min(o -
|
|
1148
|
+
const i = Math.max(le, Math.min(o - n.width - le, r)), l = r - i;
|
|
1086
1149
|
return { top: a, left: i, arrowOffset: l };
|
|
1087
1150
|
}
|
|
1088
|
-
function
|
|
1151
|
+
function xs(s, t, n) {
|
|
1089
1152
|
const o = window.innerWidth, a = window.innerHeight;
|
|
1090
1153
|
if (s.top >= t + re + le) return "top";
|
|
1091
1154
|
if (a - s.bottom >= t + re + le) return "bottom";
|
|
1092
|
-
if (o - s.right >=
|
|
1093
|
-
if (s.left >=
|
|
1094
|
-
const
|
|
1095
|
-
return
|
|
1096
|
-
}
|
|
1097
|
-
function
|
|
1098
|
-
const [a,
|
|
1099
|
-
if (!
|
|
1100
|
-
const j =
|
|
1155
|
+
if (o - s.right >= n + re + le) return "right";
|
|
1156
|
+
if (s.left >= n + re + le) return "left";
|
|
1157
|
+
const r = Math.max(s.top, a - s.bottom, s.left, o - s.right);
|
|
1158
|
+
return r === s.top ? "top" : r === a - s.bottom ? "bottom" : r === o - s.right ? "right" : "left";
|
|
1159
|
+
}
|
|
1160
|
+
function lt({ children: s, content: t, position: n, ...o }) {
|
|
1161
|
+
const [a, r] = D(!1), [i, l] = D({ visibility: "hidden" }), [m, d] = D(n || "top"), f = k(null), p = k(null), h = k(!1), u = () => {
|
|
1162
|
+
if (!f.current || !p.current) return;
|
|
1163
|
+
const j = f.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), $ = n || xs(j, R.height, R.width), { top: L, left: y, arrowOffset: T } = hs($, j, R);
|
|
1101
1164
|
d($), l({
|
|
1102
1165
|
position: "fixed",
|
|
1103
|
-
top:
|
|
1166
|
+
top: L,
|
|
1104
1167
|
left: y,
|
|
1105
1168
|
visibility: "visible",
|
|
1106
1169
|
"--arrow-offset": `${T}px`
|
|
1107
1170
|
});
|
|
1108
1171
|
};
|
|
1109
|
-
if (
|
|
1172
|
+
if (B(() => {
|
|
1110
1173
|
if (!a) return;
|
|
1111
1174
|
l({ position: "fixed", visibility: "hidden" });
|
|
1112
|
-
const j = requestAnimationFrame(
|
|
1113
|
-
return window.addEventListener("scroll",
|
|
1114
|
-
cancelAnimationFrame(j), window.removeEventListener("scroll",
|
|
1175
|
+
const j = requestAnimationFrame(u);
|
|
1176
|
+
return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1177
|
+
cancelAnimationFrame(j), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1115
1178
|
};
|
|
1116
|
-
}, [a,
|
|
1179
|
+
}, [a, n]), B(() => {
|
|
1117
1180
|
if (!a) return;
|
|
1118
1181
|
const j = (R) => {
|
|
1119
|
-
|
|
1182
|
+
f.current && !f.current.contains(R.target) && r(!1);
|
|
1120
1183
|
};
|
|
1121
1184
|
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1122
1185
|
}, [a]), !t) return s;
|
|
@@ -1124,7 +1187,7 @@ function ot({ children: s, content: t, position: r, ...o }) {
|
|
|
1124
1187
|
"div",
|
|
1125
1188
|
{
|
|
1126
1189
|
ref: p,
|
|
1127
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1190
|
+
className: `ds-tooltip ds-tooltip--${m}`,
|
|
1128
1191
|
role: "tooltip",
|
|
1129
1192
|
style: i,
|
|
1130
1193
|
children: t
|
|
@@ -1133,16 +1196,16 @@ function ot({ children: s, content: t, position: r, ...o }) {
|
|
|
1133
1196
|
return /* @__PURE__ */ e.jsxs(
|
|
1134
1197
|
"div",
|
|
1135
1198
|
{
|
|
1136
|
-
ref:
|
|
1199
|
+
ref: f,
|
|
1137
1200
|
className: "ds-tooltip-wrapper",
|
|
1138
1201
|
onMouseEnter: () => {
|
|
1139
|
-
h.current ||
|
|
1202
|
+
h.current || r(!0);
|
|
1140
1203
|
},
|
|
1141
1204
|
onMouseLeave: () => {
|
|
1142
|
-
h.current ||
|
|
1205
|
+
h.current || r(!1);
|
|
1143
1206
|
},
|
|
1144
1207
|
onTouchStart: () => {
|
|
1145
|
-
h.current = !0,
|
|
1208
|
+
h.current = !0, r((j) => !j);
|
|
1146
1209
|
},
|
|
1147
1210
|
...o,
|
|
1148
1211
|
children: [
|
|
@@ -1152,21 +1215,21 @@ function ot({ children: s, content: t, position: r, ...o }) {
|
|
|
1152
1215
|
}
|
|
1153
1216
|
);
|
|
1154
1217
|
}
|
|
1155
|
-
function
|
|
1218
|
+
function ct({
|
|
1156
1219
|
checked: s = !1,
|
|
1157
1220
|
onChange: t,
|
|
1158
|
-
size:
|
|
1221
|
+
size: n = "m",
|
|
1159
1222
|
disabled: o = !1,
|
|
1160
1223
|
label: a,
|
|
1161
|
-
id:
|
|
1224
|
+
id: r,
|
|
1162
1225
|
...i
|
|
1163
1226
|
}) {
|
|
1164
|
-
const l =
|
|
1227
|
+
const l = r || `toggle-${U.useId()}`, m = [
|
|
1165
1228
|
"ds-toggle",
|
|
1166
|
-
`ds-toggle--${
|
|
1229
|
+
`ds-toggle--${n}`,
|
|
1167
1230
|
o && "ds-toggle--disabled"
|
|
1168
1231
|
].filter(Boolean).join(" ");
|
|
1169
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1232
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1170
1233
|
/* @__PURE__ */ e.jsx(
|
|
1171
1234
|
"input",
|
|
1172
1235
|
{
|
|
@@ -1183,21 +1246,21 @@ function it({
|
|
|
1183
1246
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
|
|
1184
1247
|
] });
|
|
1185
1248
|
}
|
|
1186
|
-
function
|
|
1249
|
+
function dt({
|
|
1187
1250
|
checked: s = !1,
|
|
1188
1251
|
onChange: t,
|
|
1189
|
-
size:
|
|
1252
|
+
size: n = "m",
|
|
1190
1253
|
disabled: o = !1,
|
|
1191
1254
|
label: a,
|
|
1192
|
-
id:
|
|
1255
|
+
id: r,
|
|
1193
1256
|
...i
|
|
1194
1257
|
}) {
|
|
1195
|
-
const l =
|
|
1258
|
+
const l = r || `checkbox-${U.useId()}`, m = [
|
|
1196
1259
|
"ds-checkbox",
|
|
1197
|
-
`ds-checkbox--${
|
|
1260
|
+
`ds-checkbox--${n}`,
|
|
1198
1261
|
o && "ds-checkbox--disabled"
|
|
1199
|
-
].filter(Boolean).join(" "), d =
|
|
1200
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1262
|
+
].filter(Boolean).join(" "), d = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1263
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1201
1264
|
/* @__PURE__ */ e.jsx(
|
|
1202
1265
|
"input",
|
|
1203
1266
|
{
|
|
@@ -1205,13 +1268,13 @@ function lt({
|
|
|
1205
1268
|
id: l,
|
|
1206
1269
|
className: "ds-checkbox__input",
|
|
1207
1270
|
checked: s,
|
|
1208
|
-
onChange: (
|
|
1271
|
+
onChange: (f) => t == null ? void 0 : t(f.target.checked),
|
|
1209
1272
|
disabled: o,
|
|
1210
1273
|
...i
|
|
1211
1274
|
}
|
|
1212
1275
|
),
|
|
1213
1276
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ e.jsx(
|
|
1214
|
-
|
|
1277
|
+
we,
|
|
1215
1278
|
{
|
|
1216
1279
|
size: d,
|
|
1217
1280
|
strokeWidth: 2.5,
|
|
@@ -1221,23 +1284,23 @@ function lt({
|
|
|
1221
1284
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
|
|
1222
1285
|
] });
|
|
1223
1286
|
}
|
|
1224
|
-
function
|
|
1287
|
+
function ut({
|
|
1225
1288
|
checked: s = !1,
|
|
1226
1289
|
onChange: t,
|
|
1227
|
-
size:
|
|
1290
|
+
size: n = "m",
|
|
1228
1291
|
disabled: o = !1,
|
|
1229
1292
|
label: a,
|
|
1230
|
-
name:
|
|
1293
|
+
name: r,
|
|
1231
1294
|
value: i,
|
|
1232
1295
|
id: l,
|
|
1233
|
-
...
|
|
1296
|
+
...m
|
|
1234
1297
|
}) {
|
|
1235
|
-
const d = l || `radio-${
|
|
1298
|
+
const d = l || `radio-${U.useId()}`, f = [
|
|
1236
1299
|
"ds-radio",
|
|
1237
|
-
`ds-radio--${
|
|
1300
|
+
`ds-radio--${n}`,
|
|
1238
1301
|
o && "ds-radio--disabled"
|
|
1239
1302
|
].filter(Boolean).join(" ");
|
|
1240
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1303
|
+
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: d, children: [
|
|
1241
1304
|
/* @__PURE__ */ e.jsx(
|
|
1242
1305
|
"input",
|
|
1243
1306
|
{
|
|
@@ -1247,34 +1310,34 @@ function ct({
|
|
|
1247
1310
|
checked: s,
|
|
1248
1311
|
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1249
1312
|
disabled: o,
|
|
1250
|
-
name:
|
|
1313
|
+
name: r,
|
|
1251
1314
|
value: i,
|
|
1252
|
-
...
|
|
1315
|
+
...m
|
|
1253
1316
|
}
|
|
1254
1317
|
),
|
|
1255
1318
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1256
1319
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1257
1320
|
] });
|
|
1258
1321
|
}
|
|
1259
|
-
function
|
|
1322
|
+
function bs({ width: s, height: t, shape: n = "rect", aspectRatio: o, className: a = "", style: r = {}, ...i }) {
|
|
1260
1323
|
return /* @__PURE__ */ e.jsx(
|
|
1261
1324
|
"span",
|
|
1262
1325
|
{
|
|
1263
|
-
className: ["ds-skeleton", `ds-skeleton--${
|
|
1264
|
-
style: { width: s, height: t, aspectRatio: o, ...
|
|
1326
|
+
className: ["ds-skeleton", `ds-skeleton--${n}`, a].filter(Boolean).join(" "),
|
|
1327
|
+
style: { width: s, height: t, aspectRatio: o, ...r },
|
|
1265
1328
|
"aria-hidden": "true",
|
|
1266
1329
|
...i
|
|
1267
1330
|
}
|
|
1268
1331
|
);
|
|
1269
1332
|
}
|
|
1270
|
-
function
|
|
1333
|
+
function js({ lines: s = 1, lastLineWidth: t = "70%", gap: n, className: o = "", style: a = {}, ...r }) {
|
|
1271
1334
|
return /* @__PURE__ */ e.jsx(
|
|
1272
1335
|
"span",
|
|
1273
1336
|
{
|
|
1274
1337
|
className: ["ds-skeleton-text", o].filter(Boolean).join(" "),
|
|
1275
|
-
style: { gap:
|
|
1338
|
+
style: { gap: n, ...a },
|
|
1276
1339
|
"aria-hidden": "true",
|
|
1277
|
-
...
|
|
1340
|
+
...r,
|
|
1278
1341
|
children: Array.from({ length: s }, (i, l) => /* @__PURE__ */ e.jsx(
|
|
1279
1342
|
"span",
|
|
1280
1343
|
{
|
|
@@ -1286,44 +1349,44 @@ function bs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: o = "",
|
|
|
1286
1349
|
}
|
|
1287
1350
|
);
|
|
1288
1351
|
}
|
|
1289
|
-
|
|
1290
|
-
function
|
|
1352
|
+
bs.Text = js;
|
|
1353
|
+
function _s(s) {
|
|
1291
1354
|
let t = 2166136261;
|
|
1292
|
-
for (let
|
|
1293
|
-
t ^= s.charCodeAt(
|
|
1355
|
+
for (let n = 0; n < s.length; n++)
|
|
1356
|
+
t ^= s.charCodeAt(n), t = Math.imul(t, 16777619) >>> 0;
|
|
1294
1357
|
return t % 360;
|
|
1295
1358
|
}
|
|
1296
|
-
function
|
|
1359
|
+
function vs(s) {
|
|
1297
1360
|
if (!s) return "";
|
|
1298
1361
|
const t = s.trim().split(/\s+/);
|
|
1299
1362
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1300
1363
|
}
|
|
1301
|
-
function
|
|
1302
|
-
const l =
|
|
1364
|
+
function ft({ seed: s, icon: t, src: n, size: o = 32, className: a = "", style: r = {}, ...i }) {
|
|
1365
|
+
const l = _s(s ?? ""), [m, d] = D(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: vs(s) });
|
|
1303
1366
|
return /* @__PURE__ */ e.jsx(
|
|
1304
1367
|
"div",
|
|
1305
1368
|
{
|
|
1306
1369
|
className: ["ds-avatar", a].filter(Boolean).join(" "),
|
|
1307
|
-
style: { width: o, height: o, "--ds-avatar-h": l, ...
|
|
1370
|
+
style: { width: o, height: o, "--ds-avatar-h": l, ...r },
|
|
1308
1371
|
"aria-hidden": "true",
|
|
1309
1372
|
...i,
|
|
1310
|
-
children:
|
|
1373
|
+
children: n && !m ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => d(!0) }) : f
|
|
1311
1374
|
}
|
|
1312
1375
|
);
|
|
1313
1376
|
}
|
|
1314
|
-
function
|
|
1377
|
+
function mt({
|
|
1315
1378
|
children: s,
|
|
1316
1379
|
size: t = "compact",
|
|
1317
|
-
stickyTop:
|
|
1380
|
+
stickyTop: n,
|
|
1318
1381
|
maxHeight: o,
|
|
1319
1382
|
className: a = "",
|
|
1320
|
-
style:
|
|
1383
|
+
style: r = {},
|
|
1321
1384
|
...i
|
|
1322
1385
|
}) {
|
|
1323
1386
|
const l = {
|
|
1324
1387
|
...o ? { maxHeight: o } : {},
|
|
1325
|
-
...
|
|
1326
|
-
...
|
|
1388
|
+
...n !== void 0 ? { "--ds-table-sticky-top": typeof n == "number" ? `${n}px` : n } : {},
|
|
1389
|
+
...r
|
|
1327
1390
|
};
|
|
1328
1391
|
return /* @__PURE__ */ e.jsx(
|
|
1329
1392
|
"div",
|
|
@@ -1341,67 +1404,67 @@ function ut({
|
|
|
1341
1404
|
}
|
|
1342
1405
|
);
|
|
1343
1406
|
}
|
|
1344
|
-
function
|
|
1407
|
+
function pt({ children: s, ...t }) {
|
|
1345
1408
|
return /* @__PURE__ */ e.jsx("thead", { ...t, children: s });
|
|
1346
1409
|
}
|
|
1347
|
-
function
|
|
1410
|
+
function ht({ children: s, ...t }) {
|
|
1348
1411
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1349
1412
|
}
|
|
1350
|
-
function
|
|
1413
|
+
function xt({ children: s, interactive: t, selected: n, subheader: o, exiting: a, updated: r, className: i = "", onClick: l, ...m }) {
|
|
1351
1414
|
return /* @__PURE__ */ e.jsx(
|
|
1352
1415
|
"tr",
|
|
1353
1416
|
{
|
|
1354
1417
|
className: [
|
|
1355
1418
|
"ds-table-row",
|
|
1356
1419
|
t || l ? "ds-table-row--interactive" : "",
|
|
1357
|
-
|
|
1420
|
+
n ? "ds-table-row--selected" : "",
|
|
1358
1421
|
o ? "ds-table-row--subheader" : "",
|
|
1359
1422
|
a ? "ds-table-row--exiting" : "",
|
|
1360
|
-
|
|
1423
|
+
r ? "ds-table-row--updated" : "",
|
|
1361
1424
|
i
|
|
1362
1425
|
].filter(Boolean).join(" "),
|
|
1363
1426
|
onClick: l,
|
|
1364
|
-
...
|
|
1427
|
+
...m,
|
|
1365
1428
|
children: s
|
|
1366
1429
|
}
|
|
1367
1430
|
);
|
|
1368
1431
|
}
|
|
1369
|
-
function
|
|
1370
|
-
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...
|
|
1432
|
+
function bt({ children: s, colSpan: t = 999, ...n }) {
|
|
1433
|
+
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1371
1434
|
}
|
|
1372
|
-
function
|
|
1373
|
-
const
|
|
1435
|
+
function jt({ children: s, align: t = "left", sortDir: n, onSort: o, width: a, className: r = "", style: i = {}, ...l }) {
|
|
1436
|
+
const m = !!o || n !== void 0, d = n === "asc" ? He : n === "desc" ? xe : Ke;
|
|
1374
1437
|
return /* @__PURE__ */ e.jsx(
|
|
1375
1438
|
"th",
|
|
1376
1439
|
{
|
|
1377
1440
|
className: [
|
|
1378
1441
|
"ds-th",
|
|
1379
|
-
|
|
1380
|
-
|
|
1442
|
+
m ? "ds-th--sortable" : "",
|
|
1443
|
+
n ? "ds-th--sorted" : "",
|
|
1381
1444
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1382
|
-
|
|
1445
|
+
r
|
|
1383
1446
|
].filter(Boolean).join(" "),
|
|
1384
1447
|
onClick: o,
|
|
1385
1448
|
style: { width: a, ...i },
|
|
1386
1449
|
...l,
|
|
1387
|
-
children:
|
|
1450
|
+
children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1388
1451
|
s,
|
|
1389
1452
|
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
|
|
1390
1453
|
] }) : s
|
|
1391
1454
|
}
|
|
1392
1455
|
);
|
|
1393
1456
|
}
|
|
1394
|
-
function
|
|
1457
|
+
function _t({ children: s, align: t = "left", secondary: n, muted: o, truncate: a, nowrap: r, className: i = "", ...l }) {
|
|
1395
1458
|
return /* @__PURE__ */ e.jsx(
|
|
1396
1459
|
"td",
|
|
1397
1460
|
{
|
|
1398
1461
|
className: [
|
|
1399
1462
|
"ds-td",
|
|
1400
1463
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1401
|
-
|
|
1464
|
+
n ? "ds-table-cell--secondary" : "",
|
|
1402
1465
|
o ? "ds-table-cell--muted" : "",
|
|
1403
1466
|
a ? "ds-table-cell--truncate" : "",
|
|
1404
|
-
|
|
1467
|
+
r ? "ds-table-cell--nowrap" : "",
|
|
1405
1468
|
i
|
|
1406
1469
|
].filter(Boolean).join(" "),
|
|
1407
1470
|
...l,
|
|
@@ -1409,62 +1472,62 @@ function bt({ children: s, align: t = "left", secondary: r, muted: o, truncate:
|
|
|
1409
1472
|
}
|
|
1410
1473
|
);
|
|
1411
1474
|
}
|
|
1412
|
-
function
|
|
1475
|
+
function vt({
|
|
1413
1476
|
icon: s,
|
|
1414
1477
|
title: t,
|
|
1415
|
-
description:
|
|
1478
|
+
description: n,
|
|
1416
1479
|
action: o,
|
|
1417
1480
|
size: a = "m",
|
|
1418
|
-
className:
|
|
1481
|
+
className: r = "",
|
|
1419
1482
|
...i
|
|
1420
1483
|
}) {
|
|
1421
1484
|
return /* @__PURE__ */ e.jsxs(
|
|
1422
1485
|
"div",
|
|
1423
1486
|
{
|
|
1424
|
-
className: ["ds-empty-state", `ds-empty-state--${a}`,
|
|
1487
|
+
className: ["ds-empty-state", `ds-empty-state--${a}`, r].filter(Boolean).join(" "),
|
|
1425
1488
|
...i,
|
|
1426
1489
|
children: [
|
|
1427
1490
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1428
1491
|
/* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__title", children: t }),
|
|
1429
|
-
|
|
1492
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__description", children: n }),
|
|
1430
1493
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__action", children: o })
|
|
1431
1494
|
]
|
|
1432
1495
|
}
|
|
1433
1496
|
);
|
|
1434
1497
|
}
|
|
1435
|
-
function
|
|
1498
|
+
function Nt({
|
|
1436
1499
|
label: s,
|
|
1437
1500
|
hint: t,
|
|
1438
|
-
error:
|
|
1501
|
+
error: n,
|
|
1439
1502
|
required: o = !1,
|
|
1440
1503
|
disabled: a = !1,
|
|
1441
|
-
htmlFor:
|
|
1504
|
+
htmlFor: r,
|
|
1442
1505
|
children: i,
|
|
1443
1506
|
className: l = "",
|
|
1444
|
-
style:
|
|
1507
|
+
style: m,
|
|
1445
1508
|
...d
|
|
1446
1509
|
}) {
|
|
1447
|
-
const
|
|
1510
|
+
const f = U.useId(), p = r ?? f, h = `${p}-hint`, u = `${p}-error`;
|
|
1448
1511
|
return /* @__PURE__ */ e.jsxs(
|
|
1449
1512
|
"div",
|
|
1450
1513
|
{
|
|
1451
1514
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1452
|
-
"data-state":
|
|
1515
|
+
"data-state": n ? "error" : void 0,
|
|
1453
1516
|
"data-required": o ? "" : void 0,
|
|
1454
1517
|
"data-disabled": a ? "" : void 0,
|
|
1455
|
-
style:
|
|
1518
|
+
style: m,
|
|
1456
1519
|
...d,
|
|
1457
1520
|
children: [
|
|
1458
1521
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1459
1522
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
|
|
1460
|
-
t && !
|
|
1461
|
-
|
|
1523
|
+
t && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1524
|
+
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: n })
|
|
1462
1525
|
]
|
|
1463
1526
|
}
|
|
1464
1527
|
);
|
|
1465
1528
|
}
|
|
1466
|
-
function
|
|
1467
|
-
const
|
|
1529
|
+
function wt({ label: s, value: t, delta: n, size: o = "m", inline: a = !1, className: r = "", style: i, ...l }) {
|
|
1530
|
+
const m = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1468
1531
|
return /* @__PURE__ */ e.jsxs(
|
|
1469
1532
|
"div",
|
|
1470
1533
|
{
|
|
@@ -1472,56 +1535,56 @@ function vt({ label: s, value: t, delta: r, size: o = "m", inline: a = !1, class
|
|
|
1472
1535
|
"ds-stat",
|
|
1473
1536
|
`ds-stat--${o}`,
|
|
1474
1537
|
a && "ds-stat--inline",
|
|
1475
|
-
|
|
1538
|
+
r
|
|
1476
1539
|
].filter(Boolean).join(" "),
|
|
1477
1540
|
style: i,
|
|
1478
1541
|
...l,
|
|
1479
1542
|
children: [
|
|
1480
1543
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1481
1544
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1482
|
-
|
|
1545
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: n })
|
|
1483
1546
|
]
|
|
1484
1547
|
}
|
|
1485
1548
|
);
|
|
1486
1549
|
}
|
|
1487
|
-
function
|
|
1550
|
+
function gt({
|
|
1488
1551
|
children: s,
|
|
1489
1552
|
separator: t = "/",
|
|
1490
|
-
"aria-label":
|
|
1553
|
+
"aria-label": n = "Breadcrumb",
|
|
1491
1554
|
className: o = "",
|
|
1492
1555
|
style: a,
|
|
1493
|
-
...
|
|
1556
|
+
...r
|
|
1494
1557
|
}) {
|
|
1495
|
-
const i =
|
|
1558
|
+
const i = U.Children.toArray(s).filter(Boolean);
|
|
1496
1559
|
return /* @__PURE__ */ e.jsx(
|
|
1497
1560
|
"nav",
|
|
1498
1561
|
{
|
|
1499
1562
|
className: `ds-breadcrumb${o ? ` ${o}` : ""}`,
|
|
1500
|
-
"aria-label":
|
|
1563
|
+
"aria-label": n,
|
|
1501
1564
|
style: a,
|
|
1502
|
-
...
|
|
1503
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l,
|
|
1565
|
+
...r,
|
|
1566
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1504
1567
|
l,
|
|
1505
|
-
|
|
1506
|
-
] },
|
|
1568
|
+
m < i.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
1569
|
+
] }, m)) })
|
|
1507
1570
|
}
|
|
1508
1571
|
);
|
|
1509
1572
|
}
|
|
1510
|
-
function
|
|
1573
|
+
function yt({
|
|
1511
1574
|
page: s,
|
|
1512
1575
|
total: t,
|
|
1513
|
-
onChange:
|
|
1576
|
+
onChange: n,
|
|
1514
1577
|
siblings: o = 1,
|
|
1515
1578
|
"aria-label": a = "Pagination",
|
|
1516
|
-
className:
|
|
1579
|
+
className: r = "",
|
|
1517
1580
|
style: i,
|
|
1518
1581
|
...l
|
|
1519
1582
|
}) {
|
|
1520
|
-
const
|
|
1583
|
+
const m = Ns(s, t, o);
|
|
1521
1584
|
return /* @__PURE__ */ e.jsxs(
|
|
1522
1585
|
"nav",
|
|
1523
1586
|
{
|
|
1524
|
-
className: `ds-pagination${
|
|
1587
|
+
className: `ds-pagination${r ? ` ${r}` : ""}`,
|
|
1525
1588
|
"aria-label": a,
|
|
1526
1589
|
style: i,
|
|
1527
1590
|
...l,
|
|
@@ -1530,18 +1593,18 @@ function wt({
|
|
|
1530
1593
|
"button",
|
|
1531
1594
|
{
|
|
1532
1595
|
className: "ds-pagination-arrow",
|
|
1533
|
-
onClick: () =>
|
|
1596
|
+
onClick: () => n == null ? void 0 : n(s - 1),
|
|
1534
1597
|
disabled: s <= 1,
|
|
1535
1598
|
"aria-label": "Previous page",
|
|
1536
1599
|
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1537
1600
|
}
|
|
1538
1601
|
),
|
|
1539
|
-
|
|
1540
|
-
(d,
|
|
1602
|
+
m.map(
|
|
1603
|
+
(d, f) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
|
|
1541
1604
|
"button",
|
|
1542
1605
|
{
|
|
1543
1606
|
className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
|
|
1544
|
-
onClick: () => d !== s && (
|
|
1607
|
+
onClick: () => d !== s && (n == null ? void 0 : n(d)),
|
|
1545
1608
|
"aria-current": d === s ? "page" : void 0,
|
|
1546
1609
|
"aria-label": `Page ${d}`,
|
|
1547
1610
|
children: d
|
|
@@ -1553,7 +1616,7 @@ function wt({
|
|
|
1553
1616
|
"button",
|
|
1554
1617
|
{
|
|
1555
1618
|
className: "ds-pagination-arrow",
|
|
1556
|
-
onClick: () =>
|
|
1619
|
+
onClick: () => n == null ? void 0 : n(s + 1),
|
|
1557
1620
|
disabled: s >= t,
|
|
1558
1621
|
"aria-label": "Next page",
|
|
1559
1622
|
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
@@ -1563,37 +1626,37 @@ function wt({
|
|
|
1563
1626
|
}
|
|
1564
1627
|
);
|
|
1565
1628
|
}
|
|
1566
|
-
function
|
|
1629
|
+
function Ns(s, t, n) {
|
|
1567
1630
|
if (t <= 7) return Array.from({ length: t }, (i, l) => l + 1);
|
|
1568
|
-
const o = Math.max(2, s -
|
|
1569
|
-
o > 2 &&
|
|
1570
|
-
for (let i = o; i <= a; i++)
|
|
1571
|
-
return a < t - 1 &&
|
|
1631
|
+
const o = Math.max(2, s - n), a = Math.min(t - 1, s + n), r = [1];
|
|
1632
|
+
o > 2 && r.push("…");
|
|
1633
|
+
for (let i = o; i <= a; i++) r.push(i);
|
|
1634
|
+
return a < t - 1 && r.push("…"), r.push(t), r;
|
|
1572
1635
|
}
|
|
1573
|
-
const
|
|
1574
|
-
function
|
|
1636
|
+
const ws = 200;
|
|
1637
|
+
function kt({
|
|
1575
1638
|
children: s,
|
|
1576
1639
|
title: t,
|
|
1577
|
-
onClose:
|
|
1640
|
+
onClose: n,
|
|
1578
1641
|
side: o = "right",
|
|
1579
1642
|
...a
|
|
1580
1643
|
}) {
|
|
1581
|
-
const
|
|
1582
|
-
!
|
|
1583
|
-
|
|
1584
|
-
},
|
|
1644
|
+
const r = k(null), i = U.useId(), [l, m] = D(!1), d = () => {
|
|
1645
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
1646
|
+
m(!1), n();
|
|
1647
|
+
}, ws));
|
|
1585
1648
|
};
|
|
1586
|
-
|
|
1587
|
-
const
|
|
1649
|
+
B(() => {
|
|
1650
|
+
const u = (j) => {
|
|
1588
1651
|
j.key === "Escape" && d();
|
|
1589
1652
|
}, b = (j) => {
|
|
1590
|
-
|
|
1653
|
+
r.current && !r.current.contains(j.target) && d();
|
|
1591
1654
|
};
|
|
1592
|
-
return document.addEventListener("keydown",
|
|
1593
|
-
document.removeEventListener("keydown",
|
|
1655
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
1656
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
1594
1657
|
};
|
|
1595
|
-
}, [
|
|
1596
|
-
const
|
|
1658
|
+
}, [n, l]);
|
|
1659
|
+
const f = U.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Be), h = f.filter((u) => (u == null ? void 0 : u.type) !== Be);
|
|
1597
1660
|
return /* @__PURE__ */ e.jsx(
|
|
1598
1661
|
"div",
|
|
1599
1662
|
{
|
|
@@ -1604,14 +1667,14 @@ function gt({
|
|
|
1604
1667
|
{
|
|
1605
1668
|
className: ["ds-drawer", l && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1606
1669
|
"data-side": o,
|
|
1607
|
-
ref:
|
|
1670
|
+
ref: r,
|
|
1608
1671
|
role: "dialog",
|
|
1609
1672
|
"aria-modal": "true",
|
|
1610
1673
|
"aria-labelledby": t ? i : void 0,
|
|
1611
1674
|
children: [
|
|
1612
1675
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1613
1676
|
t && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-drawer-title", children: t }),
|
|
1614
|
-
|
|
1677
|
+
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(te, { size: I[2], strokeWidth: 1.5 }) })
|
|
1615
1678
|
] }),
|
|
1616
1679
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children: h }),
|
|
1617
1680
|
p
|
|
@@ -1624,38 +1687,38 @@ function gt({
|
|
|
1624
1687
|
function Be({ children: s }) {
|
|
1625
1688
|
return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: s });
|
|
1626
1689
|
}
|
|
1627
|
-
const
|
|
1628
|
-
info:
|
|
1629
|
-
success:
|
|
1630
|
-
warning:
|
|
1631
|
-
error:
|
|
1690
|
+
const gs = {
|
|
1691
|
+
info: Ee,
|
|
1692
|
+
success: ke,
|
|
1693
|
+
warning: ye,
|
|
1694
|
+
error: ge
|
|
1632
1695
|
};
|
|
1633
|
-
function
|
|
1696
|
+
function Et({
|
|
1634
1697
|
children: s,
|
|
1635
1698
|
variant: t = "info",
|
|
1636
|
-
action:
|
|
1699
|
+
action: n,
|
|
1637
1700
|
onAction: o,
|
|
1638
1701
|
onDismiss: a,
|
|
1639
|
-
role:
|
|
1702
|
+
role: r,
|
|
1640
1703
|
...i
|
|
1641
1704
|
}) {
|
|
1642
|
-
const l =
|
|
1705
|
+
const l = gs[t], m = r || (t === "error" ? "alert" : "status");
|
|
1643
1706
|
return /* @__PURE__ */ e.jsxs(
|
|
1644
1707
|
"div",
|
|
1645
1708
|
{
|
|
1646
1709
|
className: `ds-banner ds-banner--${t}`,
|
|
1647
|
-
role:
|
|
1710
|
+
role: m,
|
|
1648
1711
|
...i,
|
|
1649
1712
|
children: [
|
|
1650
1713
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
1651
1714
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1652
|
-
|
|
1715
|
+
n && /* @__PURE__ */ e.jsx(
|
|
1653
1716
|
"button",
|
|
1654
1717
|
{
|
|
1655
1718
|
type: "button",
|
|
1656
1719
|
className: "ds-banner-action",
|
|
1657
1720
|
onClick: o,
|
|
1658
|
-
children:
|
|
1721
|
+
children: n
|
|
1659
1722
|
}
|
|
1660
1723
|
),
|
|
1661
1724
|
a && /* @__PURE__ */ e.jsx(
|
|
@@ -1665,53 +1728,53 @@ function yt({
|
|
|
1665
1728
|
className: "ds-banner-dismiss",
|
|
1666
1729
|
onClick: a,
|
|
1667
1730
|
"aria-label": "Dismiss",
|
|
1668
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1731
|
+
children: /* @__PURE__ */ e.jsx(te, { size: I[2], strokeWidth: 1.5 })
|
|
1669
1732
|
}
|
|
1670
1733
|
)
|
|
1671
1734
|
]
|
|
1672
1735
|
}
|
|
1673
1736
|
);
|
|
1674
1737
|
}
|
|
1675
|
-
function
|
|
1738
|
+
function $t({
|
|
1676
1739
|
trigger: s,
|
|
1677
1740
|
items: t = [],
|
|
1678
|
-
open:
|
|
1741
|
+
open: n,
|
|
1679
1742
|
onOpenChange: o,
|
|
1680
1743
|
align: a = "left",
|
|
1681
|
-
className:
|
|
1744
|
+
className: r = "",
|
|
1682
1745
|
style: i,
|
|
1683
1746
|
...l
|
|
1684
1747
|
}) {
|
|
1685
|
-
const [
|
|
1748
|
+
const [m, d] = D(!1), [f, p] = D(!1), h = n !== void 0, u = h ? n : m, b = k(null), j = k(null), R = k(null), $ = k(null), [L, y] = D({}), T = k(null), z = 150, A = () => {
|
|
1686
1749
|
if (h)
|
|
1687
1750
|
o == null || o(!1);
|
|
1688
1751
|
else {
|
|
1689
|
-
if (
|
|
1752
|
+
if (f) return;
|
|
1690
1753
|
p(!0), T.current = setTimeout(() => {
|
|
1691
1754
|
d(!1), p(!1);
|
|
1692
1755
|
}, z);
|
|
1693
1756
|
}
|
|
1694
|
-
},
|
|
1695
|
-
const x = !
|
|
1757
|
+
}, q = () => {
|
|
1758
|
+
const x = !u;
|
|
1696
1759
|
h ? o == null || o(x) : x ? (clearTimeout(T.current), p(!1), d(!0)) : A();
|
|
1697
1760
|
}, H = () => {
|
|
1698
|
-
|
|
1761
|
+
u || (h ? o == null || o(!0) : (clearTimeout(T.current), p(!1), d(!0)));
|
|
1699
1762
|
};
|
|
1700
|
-
|
|
1701
|
-
if (!
|
|
1763
|
+
B(() => () => clearTimeout(T.current), []), B(() => {
|
|
1764
|
+
if (!u) return;
|
|
1702
1765
|
const x = 300, N = () => {
|
|
1703
1766
|
var G;
|
|
1704
|
-
const
|
|
1705
|
-
if (!
|
|
1706
|
-
const
|
|
1767
|
+
const E = (G = b.current) == null ? void 0 : G.getBoundingClientRect();
|
|
1768
|
+
if (!E) return;
|
|
1769
|
+
const M = window.innerHeight - E.bottom, K = M < x + 8 && E.top > M;
|
|
1707
1770
|
y(
|
|
1708
|
-
a === "right" ?
|
|
1771
|
+
a === "right" ? K ? { bottom: window.innerHeight - E.top + 4, top: "auto", right: window.innerWidth - E.right } : { top: E.bottom + 4, bottom: "auto", right: window.innerWidth - E.right } : K ? { bottom: window.innerHeight - E.top + 4, top: "auto", left: E.left } : { top: E.bottom + 4, bottom: "auto", left: E.left }
|
|
1709
1772
|
);
|
|
1710
1773
|
};
|
|
1711
1774
|
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
1712
1775
|
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
1713
1776
|
};
|
|
1714
|
-
}, [
|
|
1777
|
+
}, [u, a]);
|
|
1715
1778
|
const F = () => {
|
|
1716
1779
|
var N;
|
|
1717
1780
|
const x = (N = R.current) == null ? void 0 : N.querySelector(
|
|
@@ -1719,44 +1782,44 @@ function kt({
|
|
|
1719
1782
|
);
|
|
1720
1783
|
x == null || x.focus();
|
|
1721
1784
|
};
|
|
1722
|
-
|
|
1723
|
-
if (!
|
|
1724
|
-
const x = (
|
|
1725
|
-
var
|
|
1726
|
-
!((
|
|
1727
|
-
}, N = (
|
|
1728
|
-
|
|
1785
|
+
B(() => {
|
|
1786
|
+
if (!u) return;
|
|
1787
|
+
const x = (E) => {
|
|
1788
|
+
var M, K;
|
|
1789
|
+
!((M = b.current) != null && M.contains(E.target)) && !((K = j.current) != null && K.contains(E.target)) && A();
|
|
1790
|
+
}, N = (E) => {
|
|
1791
|
+
E.key === "Escape" && (A(), F());
|
|
1729
1792
|
};
|
|
1730
1793
|
return document.addEventListener("mousedown", x), document.addEventListener("keydown", N), () => {
|
|
1731
1794
|
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", N);
|
|
1732
1795
|
};
|
|
1733
|
-
}, [
|
|
1734
|
-
if (!
|
|
1796
|
+
}, [u]), B(() => {
|
|
1797
|
+
if (!u || !$.current || !j.current) return;
|
|
1735
1798
|
const x = v(), N = $.current === "last" ? x[x.length - 1] : x[0];
|
|
1736
1799
|
N == null || N.focus(), $.current = null;
|
|
1737
|
-
}, [
|
|
1800
|
+
}, [u]);
|
|
1738
1801
|
const v = () => j.current ? [...j.current.querySelectorAll(
|
|
1739
1802
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1740
1803
|
)] : [], C = (x) => {
|
|
1741
|
-
var N,
|
|
1804
|
+
var N, E;
|
|
1742
1805
|
if (x.key === "ArrowDown")
|
|
1743
|
-
x.preventDefault(),
|
|
1806
|
+
x.preventDefault(), u ? (N = v()[0]) == null || N.focus() : ($.current = "first", H());
|
|
1744
1807
|
else if (x.key === "ArrowUp")
|
|
1745
|
-
if (x.preventDefault(), !
|
|
1808
|
+
if (x.preventDefault(), !u)
|
|
1746
1809
|
$.current = "last", H();
|
|
1747
1810
|
else {
|
|
1748
|
-
const
|
|
1749
|
-
(
|
|
1811
|
+
const M = v();
|
|
1812
|
+
(E = M[M.length - 1]) == null || E.focus();
|
|
1750
1813
|
}
|
|
1751
1814
|
}, X = (x) => {
|
|
1752
|
-
var
|
|
1753
|
-
const N = v(),
|
|
1815
|
+
var M, K, G, g;
|
|
1816
|
+
const N = v(), E = N.findIndex((c) => c === document.activeElement);
|
|
1754
1817
|
switch (x.key) {
|
|
1755
1818
|
case "ArrowDown":
|
|
1756
|
-
x.preventDefault(), (
|
|
1819
|
+
x.preventDefault(), (M = N[Math.min(E + 1, N.length - 1)]) == null || M.focus();
|
|
1757
1820
|
break;
|
|
1758
1821
|
case "ArrowUp":
|
|
1759
|
-
x.preventDefault(),
|
|
1822
|
+
x.preventDefault(), E <= 0 ? F() : (K = N[E - 1]) == null || K.focus();
|
|
1760
1823
|
break;
|
|
1761
1824
|
case "Home":
|
|
1762
1825
|
x.preventDefault(), (G = N[0]) == null || G.focus();
|
|
@@ -1768,7 +1831,7 @@ function kt({
|
|
|
1768
1831
|
A();
|
|
1769
1832
|
break;
|
|
1770
1833
|
}
|
|
1771
|
-
},
|
|
1834
|
+
}, V = u && /* @__PURE__ */ e.jsx(
|
|
1772
1835
|
"div",
|
|
1773
1836
|
{
|
|
1774
1837
|
ref: j,
|
|
@@ -1776,9 +1839,9 @@ function kt({
|
|
|
1776
1839
|
className: [
|
|
1777
1840
|
"ds-dropdown__menu",
|
|
1778
1841
|
`ds-dropdown__menu--${a}`,
|
|
1779
|
-
|
|
1842
|
+
f && "ds-dropdown__menu--closing"
|
|
1780
1843
|
].filter(Boolean).join(" "),
|
|
1781
|
-
style:
|
|
1844
|
+
style: L,
|
|
1782
1845
|
onKeyDown: X,
|
|
1783
1846
|
children: t.map((x, N) => {
|
|
1784
1847
|
if (x.separator)
|
|
@@ -1788,16 +1851,16 @@ function kt({
|
|
|
1788
1851
|
x.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
|
|
1789
1852
|
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
|
|
1790
1853
|
] }, N);
|
|
1791
|
-
const
|
|
1854
|
+
const E = !!x.href, M = E ? "a" : "button", K = E ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
|
|
1792
1855
|
return /* @__PURE__ */ e.jsxs(
|
|
1793
|
-
|
|
1856
|
+
M,
|
|
1794
1857
|
{
|
|
1795
1858
|
role: "menuitem",
|
|
1796
1859
|
className: [
|
|
1797
1860
|
"ds-dropdown__item",
|
|
1798
1861
|
x.danger && "ds-dropdown__item--danger"
|
|
1799
1862
|
].filter(Boolean).join(" "),
|
|
1800
|
-
...
|
|
1863
|
+
...K,
|
|
1801
1864
|
onClick: () => {
|
|
1802
1865
|
var G;
|
|
1803
1866
|
(G = x.onClick) == null || G.call(x), A();
|
|
@@ -1817,7 +1880,7 @@ function kt({
|
|
|
1817
1880
|
"div",
|
|
1818
1881
|
{
|
|
1819
1882
|
ref: b,
|
|
1820
|
-
className: ["ds-dropdown",
|
|
1883
|
+
className: ["ds-dropdown", r].filter(Boolean).join(" "),
|
|
1821
1884
|
style: i,
|
|
1822
1885
|
...l,
|
|
1823
1886
|
children: [
|
|
@@ -1826,32 +1889,32 @@ function kt({
|
|
|
1826
1889
|
{
|
|
1827
1890
|
ref: R,
|
|
1828
1891
|
className: "ds-dropdown__trigger",
|
|
1829
|
-
onClick:
|
|
1892
|
+
onClick: q,
|
|
1830
1893
|
onKeyDown: C,
|
|
1831
1894
|
children: s
|
|
1832
1895
|
}
|
|
1833
1896
|
),
|
|
1834
|
-
typeof document < "u" && pe.createPortal(
|
|
1897
|
+
typeof document < "u" && pe.createPortal(V, document.body)
|
|
1835
1898
|
]
|
|
1836
1899
|
}
|
|
1837
1900
|
);
|
|
1838
1901
|
}
|
|
1839
|
-
function
|
|
1902
|
+
function Tt({
|
|
1840
1903
|
value: s = 0,
|
|
1841
1904
|
size: t = "m",
|
|
1842
|
-
variant:
|
|
1905
|
+
variant: n = "default",
|
|
1843
1906
|
showValue: o = !1,
|
|
1844
1907
|
min: a = 2,
|
|
1845
|
-
animate:
|
|
1908
|
+
animate: r = !0
|
|
1846
1909
|
}) {
|
|
1847
|
-
const i = Math.min(100, Math.max(0, s)), l = Math.max(a, i),
|
|
1910
|
+
const i = Math.min(100, Math.max(0, s)), l = Math.max(a, i), m = n === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : n;
|
|
1848
1911
|
return /* @__PURE__ */ e.jsxs(
|
|
1849
1912
|
"div",
|
|
1850
1913
|
{
|
|
1851
1914
|
className: [
|
|
1852
1915
|
"ds-progress",
|
|
1853
1916
|
`ds-progress--${t}`,
|
|
1854
|
-
!
|
|
1917
|
+
!r && "ds-progress--instant"
|
|
1855
1918
|
].filter(Boolean).join(" "),
|
|
1856
1919
|
role: "progressbar",
|
|
1857
1920
|
"aria-valuenow": i,
|
|
@@ -1861,7 +1924,7 @@ function Et({
|
|
|
1861
1924
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
1862
1925
|
"div",
|
|
1863
1926
|
{
|
|
1864
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
1927
|
+
className: `ds-progress__fill ds-progress__fill--${m}`,
|
|
1865
1928
|
style: { width: `${l}%` }
|
|
1866
1929
|
}
|
|
1867
1930
|
) }),
|
|
@@ -1873,107 +1936,107 @@ function Et({
|
|
|
1873
1936
|
}
|
|
1874
1937
|
);
|
|
1875
1938
|
}
|
|
1876
|
-
const
|
|
1877
|
-
function
|
|
1878
|
-
const [
|
|
1879
|
-
return
|
|
1880
|
-
if (
|
|
1939
|
+
const ys = (s) => 1 - Math.pow(1 - s, 3), ks = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1940
|
+
function Es(s, { duration: t = 600 } = {}) {
|
|
1941
|
+
const [n, o] = D(s), a = k(s), r = k(null);
|
|
1942
|
+
return B(() => {
|
|
1943
|
+
if (ks()) {
|
|
1881
1944
|
o(s), a.current = s;
|
|
1882
1945
|
return;
|
|
1883
1946
|
}
|
|
1884
1947
|
const i = a.current, l = s - i;
|
|
1885
1948
|
if (l === 0) return;
|
|
1886
|
-
let
|
|
1887
|
-
const d = (
|
|
1888
|
-
|
|
1889
|
-
const p = Math.min((
|
|
1890
|
-
o(i + l *
|
|
1949
|
+
let m = null;
|
|
1950
|
+
const d = (f) => {
|
|
1951
|
+
m || (m = f);
|
|
1952
|
+
const p = Math.min((f - m) / t, 1);
|
|
1953
|
+
o(i + l * ys(p)), p < 1 ? r.current = requestAnimationFrame(d) : a.current = s;
|
|
1891
1954
|
};
|
|
1892
|
-
return
|
|
1893
|
-
}, [s, t]),
|
|
1955
|
+
return r.current = requestAnimationFrame(d), () => cancelAnimationFrame(r.current);
|
|
1956
|
+
}, [s, t]), n;
|
|
1894
1957
|
}
|
|
1895
|
-
function
|
|
1958
|
+
function Rt({
|
|
1896
1959
|
value: s,
|
|
1897
1960
|
duration: t = 600,
|
|
1898
|
-
decimals:
|
|
1961
|
+
decimals: n = 0,
|
|
1899
1962
|
prefix: o = "",
|
|
1900
1963
|
suffix: a = ""
|
|
1901
1964
|
}) {
|
|
1902
|
-
const i =
|
|
1965
|
+
const i = Es(s, { duration: t }).toFixed(n);
|
|
1903
1966
|
return `${o}${i}${a}`;
|
|
1904
1967
|
}
|
|
1905
|
-
function
|
|
1906
|
-
const o =
|
|
1907
|
-
return
|
|
1968
|
+
function $s({ threshold: s = 0.1, rootMargin: t = "0px", once: n = !1 } = {}) {
|
|
1969
|
+
const o = k(null), [a, r] = D(!1);
|
|
1970
|
+
return B(() => {
|
|
1908
1971
|
const i = o.current;
|
|
1909
1972
|
if (!i) return;
|
|
1910
1973
|
const l = new IntersectionObserver(
|
|
1911
|
-
([
|
|
1912
|
-
|
|
1974
|
+
([m]) => {
|
|
1975
|
+
m.isIntersecting ? (r(!0), n && l.disconnect()) : n || r(!1);
|
|
1913
1976
|
},
|
|
1914
1977
|
{ threshold: s, rootMargin: t }
|
|
1915
1978
|
);
|
|
1916
1979
|
return l.observe(i), () => l.disconnect();
|
|
1917
|
-
}, [s, t,
|
|
1980
|
+
}, [s, t, n]), { ref: o, inView: a };
|
|
1918
1981
|
}
|
|
1919
|
-
function
|
|
1982
|
+
function St({
|
|
1920
1983
|
children: s,
|
|
1921
1984
|
as: t = "div",
|
|
1922
|
-
once:
|
|
1985
|
+
once: n = !1,
|
|
1923
1986
|
threshold: o = 0.1,
|
|
1924
1987
|
rootMargin: a = "0px",
|
|
1925
|
-
onEnter:
|
|
1988
|
+
onEnter: r,
|
|
1926
1989
|
onLeave: i,
|
|
1927
1990
|
...l
|
|
1928
1991
|
}) {
|
|
1929
|
-
const { ref:
|
|
1930
|
-
return
|
|
1931
|
-
d && !
|
|
1932
|
-
}, [d]), /* @__PURE__ */ e.jsx(t, { ref:
|
|
1933
|
-
}
|
|
1934
|
-
const
|
|
1935
|
-
default:
|
|
1936
|
-
success:
|
|
1937
|
-
warning:
|
|
1938
|
-
error:
|
|
1992
|
+
const { ref: m, inView: d } = $s({ threshold: o, rootMargin: a, once: n }), f = k(!1);
|
|
1993
|
+
return B(() => {
|
|
1994
|
+
d && !f.current && (r == null || r()), !d && f.current && (i == null || i()), f.current = d;
|
|
1995
|
+
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1996
|
+
}
|
|
1997
|
+
const Le = {
|
|
1998
|
+
default: Ee,
|
|
1999
|
+
success: ke,
|
|
2000
|
+
warning: ye,
|
|
2001
|
+
error: ge
|
|
1939
2002
|
};
|
|
1940
|
-
let
|
|
1941
|
-
const
|
|
2003
|
+
let ue = [];
|
|
2004
|
+
const ve = /* @__PURE__ */ new Set();
|
|
1942
2005
|
function We() {
|
|
1943
|
-
|
|
1944
|
-
}
|
|
1945
|
-
function $s(s) {
|
|
1946
|
-
de = [...de, s], We();
|
|
2006
|
+
ve.forEach((s) => s([...ue]));
|
|
1947
2007
|
}
|
|
1948
2008
|
function Ts(s) {
|
|
1949
|
-
|
|
2009
|
+
ue = [...ue, s], We();
|
|
1950
2010
|
}
|
|
1951
|
-
function
|
|
1952
|
-
|
|
1953
|
-
|
|
2011
|
+
function Rs(s) {
|
|
2012
|
+
ue = ue.filter((t) => t.id !== s), We();
|
|
2013
|
+
}
|
|
2014
|
+
function Dt() {
|
|
2015
|
+
const s = (t, n = {}) => {
|
|
2016
|
+
Ts({
|
|
1954
2017
|
id: `${Date.now()}-${Math.random()}`,
|
|
1955
2018
|
message: t,
|
|
1956
2019
|
type: "default",
|
|
1957
2020
|
duration: 4e3,
|
|
1958
|
-
...
|
|
2021
|
+
...n
|
|
1959
2022
|
});
|
|
1960
2023
|
};
|
|
1961
|
-
return s.success = (t,
|
|
2024
|
+
return s.success = (t, n) => s(t, { ...n, type: "success" }), s.error = (t, n) => s(t, { ...n, type: "error" }), s.warning = (t, n) => s(t, { ...n, type: "warning" }), { toast: s };
|
|
1962
2025
|
}
|
|
1963
|
-
function
|
|
1964
|
-
const [
|
|
1965
|
-
|
|
1966
|
-
function
|
|
2026
|
+
function Ss({ data: s, onDismiss: t }) {
|
|
2027
|
+
const [n, o] = D(!1), a = k(null);
|
|
2028
|
+
B(() => (requestAnimationFrame(() => o(!0)), s.duration > 0 && (a.current = setTimeout(() => r(), s.duration)), () => clearTimeout(a.current)), []);
|
|
2029
|
+
function r() {
|
|
1967
2030
|
o(!1), setTimeout(() => t(s.id), 250);
|
|
1968
2031
|
}
|
|
1969
|
-
const i =
|
|
2032
|
+
const i = Le[s.type] ?? Le.default;
|
|
1970
2033
|
return /* @__PURE__ */ e.jsxs(
|
|
1971
2034
|
"div",
|
|
1972
2035
|
{
|
|
1973
2036
|
className: [
|
|
1974
2037
|
"ds-toast",
|
|
1975
2038
|
`ds-toast--${s.type}`,
|
|
1976
|
-
|
|
2039
|
+
n && "ds-toast--visible"
|
|
1977
2040
|
].filter(Boolean).join(" "),
|
|
1978
2041
|
role: s.type === "error" ? "alert" : "status",
|
|
1979
2042
|
"aria-live": "polite",
|
|
@@ -1984,58 +2047,58 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1984
2047
|
"button",
|
|
1985
2048
|
{
|
|
1986
2049
|
className: "ds-toast__close",
|
|
1987
|
-
onClick:
|
|
2050
|
+
onClick: r,
|
|
1988
2051
|
"aria-label": "Закрыть",
|
|
1989
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2052
|
+
children: /* @__PURE__ */ e.jsx(te, { size: I[3], strokeWidth: 1.5 })
|
|
1990
2053
|
}
|
|
1991
2054
|
)
|
|
1992
2055
|
]
|
|
1993
2056
|
}
|
|
1994
2057
|
);
|
|
1995
2058
|
}
|
|
1996
|
-
function
|
|
1997
|
-
const [t,
|
|
1998
|
-
return
|
|
1999
|
-
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(
|
|
2059
|
+
function It({ position: s = "bottom-right" }) {
|
|
2060
|
+
const [t, n] = D(() => [...ue]);
|
|
2061
|
+
return B(() => (ve.add(n), () => ve.delete(n)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
2062
|
+
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(Ss, { data: o, onDismiss: Rs }, o.id)) }),
|
|
2000
2063
|
document.body
|
|
2001
2064
|
);
|
|
2002
2065
|
}
|
|
2003
|
-
const
|
|
2004
|
-
running: /* @__PURE__ */ e.jsx(
|
|
2005
|
-
success: /* @__PURE__ */ e.jsx(
|
|
2006
|
-
error: /* @__PURE__ */ e.jsx(
|
|
2066
|
+
const Ds = {
|
|
2067
|
+
running: /* @__PURE__ */ e.jsx(de, { size: "xs", variant: "info", children: "Running..." }),
|
|
2068
|
+
success: /* @__PURE__ */ e.jsx(de, { size: "xs", variant: "success", children: "Done" }),
|
|
2069
|
+
error: /* @__PURE__ */ e.jsx(de, { size: "xs", variant: "error", children: "Error" })
|
|
2007
2070
|
};
|
|
2008
|
-
function
|
|
2071
|
+
function At({
|
|
2009
2072
|
label: s,
|
|
2010
2073
|
status: t = "idle",
|
|
2011
|
-
icon:
|
|
2074
|
+
icon: n,
|
|
2012
2075
|
badge: o,
|
|
2013
2076
|
defaultExpanded: a = !1,
|
|
2014
|
-
expanded:
|
|
2077
|
+
expanded: r,
|
|
2015
2078
|
onToggle: i,
|
|
2016
2079
|
children: l,
|
|
2017
|
-
className:
|
|
2080
|
+
className: m = "",
|
|
2018
2081
|
...d
|
|
2019
2082
|
}) {
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2083
|
+
const f = t === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2084
|
+
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2022
2085
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2023
|
-
|
|
2086
|
+
Ds[t],
|
|
2024
2087
|
o
|
|
2025
2088
|
] });
|
|
2026
2089
|
return l ? /* @__PURE__ */ e.jsx(
|
|
2027
2090
|
"div",
|
|
2028
2091
|
{
|
|
2029
|
-
className: ["ds-tool-card",
|
|
2092
|
+
className: ["ds-tool-card", f && "ds-tool-card--running", m].filter(Boolean).join(" "),
|
|
2030
2093
|
...d,
|
|
2031
2094
|
children: /* @__PURE__ */ e.jsx(
|
|
2032
|
-
|
|
2095
|
+
$e,
|
|
2033
2096
|
{
|
|
2034
2097
|
title: p,
|
|
2035
2098
|
padding: "s",
|
|
2036
2099
|
defaultExpanded: a,
|
|
2037
|
-
expanded:
|
|
2038
|
-
onToggle:
|
|
2100
|
+
expanded: f ? !1 : r,
|
|
2101
|
+
onToggle: f ? void 0 : i,
|
|
2039
2102
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2040
2103
|
}
|
|
2041
2104
|
)
|
|
@@ -2043,30 +2106,30 @@ function Dt({
|
|
|
2043
2106
|
) : /* @__PURE__ */ e.jsx(
|
|
2044
2107
|
"div",
|
|
2045
2108
|
{
|
|
2046
|
-
className: ["ds-tool-card", "ds-tool-card--bubble",
|
|
2109
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", m].filter(Boolean).join(" "),
|
|
2047
2110
|
...d,
|
|
2048
2111
|
children: p
|
|
2049
2112
|
}
|
|
2050
2113
|
);
|
|
2051
2114
|
}
|
|
2052
|
-
function
|
|
2115
|
+
function Is({
|
|
2053
2116
|
text: s,
|
|
2054
2117
|
size: t = "xs",
|
|
2055
|
-
timeout:
|
|
2118
|
+
timeout: n = 800,
|
|
2056
2119
|
"aria-label": o = "Copy to clipboard",
|
|
2057
2120
|
...a
|
|
2058
2121
|
}) {
|
|
2059
|
-
const [
|
|
2060
|
-
|
|
2061
|
-
i(!0), setTimeout(() => i(!1),
|
|
2122
|
+
const [r, i] = D(!1), l = (m) => {
|
|
2123
|
+
m.currentTarget.blur(), navigator.clipboard.writeText(s).then(() => {
|
|
2124
|
+
i(!0), setTimeout(() => i(!1), n);
|
|
2062
2125
|
});
|
|
2063
2126
|
};
|
|
2064
2127
|
return /* @__PURE__ */ e.jsx(
|
|
2065
|
-
|
|
2128
|
+
ce,
|
|
2066
2129
|
{
|
|
2067
2130
|
variant: "ghost",
|
|
2068
2131
|
size: t,
|
|
2069
|
-
state:
|
|
2132
|
+
state: r ? "success" : "idle",
|
|
2070
2133
|
icon: /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
|
|
2071
2134
|
"aria-label": o,
|
|
2072
2135
|
onClick: l,
|
|
@@ -2074,12 +2137,12 @@ function Ds({
|
|
|
2074
2137
|
}
|
|
2075
2138
|
);
|
|
2076
2139
|
}
|
|
2077
|
-
function
|
|
2140
|
+
function Bt({ content: s, streaming: t = !1, ...n }) {
|
|
2078
2141
|
const [o, a] = D(t);
|
|
2079
|
-
return
|
|
2142
|
+
return B(() => {
|
|
2080
2143
|
a(!!t);
|
|
2081
2144
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
2082
|
-
|
|
2145
|
+
$e,
|
|
2083
2146
|
{
|
|
2084
2147
|
expanded: o,
|
|
2085
2148
|
onToggle: a,
|
|
@@ -2088,7 +2151,7 @@ function At({ content: s, streaming: t = !1, ...r }) {
|
|
|
2088
2151
|
/* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2089
2152
|
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2090
2153
|
] }),
|
|
2091
|
-
...
|
|
2154
|
+
...n,
|
|
2092
2155
|
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2093
2156
|
s,
|
|
2094
2157
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
@@ -2096,34 +2159,34 @@ function At({ content: s, streaming: t = !1, ...r }) {
|
|
|
2096
2159
|
}
|
|
2097
2160
|
);
|
|
2098
2161
|
}
|
|
2099
|
-
function
|
|
2162
|
+
function Lt({
|
|
2100
2163
|
count: s,
|
|
2101
2164
|
current: t = 0,
|
|
2102
|
-
done:
|
|
2165
|
+
done: n = [],
|
|
2103
2166
|
onChange: o,
|
|
2104
2167
|
showCounter: a = !0,
|
|
2105
|
-
className:
|
|
2168
|
+
className: r = "",
|
|
2106
2169
|
"aria-label": i = "Steps",
|
|
2107
2170
|
...l
|
|
2108
2171
|
}) {
|
|
2109
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2110
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: s }, (
|
|
2111
|
-
const
|
|
2172
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", r].filter(Boolean).join(" "), ...l, children: [
|
|
2173
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: s }, (m, d) => {
|
|
2174
|
+
const f = d === t, p = n.includes(d) && !f, h = o && (d <= t || n.includes(d)), u = [
|
|
2112
2175
|
"ds-step-indicator__dot",
|
|
2113
|
-
|
|
2176
|
+
f && "ds-step-indicator__dot--active",
|
|
2114
2177
|
p && "ds-step-indicator__dot--done"
|
|
2115
2178
|
].filter(Boolean).join(" ");
|
|
2116
2179
|
return /* @__PURE__ */ e.jsx(
|
|
2117
2180
|
"button",
|
|
2118
2181
|
{
|
|
2119
2182
|
type: "button",
|
|
2120
|
-
className:
|
|
2183
|
+
className: u,
|
|
2121
2184
|
role: "tab",
|
|
2122
|
-
"aria-selected":
|
|
2185
|
+
"aria-selected": f,
|
|
2123
2186
|
"aria-label": `Step ${d + 1}`,
|
|
2124
2187
|
disabled: !h || d === t,
|
|
2125
2188
|
onClick: () => o == null ? void 0 : o(d),
|
|
2126
|
-
children: p ? /* @__PURE__ */ e.jsx(
|
|
2189
|
+
children: p ? /* @__PURE__ */ e.jsx(we, { size: 8, strokeWidth: 3 }) : null
|
|
2127
2190
|
},
|
|
2128
2191
|
d
|
|
2129
2192
|
);
|
|
@@ -2135,79 +2198,79 @@ function It({
|
|
|
2135
2198
|
] })
|
|
2136
2199
|
] });
|
|
2137
2200
|
}
|
|
2138
|
-
function
|
|
2201
|
+
function Mt({
|
|
2139
2202
|
content: s,
|
|
2140
2203
|
isStreaming: t = !1,
|
|
2141
|
-
cursor:
|
|
2204
|
+
cursor: n = "line",
|
|
2142
2205
|
onChunk: o,
|
|
2143
2206
|
className: a = "",
|
|
2144
|
-
...
|
|
2207
|
+
...r
|
|
2145
2208
|
}) {
|
|
2146
|
-
const i =
|
|
2147
|
-
return
|
|
2209
|
+
const i = k(s);
|
|
2210
|
+
return B(() => {
|
|
2148
2211
|
s !== i.current && (o == null || o(s), i.current = s);
|
|
2149
|
-
}, [s, o]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...
|
|
2212
|
+
}, [s, o]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...r, children: [
|
|
2150
2213
|
s,
|
|
2151
|
-
t &&
|
|
2214
|
+
t && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2152
2215
|
] });
|
|
2153
2216
|
}
|
|
2154
|
-
function
|
|
2217
|
+
function Pt({
|
|
2155
2218
|
role: s = "assistant",
|
|
2156
2219
|
header: t,
|
|
2157
|
-
footer:
|
|
2220
|
+
footer: n,
|
|
2158
2221
|
attachments: o,
|
|
2159
2222
|
isStreaming: a = !1,
|
|
2160
|
-
children:
|
|
2223
|
+
children: r,
|
|
2161
2224
|
className: i = "",
|
|
2162
2225
|
...l
|
|
2163
2226
|
}) {
|
|
2164
|
-
const
|
|
2227
|
+
const m = [
|
|
2165
2228
|
"ds-chat-message",
|
|
2166
2229
|
`ds-chat-message--${s}`,
|
|
2167
2230
|
a && "ds-chat-message--streaming",
|
|
2168
2231
|
i
|
|
2169
2232
|
].filter(Boolean).join(" ");
|
|
2170
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2233
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: r }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2171
2234
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: o }),
|
|
2172
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2173
|
-
|
|
2174
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2235
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: r }),
|
|
2236
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2237
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2175
2238
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2176
2239
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: o }),
|
|
2177
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2178
|
-
|
|
2240
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: r }),
|
|
2241
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2179
2242
|
] });
|
|
2180
2243
|
}
|
|
2181
|
-
function
|
|
2182
|
-
const o =
|
|
2183
|
-
|
|
2184
|
-
const
|
|
2185
|
-
if (!
|
|
2244
|
+
function zt(s, { containerRef: t, smartPause: n = !0 } = {}) {
|
|
2245
|
+
const o = k(!1), a = k(0);
|
|
2246
|
+
B(() => {
|
|
2247
|
+
const r = t == null ? void 0 : t.current;
|
|
2248
|
+
if (!r) return;
|
|
2186
2249
|
const i = () => {
|
|
2187
|
-
const l =
|
|
2188
|
-
!l &&
|
|
2250
|
+
const l = r.scrollHeight - r.scrollTop - r.clientHeight < 64;
|
|
2251
|
+
!l && r.scrollTop < a.current && (o.current = !0), l && (o.current = !1), a.current = r.scrollTop;
|
|
2189
2252
|
};
|
|
2190
|
-
return
|
|
2191
|
-
}, [t]),
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2253
|
+
return r.addEventListener("scroll", i, { passive: !0 }), () => r.removeEventListener("scroll", i);
|
|
2254
|
+
}, [t]), B(() => {
|
|
2255
|
+
const r = t == null ? void 0 : t.current;
|
|
2256
|
+
r && (n && o.current || (r.scrollTop = r.scrollHeight));
|
|
2194
2257
|
}, s);
|
|
2195
2258
|
}
|
|
2196
2259
|
function As({
|
|
2197
2260
|
prompts: s,
|
|
2198
2261
|
enabled: t,
|
|
2199
|
-
typingSpeed:
|
|
2262
|
+
typingSpeed: n = 38,
|
|
2200
2263
|
erasingSpeed: o = 18,
|
|
2201
2264
|
holdTime: a = 2200,
|
|
2202
|
-
betweenTime:
|
|
2265
|
+
betweenTime: r = 380,
|
|
2203
2266
|
manualPauseMs: i = 5e3
|
|
2204
2267
|
}) {
|
|
2205
|
-
const [l,
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
}, [l]),
|
|
2268
|
+
const [l, m] = D(0), [d, f] = D(""), p = k("typing"), h = k(0), u = k(0), b = k(null), j = k(0);
|
|
2269
|
+
B(() => {
|
|
2270
|
+
u.current = l;
|
|
2271
|
+
}, [l]), B(() => {
|
|
2209
2272
|
if (b.current && (clearTimeout(b.current), b.current = null), !t || s.length === 0) {
|
|
2210
|
-
|
|
2273
|
+
f(""), h.current = 0, p.current = "typing";
|
|
2211
2274
|
return;
|
|
2212
2275
|
}
|
|
2213
2276
|
const T = () => {
|
|
@@ -2216,101 +2279,101 @@ function As({
|
|
|
2216
2279
|
b.current = setTimeout(T, j.current - z);
|
|
2217
2280
|
return;
|
|
2218
2281
|
}
|
|
2219
|
-
const A = s[
|
|
2220
|
-
p.current === "typing" ? (h.current += 1,
|
|
2282
|
+
const A = s[u.current % s.length] ?? "";
|
|
2283
|
+
p.current === "typing" ? (h.current += 1, f(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", b.current = setTimeout(T, a)) : b.current = setTimeout(T, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", b.current = setTimeout(T, o)) : (h.current = Math.max(0, h.current - 1), f(A.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % s.length, m(u.current), b.current = setTimeout(T, r)) : b.current = setTimeout(T, o));
|
|
2221
2284
|
};
|
|
2222
2285
|
return b.current = setTimeout(T, 260), () => {
|
|
2223
2286
|
b.current && clearTimeout(b.current);
|
|
2224
2287
|
};
|
|
2225
|
-
}, [t, s,
|
|
2288
|
+
}, [t, s, n, o, a, r]);
|
|
2226
2289
|
const R = (T) => {
|
|
2227
2290
|
if (s.length === 0) return;
|
|
2228
2291
|
const z = (T % s.length + s.length) % s.length, A = s[z];
|
|
2229
|
-
|
|
2230
|
-
}, $ = () => R(
|
|
2231
|
-
return { displayed: d, currentPrompt: y, index: l, next: $, prev:
|
|
2292
|
+
u.current = z, h.current = A.length, p.current = "holding", j.current = Date.now() + i, m(z), f(A);
|
|
2293
|
+
}, $ = () => R(u.current + 1), L = () => R(u.current - 1), y = s[l % s.length] ?? "";
|
|
2294
|
+
return { displayed: d, currentPrompt: y, index: l, next: $, prev: L };
|
|
2232
2295
|
}
|
|
2233
|
-
let
|
|
2234
|
-
function
|
|
2296
|
+
let Bs = 0;
|
|
2297
|
+
function Ot({
|
|
2235
2298
|
value: s = "",
|
|
2236
2299
|
onChange: t,
|
|
2237
|
-
onSubmit:
|
|
2300
|
+
onSubmit: n,
|
|
2238
2301
|
onStop: o,
|
|
2239
2302
|
onKeyDown: a,
|
|
2240
|
-
loading:
|
|
2303
|
+
loading: r = !1,
|
|
2241
2304
|
disabled: i = !1,
|
|
2242
2305
|
placeholder: l = "Let's get things done...",
|
|
2243
|
-
animatedPlaceholders:
|
|
2306
|
+
animatedPlaceholders: m,
|
|
2244
2307
|
attachments: d,
|
|
2245
|
-
images:
|
|
2308
|
+
images: f,
|
|
2246
2309
|
onAttachFiles: p,
|
|
2247
2310
|
onAttachImages: h,
|
|
2248
|
-
onRemoveAttachment:
|
|
2311
|
+
onRemoveAttachment: u,
|
|
2249
2312
|
onRemoveImage: b,
|
|
2250
2313
|
acceptImage: j,
|
|
2251
2314
|
acceptFile: R,
|
|
2252
2315
|
maxImages: $,
|
|
2253
|
-
maxImageSize:
|
|
2316
|
+
maxImageSize: L,
|
|
2254
2317
|
leftSlot: y,
|
|
2255
2318
|
rightSlot: T,
|
|
2256
2319
|
className: z = "",
|
|
2257
2320
|
...A
|
|
2258
2321
|
}) {
|
|
2259
|
-
const
|
|
2260
|
-
const S = ++
|
|
2261
|
-
|
|
2262
|
-
}, N = (_) =>
|
|
2263
|
-
const S = [],
|
|
2264
|
-
let ee = 0, ie = $ != null ? $ - ((
|
|
2322
|
+
const q = k(null), H = k(null), F = k(0), [v, C] = D(!1), [X, V] = D([]), x = (_) => {
|
|
2323
|
+
const S = ++Bs;
|
|
2324
|
+
V((Y) => [...Y, { id: S, msg: _ }]), setTimeout(() => V((Y) => Y.filter((J) => J.id !== S)), 6e3);
|
|
2325
|
+
}, N = (_) => V((S) => S.filter((Y) => Y.id !== _)), E = (_) => _.type.startsWith("image/"), M = () => !0, K = j ?? E, G = R ?? M, g = (_) => {
|
|
2326
|
+
const S = [], Y = [], J = [], Z = [];
|
|
2327
|
+
let ee = 0, ie = $ != null ? $ - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
|
|
2265
2328
|
for (const se of _)
|
|
2266
|
-
|
|
2267
|
-
return { imageFiles: S, docFiles:
|
|
2329
|
+
K(se) ? L && se.size > L ? J.push(se.name) : ie > 0 ? (S.push(se), ie--) : ee++ : G(se) ? Y.push(se) : Z.push(se.name);
|
|
2330
|
+
return { imageFiles: S, docFiles: Y, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2268
2331
|
}, c = (_) => {
|
|
2269
|
-
const { imageFiles: S, docFiles:
|
|
2270
|
-
J.length && x(`File${J.length > 1 ? "s" : ""} too large${
|
|
2271
|
-
const ie =
|
|
2332
|
+
const { imageFiles: S, docFiles: Y, tooLarge: J, skipped: Z, limitExceeded: ee } = g(_);
|
|
2333
|
+
J.length && x(`File${J.length > 1 ? "s" : ""} too large${L ? ` (max ${L / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${$} images per message`), h && S.length && h(S);
|
|
2334
|
+
const ie = Y.concat(h ? [] : S);
|
|
2272
2335
|
p && ie.length && p(ie);
|
|
2273
2336
|
};
|
|
2274
|
-
|
|
2337
|
+
B(() => {
|
|
2275
2338
|
const _ = H.current;
|
|
2276
2339
|
_ && (_.style.height = "auto", _.style.height = `${Math.min(_.scrollHeight, 200)}px`);
|
|
2277
|
-
}, [s]),
|
|
2340
|
+
}, [s]), B(() => {
|
|
2278
2341
|
const _ = (S) => {
|
|
2279
2342
|
var J, Z, ee;
|
|
2280
|
-
if (
|
|
2281
|
-
const
|
|
2282
|
-
|
|
2343
|
+
if (r || i) return;
|
|
2344
|
+
const Y = (J = S.target) == null ? void 0 : J.tagName;
|
|
2345
|
+
Y === "INPUT" || Y === "TEXTAREA" || Y === "SELECT" || (Z = S.target) != null && Z.isContentEditable || S.ctrlKey || S.metaKey || S.altKey || S.key.length !== 1 && S.key !== "Backspace" && S.key !== "Delete" || (ee = H.current) == null || ee.focus();
|
|
2283
2346
|
};
|
|
2284
2347
|
return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
|
|
2285
|
-
}, [
|
|
2348
|
+
}, [r, i]);
|
|
2286
2349
|
const w = (_) => {
|
|
2287
2350
|
_.preventDefault(), F.current++, _.dataTransfer.types.includes("Files") && C(!0);
|
|
2288
|
-
},
|
|
2351
|
+
}, P = (_) => {
|
|
2289
2352
|
_.preventDefault(), F.current--, F.current === 0 && C(!1);
|
|
2290
|
-
}, O = (_) => _.preventDefault(),
|
|
2353
|
+
}, O = (_) => _.preventDefault(), ne = (_) => {
|
|
2291
2354
|
_.preventDefault(), F.current = 0, C(!1);
|
|
2292
2355
|
const S = Array.from(_.dataTransfer.files);
|
|
2293
2356
|
S.length && c(S);
|
|
2294
2357
|
}, ae = (_) => {
|
|
2295
2358
|
const S = Array.from(_.target.files || []);
|
|
2296
|
-
|
|
2359
|
+
q.current && (q.current.value = ""), S.length && c(S);
|
|
2297
2360
|
}, W = (_) => {
|
|
2298
2361
|
var se;
|
|
2299
2362
|
if (!h) return;
|
|
2300
2363
|
const S = (se = _.clipboardData) == null ? void 0 : se.items;
|
|
2301
2364
|
if (!S) return;
|
|
2302
|
-
const
|
|
2365
|
+
const Y = [];
|
|
2303
2366
|
for (const Ue of S) {
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2367
|
+
const Re = Ue.getAsFile();
|
|
2368
|
+
Re && Y.push(Re);
|
|
2306
2369
|
}
|
|
2307
|
-
if (
|
|
2308
|
-
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: ie } = g(
|
|
2370
|
+
if (Y.length === 0) return;
|
|
2371
|
+
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: ie } = g(Y);
|
|
2309
2372
|
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), ie && x(`Max ${$} images per message`), J.length && (_.preventDefault(), h(J));
|
|
2310
|
-
}, Q = !
|
|
2311
|
-
prompts:
|
|
2373
|
+
}, Q = !r && !i && !!(m != null && m.length) && s.length === 0, oe = As({
|
|
2374
|
+
prompts: m ?? [],
|
|
2312
2375
|
enabled: Q
|
|
2313
|
-
}),
|
|
2376
|
+
}), be = (_) => {
|
|
2314
2377
|
if (Q) {
|
|
2315
2378
|
if (_.key === "ArrowDown" || _.key === "ArrowRight") {
|
|
2316
2379
|
_.preventDefault(), oe.next();
|
|
@@ -2326,12 +2389,12 @@ function Lt({
|
|
|
2326
2389
|
}
|
|
2327
2390
|
}
|
|
2328
2391
|
a == null || a(_);
|
|
2329
|
-
}, Ce = (s.trim() || (
|
|
2392
|
+
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, Te = p || h;
|
|
2330
2393
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", z].filter(Boolean).join(" "), ...A, children: [
|
|
2331
|
-
|
|
2394
|
+
Te && /* @__PURE__ */ e.jsx(
|
|
2332
2395
|
"input",
|
|
2333
2396
|
{
|
|
2334
|
-
ref:
|
|
2397
|
+
ref: q,
|
|
2335
2398
|
type: "file",
|
|
2336
2399
|
multiple: !0,
|
|
2337
2400
|
accept: "*/*",
|
|
@@ -2344,9 +2407,9 @@ function Lt({
|
|
|
2344
2407
|
{
|
|
2345
2408
|
className: ["ds-prompt-input__box", v && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2346
2409
|
onDragEnter: w,
|
|
2347
|
-
onDragLeave:
|
|
2410
|
+
onDragLeave: P,
|
|
2348
2411
|
onDragOver: O,
|
|
2349
|
-
onDrop:
|
|
2412
|
+
onDrop: ne,
|
|
2350
2413
|
children: [
|
|
2351
2414
|
v && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2352
2415
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2355,10 +2418,10 @@ function Lt({
|
|
|
2355
2418
|
ref: H,
|
|
2356
2419
|
value: s,
|
|
2357
2420
|
onChange: (_) => t == null ? void 0 : t(_.target.value),
|
|
2358
|
-
onKeyDown:
|
|
2421
|
+
onKeyDown: be,
|
|
2359
2422
|
onPaste: W,
|
|
2360
2423
|
placeholder: Q ? "" : l,
|
|
2361
|
-
disabled:
|
|
2424
|
+
disabled: r || i,
|
|
2362
2425
|
rows: 1,
|
|
2363
2426
|
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2364
2427
|
}
|
|
@@ -2367,7 +2430,7 @@ function Lt({
|
|
|
2367
2430
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: oe.displayed }),
|
|
2368
2431
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2369
2432
|
] }),
|
|
2370
|
-
|
|
2433
|
+
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((_, S) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2371
2434
|
/* @__PURE__ */ e.jsx("img", { src: _.preview, alt: "" }),
|
|
2372
2435
|
/* @__PURE__ */ e.jsx(
|
|
2373
2436
|
"button",
|
|
@@ -2376,7 +2439,7 @@ function Lt({
|
|
|
2376
2439
|
onClick: () => b == null ? void 0 : b(S),
|
|
2377
2440
|
"aria-label": "Remove image",
|
|
2378
2441
|
type: "button",
|
|
2379
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2442
|
+
children: /* @__PURE__ */ e.jsx(te, { size: 12, strokeWidth: 2 })
|
|
2380
2443
|
}
|
|
2381
2444
|
)
|
|
2382
2445
|
] }, S)) }),
|
|
@@ -2389,42 +2452,42 @@ function Lt({
|
|
|
2389
2452
|
className: "ds-prompt-input__warning-close",
|
|
2390
2453
|
onClick: () => N(_.id),
|
|
2391
2454
|
"aria-label": "Dismiss",
|
|
2392
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2455
|
+
children: /* @__PURE__ */ e.jsx(te, { size: I[1], strokeWidth: 1.5 })
|
|
2393
2456
|
}
|
|
2394
2457
|
)
|
|
2395
2458
|
] }, _.id)) }),
|
|
2396
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((_, S) => /* @__PURE__ */ e.jsx(
|
|
2397
|
-
_.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(
|
|
2459
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((_, S) => /* @__PURE__ */ e.jsx(de, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2460
|
+
_.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Se, { size: I[1], strokeWidth: 1.5 }),
|
|
2398
2461
|
_.filename,
|
|
2399
2462
|
_.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2400
2463
|
"button",
|
|
2401
2464
|
{
|
|
2402
2465
|
type: "button",
|
|
2403
2466
|
className: "ds-prompt-input__remove-btn",
|
|
2404
|
-
onClick: () =>
|
|
2405
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2467
|
+
onClick: () => u == null ? void 0 : u(S),
|
|
2468
|
+
children: /* @__PURE__ */ e.jsx(te, { size: I[1], strokeWidth: 1.5 })
|
|
2406
2469
|
}
|
|
2407
2470
|
)
|
|
2408
2471
|
] }) }, S)) }),
|
|
2409
2472
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2410
|
-
|
|
2411
|
-
|
|
2473
|
+
Te && /* @__PURE__ */ e.jsx(
|
|
2474
|
+
ce,
|
|
2412
2475
|
{
|
|
2413
2476
|
variant: "ghost",
|
|
2414
2477
|
size: "xs",
|
|
2415
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2478
|
+
icon: /* @__PURE__ */ e.jsx(Se, { size: I[2], strokeWidth: 1.5 }),
|
|
2416
2479
|
"aria-label": "Attach files",
|
|
2417
2480
|
onClick: () => {
|
|
2418
2481
|
var _;
|
|
2419
|
-
return (_ =
|
|
2482
|
+
return (_ = q.current) == null ? void 0 : _.click();
|
|
2420
2483
|
}
|
|
2421
2484
|
}
|
|
2422
2485
|
),
|
|
2423
2486
|
y,
|
|
2424
2487
|
T,
|
|
2425
2488
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2426
|
-
|
|
2427
|
-
|
|
2489
|
+
r ? /* @__PURE__ */ e.jsx(
|
|
2490
|
+
ce,
|
|
2428
2491
|
{
|
|
2429
2492
|
variant: "primary",
|
|
2430
2493
|
size: "xs",
|
|
@@ -2433,12 +2496,12 @@ function Lt({
|
|
|
2433
2496
|
"aria-label": "Stop"
|
|
2434
2497
|
}
|
|
2435
2498
|
) : /* @__PURE__ */ e.jsx(
|
|
2436
|
-
|
|
2499
|
+
ce,
|
|
2437
2500
|
{
|
|
2438
2501
|
variant: "primary",
|
|
2439
2502
|
size: "xs",
|
|
2440
2503
|
icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
|
|
2441
|
-
onClick:
|
|
2504
|
+
onClick: n,
|
|
2442
2505
|
disabled: !Ce,
|
|
2443
2506
|
"aria-label": "Send"
|
|
2444
2507
|
}
|
|
@@ -2449,47 +2512,47 @@ function Lt({
|
|
|
2449
2512
|
)
|
|
2450
2513
|
] });
|
|
2451
2514
|
}
|
|
2452
|
-
const
|
|
2453
|
-
function
|
|
2515
|
+
const Me = { fast: 0, standard: 1, premium: 2 }, Pe = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
2516
|
+
function Ft({
|
|
2454
2517
|
models: s = [],
|
|
2455
2518
|
value: t,
|
|
2456
|
-
onChange:
|
|
2519
|
+
onChange: n,
|
|
2457
2520
|
size: o = "xs",
|
|
2458
2521
|
minTier: a,
|
|
2459
|
-
showAutoOption:
|
|
2522
|
+
showAutoOption: r = !1,
|
|
2460
2523
|
groupByTier: i = !0,
|
|
2461
2524
|
className: l = "",
|
|
2462
|
-
...
|
|
2525
|
+
...m
|
|
2463
2526
|
}) {
|
|
2464
|
-
const [d,
|
|
2465
|
-
|
|
2527
|
+
const [d, f] = D(!1), p = k(null), h = k(null), u = k(null), [b, j] = D({}), R = s.filter((v) => !a || v.name === "auto" ? !0 : (Me[v.tier] ?? 1) >= (Me[a] ?? 1)), $ = R.find((v) => v.name === "auto"), L = R.filter((v) => v.name !== "auto"), y = s.find((v) => v.name === t), z = new Set(L.map((v) => v.tier).filter(Boolean)).size > 1;
|
|
2528
|
+
B(() => {
|
|
2466
2529
|
if (!d) return;
|
|
2467
2530
|
const v = 320, C = () => {
|
|
2468
|
-
var
|
|
2469
|
-
const x = (
|
|
2531
|
+
var M;
|
|
2532
|
+
const x = (M = h.current) == null ? void 0 : M.getBoundingClientRect();
|
|
2470
2533
|
if (!x) return;
|
|
2471
|
-
const N = window.innerHeight - x.bottom,
|
|
2534
|
+
const N = window.innerHeight - x.bottom, E = N < v + 8 && x.top > N;
|
|
2472
2535
|
j({
|
|
2473
2536
|
position: "fixed",
|
|
2474
2537
|
zIndex: "var(--z-dropdown, 500)",
|
|
2475
2538
|
left: x.left,
|
|
2476
|
-
...
|
|
2539
|
+
...E ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
|
|
2477
2540
|
});
|
|
2478
2541
|
};
|
|
2479
2542
|
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
2480
2543
|
const X = (x) => {
|
|
2481
|
-
var N,
|
|
2482
|
-
!((N = p.current) != null && N.contains(x.target)) && !((
|
|
2483
|
-
},
|
|
2484
|
-
x.key === "Escape" &&
|
|
2544
|
+
var N, E;
|
|
2545
|
+
!((N = p.current) != null && N.contains(x.target)) && !((E = u.current) != null && E.contains(x.target)) && f(!1);
|
|
2546
|
+
}, V = (x) => {
|
|
2547
|
+
x.key === "Escape" && f(!1);
|
|
2485
2548
|
};
|
|
2486
|
-
return document.addEventListener("mousedown", X), document.addEventListener("keydown",
|
|
2487
|
-
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", X), document.removeEventListener("keydown",
|
|
2549
|
+
return document.addEventListener("mousedown", X), document.addEventListener("keydown", V), () => {
|
|
2550
|
+
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", X), document.removeEventListener("keydown", V);
|
|
2488
2551
|
};
|
|
2489
2552
|
}, [d]);
|
|
2490
2553
|
const A = (v) => {
|
|
2491
|
-
|
|
2492
|
-
},
|
|
2554
|
+
n == null || n(v), f(!1);
|
|
2555
|
+
}, q = (v) => /* @__PURE__ */ e.jsxs(
|
|
2493
2556
|
"button",
|
|
2494
2557
|
{
|
|
2495
2558
|
type: "button",
|
|
@@ -2499,20 +2562,20 @@ function zt({
|
|
|
2499
2562
|
].filter(Boolean).join(" "),
|
|
2500
2563
|
onClick: () => A(v.name),
|
|
2501
2564
|
children: [
|
|
2502
|
-
v.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: v.icon }) : /* @__PURE__ */ e.jsx(
|
|
2565
|
+
v.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: v.icon }) : /* @__PURE__ */ e.jsx(De, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2503
2566
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: v.displayName || v.name }),
|
|
2504
|
-
z && v.tier && /* @__PURE__ */ e.jsx(
|
|
2567
|
+
z && v.tier && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Pe[v.tier] || "default", children: v.tier })
|
|
2505
2568
|
]
|
|
2506
2569
|
},
|
|
2507
2570
|
v.name
|
|
2508
|
-
), H = () => !i || !z ?
|
|
2509
|
-
const C =
|
|
2571
|
+
), H = () => !i || !z ? L.map(q) : ["fast", "standard", "premium"].flatMap((v) => {
|
|
2572
|
+
const C = L.filter((X) => X.tier === v);
|
|
2510
2573
|
return C.length ? [
|
|
2511
2574
|
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": v, children: v.charAt(0).toUpperCase() + v.slice(1) }, `lbl-${v}`),
|
|
2512
|
-
...C.map(
|
|
2575
|
+
...C.map(q)
|
|
2513
2576
|
] : [];
|
|
2514
|
-
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref:
|
|
2515
|
-
|
|
2577
|
+
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu ds-scrollable", style: b, children: [
|
|
2578
|
+
r && $ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2516
2579
|
/* @__PURE__ */ e.jsxs(
|
|
2517
2580
|
"button",
|
|
2518
2581
|
{
|
|
@@ -2529,7 +2592,7 @@ function zt({
|
|
|
2529
2592
|
]
|
|
2530
2593
|
}
|
|
2531
2594
|
),
|
|
2532
|
-
|
|
2595
|
+
L.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
2533
2596
|
] }),
|
|
2534
2597
|
H()
|
|
2535
2598
|
] });
|
|
@@ -2538,7 +2601,7 @@ function zt({
|
|
|
2538
2601
|
{
|
|
2539
2602
|
ref: p,
|
|
2540
2603
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2541
|
-
...
|
|
2604
|
+
...m,
|
|
2542
2605
|
children: [
|
|
2543
2606
|
/* @__PURE__ */ e.jsxs(
|
|
2544
2607
|
"button",
|
|
@@ -2546,13 +2609,13 @@ function zt({
|
|
|
2546
2609
|
ref: h,
|
|
2547
2610
|
type: "button",
|
|
2548
2611
|
className: "ds-model-picker__trigger",
|
|
2549
|
-
onClick: () =>
|
|
2612
|
+
onClick: () => f((v) => !v),
|
|
2550
2613
|
"aria-haspopup": "listbox",
|
|
2551
2614
|
"aria-expanded": d,
|
|
2552
2615
|
children: [
|
|
2553
|
-
y != null && y.icon ? /* @__PURE__ */ e.jsx("span", { children: y.icon }) : /* @__PURE__ */ e.jsx(
|
|
2616
|
+
y != null && y.icon ? /* @__PURE__ */ e.jsx("span", { children: y.icon }) : /* @__PURE__ */ e.jsx(De, { size: 12, strokeWidth: 1.5 }),
|
|
2554
2617
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (y == null ? void 0 : y.displayName) || (y == null ? void 0 : y.name) || t }),
|
|
2555
|
-
z && (y == null ? void 0 : y.tier) && /* @__PURE__ */ e.jsx(
|
|
2618
|
+
z && (y == null ? void 0 : y.tier) && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Pe[y.tier] || "default", children: y.tier })
|
|
2556
2619
|
]
|
|
2557
2620
|
}
|
|
2558
2621
|
),
|
|
@@ -2561,57 +2624,57 @@ function zt({
|
|
|
2561
2624
|
}
|
|
2562
2625
|
);
|
|
2563
2626
|
}
|
|
2564
|
-
const
|
|
2627
|
+
const Ls = ({ filename: s, pages: t }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
2565
2628
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: s }),
|
|
2566
|
-
t.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children:
|
|
2629
|
+
t.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(t) })
|
|
2567
2630
|
] });
|
|
2568
|
-
function
|
|
2631
|
+
function Ne(s) {
|
|
2569
2632
|
return s != null && s.length ? "p. " + s.join(", ") : null;
|
|
2570
2633
|
}
|
|
2571
2634
|
function Ms(s) {
|
|
2572
2635
|
const t = /* @__PURE__ */ new Map();
|
|
2573
|
-
for (const
|
|
2574
|
-
t.has(
|
|
2636
|
+
for (const n of s)
|
|
2637
|
+
t.has(n.filename) || t.set(n.filename, { filename: n.filename, url: n.url, items: [] }), t.get(n.filename).items.push(n);
|
|
2575
2638
|
return [...t.values()];
|
|
2576
2639
|
}
|
|
2577
|
-
function
|
|
2640
|
+
function Wt({
|
|
2578
2641
|
sources: s = [],
|
|
2579
2642
|
layout: t = "list",
|
|
2580
|
-
title:
|
|
2643
|
+
title: n = "Sources",
|
|
2581
2644
|
maxVisible: o = 5,
|
|
2582
2645
|
onSourceClick: a
|
|
2583
2646
|
}) {
|
|
2584
|
-
const [
|
|
2647
|
+
const [r, i] = D(!1), l = Ms(s), m = l.length > o, d = r ? l : l.slice(0, o), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2585
2648
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2586
2649
|
d.map((h) => {
|
|
2587
|
-
const
|
|
2650
|
+
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2588
2651
|
return /* @__PURE__ */ e.jsxs(
|
|
2589
2652
|
"div",
|
|
2590
2653
|
{
|
|
2591
2654
|
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2592
2655
|
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2593
2656
|
children: [
|
|
2594
|
-
/* @__PURE__ */ e.jsx(
|
|
2657
|
+
/* @__PURE__ */ e.jsx(ns, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2595
2658
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2596
|
-
|
|
2659
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2597
2660
|
]
|
|
2598
2661
|
},
|
|
2599
2662
|
h.filename
|
|
2600
2663
|
);
|
|
2601
2664
|
}),
|
|
2602
|
-
|
|
2665
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2603
2666
|
"+",
|
|
2604
2667
|
l.length - o,
|
|
2605
2668
|
" more sources"
|
|
2606
2669
|
] })
|
|
2607
2670
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2608
|
-
|
|
2671
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2609
2672
|
d.map((h) => {
|
|
2610
|
-
const
|
|
2611
|
-
return
|
|
2612
|
-
|
|
2673
|
+
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2674
|
+
return f ? /* @__PURE__ */ e.jsx(
|
|
2675
|
+
$e,
|
|
2613
2676
|
{
|
|
2614
|
-
title: /* @__PURE__ */ e.jsx(
|
|
2677
|
+
title: /* @__PURE__ */ e.jsx(Ls, { filename: h.filename, pages: u }),
|
|
2615
2678
|
padding: "s",
|
|
2616
2679
|
children: h.items.map((j, R) => /* @__PURE__ */ e.jsx(
|
|
2617
2680
|
"div",
|
|
@@ -2631,13 +2694,13 @@ function Ot({
|
|
|
2631
2694
|
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2632
2695
|
children: [
|
|
2633
2696
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2634
|
-
|
|
2697
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2635
2698
|
]
|
|
2636
2699
|
},
|
|
2637
2700
|
h.filename
|
|
2638
2701
|
);
|
|
2639
2702
|
}),
|
|
2640
|
-
|
|
2703
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2641
2704
|
"+",
|
|
2642
2705
|
l.length - o,
|
|
2643
2706
|
" more sources"
|
|
@@ -2647,20 +2710,20 @@ function Ot({
|
|
|
2647
2710
|
function ze(s) {
|
|
2648
2711
|
return s >= 1e6 ? (s / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : s >= 1e3 ? (s / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(s);
|
|
2649
2712
|
}
|
|
2650
|
-
function
|
|
2713
|
+
function Ct({
|
|
2651
2714
|
used: s,
|
|
2652
2715
|
limit: t,
|
|
2653
|
-
size:
|
|
2716
|
+
size: n = "s",
|
|
2654
2717
|
showCount: o = !0,
|
|
2655
2718
|
showPercent: a = !1,
|
|
2656
|
-
warningThreshold:
|
|
2719
|
+
warningThreshold: r = 0.8,
|
|
2657
2720
|
errorThreshold: i = 1
|
|
2658
2721
|
}) {
|
|
2659
|
-
const l = t > 0 ? s / t : 0,
|
|
2722
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= i ? "error" : l >= r ? "warning" : "normal";
|
|
2660
2723
|
return /* @__PURE__ */ e.jsxs(
|
|
2661
2724
|
"div",
|
|
2662
2725
|
{
|
|
2663
|
-
className: `ds-token-counter ds-token-counter--${
|
|
2726
|
+
className: `ds-token-counter ds-token-counter--${n}`,
|
|
2664
2727
|
role: "meter",
|
|
2665
2728
|
"aria-valuenow": s,
|
|
2666
2729
|
"aria-valuemax": t,
|
|
@@ -2669,7 +2732,7 @@ function Ft({
|
|
|
2669
2732
|
"div",
|
|
2670
2733
|
{
|
|
2671
2734
|
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2672
|
-
style: { width: `${
|
|
2735
|
+
style: { width: `${m}%` }
|
|
2673
2736
|
}
|
|
2674
2737
|
) }),
|
|
2675
2738
|
(o || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
@@ -2692,84 +2755,84 @@ const Oe = 5;
|
|
|
2692
2755
|
function Ps(s) {
|
|
2693
2756
|
return s < 0.34 ? "low" : s < 0.67 ? "medium" : "high";
|
|
2694
2757
|
}
|
|
2695
|
-
function
|
|
2758
|
+
function Ut({
|
|
2696
2759
|
value: s = 0,
|
|
2697
2760
|
size: t = "xs",
|
|
2698
|
-
showLabel:
|
|
2761
|
+
showLabel: n = "none",
|
|
2699
2762
|
layout: o = "inline"
|
|
2700
2763
|
}) {
|
|
2701
|
-
const a = Math.max(0, Math.min(1, s)),
|
|
2764
|
+
const a = Math.max(0, Math.min(1, s)), r = Math.round(a * Oe), i = Ps(a);
|
|
2702
2765
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2703
2766
|
"ds-confidence-bar",
|
|
2704
2767
|
`ds-confidence-bar--${t}`,
|
|
2705
2768
|
`ds-confidence-bar--${i}`,
|
|
2706
2769
|
o === "block" && "ds-confidence-bar--block"
|
|
2707
2770
|
].filter(Boolean).join(" "), children: [
|
|
2708
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l,
|
|
2771
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, m) => /* @__PURE__ */ e.jsx(
|
|
2709
2772
|
"div",
|
|
2710
2773
|
{
|
|
2711
|
-
className: `ds-confidence-bar__seg${
|
|
2774
|
+
className: `ds-confidence-bar__seg${m < r ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2712
2775
|
},
|
|
2713
|
-
|
|
2776
|
+
m
|
|
2714
2777
|
)) }),
|
|
2715
|
-
|
|
2778
|
+
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
2716
2779
|
] });
|
|
2717
2780
|
}
|
|
2718
|
-
const
|
|
2719
|
-
function
|
|
2781
|
+
const zs = { add: "+", remove: "-", context: " " };
|
|
2782
|
+
function je({ line: s, lineNumbers: t }) {
|
|
2720
2783
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
|
|
2721
2784
|
t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
|
|
2722
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children:
|
|
2785
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: zs[s.type] }),
|
|
2723
2786
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: s.text })
|
|
2724
2787
|
] });
|
|
2725
2788
|
}
|
|
2726
|
-
function
|
|
2789
|
+
function Vt({
|
|
2727
2790
|
lines: s = [],
|
|
2728
2791
|
layout: t = "inline",
|
|
2729
|
-
wordWrap:
|
|
2792
|
+
wordWrap: n = !1,
|
|
2730
2793
|
lineNumbers: o = !0,
|
|
2731
2794
|
maxHeight: a,
|
|
2732
|
-
title:
|
|
2795
|
+
title: r
|
|
2733
2796
|
}) {
|
|
2734
2797
|
const i = [
|
|
2735
2798
|
"ds-diff-view",
|
|
2736
2799
|
`ds-diff-view--${t}`,
|
|
2737
|
-
|
|
2800
|
+
n && "ds-diff-view--wrap"
|
|
2738
2801
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2739
2802
|
if (t === "split") {
|
|
2740
|
-
const
|
|
2803
|
+
const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2741
2804
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
2742
|
-
|
|
2805
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2743
2806
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
|
|
2744
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children:
|
|
2745
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((
|
|
2807
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: m.map((f, p) => /* @__PURE__ */ e.jsx(je, { line: f, lineNumbers: o }, p)) }),
|
|
2808
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((f, p) => /* @__PURE__ */ e.jsx(je, { line: f, lineNumbers: o }, p)) })
|
|
2746
2809
|
] })
|
|
2747
2810
|
] });
|
|
2748
2811
|
}
|
|
2749
2812
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
2750
|
-
|
|
2751
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: s.map((
|
|
2813
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2814
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(je, { line: m, lineNumbers: o }, d)) })
|
|
2752
2815
|
] });
|
|
2753
2816
|
}
|
|
2754
|
-
function
|
|
2817
|
+
function Os({
|
|
2755
2818
|
value: s = "idle",
|
|
2756
2819
|
onLike: t,
|
|
2757
|
-
onDislike:
|
|
2820
|
+
onDislike: n,
|
|
2758
2821
|
className: o = "",
|
|
2759
2822
|
...a
|
|
2760
2823
|
}) {
|
|
2761
|
-
const
|
|
2824
|
+
const r = s !== "idle";
|
|
2762
2825
|
return /* @__PURE__ */ e.jsxs(
|
|
2763
2826
|
"div",
|
|
2764
2827
|
{
|
|
2765
2828
|
className: [
|
|
2766
2829
|
"ds-message-feedback",
|
|
2767
|
-
|
|
2830
|
+
r && "ds-message-feedback--voted",
|
|
2768
2831
|
o
|
|
2769
2832
|
].filter(Boolean).join(" "),
|
|
2770
2833
|
...a,
|
|
2771
2834
|
children: [
|
|
2772
|
-
(!
|
|
2835
|
+
(!r || s === "liked") && /* @__PURE__ */ e.jsx(
|
|
2773
2836
|
"button",
|
|
2774
2837
|
{
|
|
2775
2838
|
className: [
|
|
@@ -2777,11 +2840,11 @@ function zs({
|
|
|
2777
2840
|
s === "liked" && "ds-message-feedback__btn--liked"
|
|
2778
2841
|
].filter(Boolean).join(" "),
|
|
2779
2842
|
onClick: t,
|
|
2780
|
-
disabled:
|
|
2843
|
+
disabled: r,
|
|
2781
2844
|
"aria-label": "Like",
|
|
2782
2845
|
"aria-pressed": s === "liked",
|
|
2783
2846
|
children: /* @__PURE__ */ e.jsx(
|
|
2784
|
-
|
|
2847
|
+
rs,
|
|
2785
2848
|
{
|
|
2786
2849
|
size: I[1],
|
|
2787
2850
|
strokeWidth: 1.5,
|
|
@@ -2790,15 +2853,15 @@ function zs({
|
|
|
2790
2853
|
)
|
|
2791
2854
|
}
|
|
2792
2855
|
),
|
|
2793
|
-
(!
|
|
2856
|
+
(!r || s === "disliked") && /* @__PURE__ */ e.jsx(
|
|
2794
2857
|
"button",
|
|
2795
2858
|
{
|
|
2796
2859
|
className: [
|
|
2797
2860
|
"ds-message-feedback__btn",
|
|
2798
2861
|
s === "disliked" && "ds-message-feedback__btn--disliked"
|
|
2799
2862
|
].filter(Boolean).join(" "),
|
|
2800
|
-
onClick:
|
|
2801
|
-
disabled:
|
|
2863
|
+
onClick: n,
|
|
2864
|
+
disabled: r,
|
|
2802
2865
|
"aria-label": "Dislike",
|
|
2803
2866
|
"aria-pressed": s === "disliked",
|
|
2804
2867
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -2815,48 +2878,48 @@ function zs({
|
|
|
2815
2878
|
}
|
|
2816
2879
|
);
|
|
2817
2880
|
}
|
|
2818
|
-
function
|
|
2881
|
+
function Fs(s) {
|
|
2819
2882
|
const t = s instanceof Date ? s : new Date(s);
|
|
2820
2883
|
if (isNaN(t)) return null;
|
|
2821
|
-
const
|
|
2884
|
+
const n = /* @__PURE__ */ new Date(), o = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(n.getFullYear(), n.getMonth(), n.getDate()), r = new Date(a - 864e5);
|
|
2822
2885
|
if (t >= a) return o;
|
|
2823
|
-
if (t >=
|
|
2886
|
+
if (t >= r) return `Yesterday ${o}`;
|
|
2824
2887
|
const i = t.getDate(), l = t.toLocaleString([], { month: "short" });
|
|
2825
2888
|
return `${i} ${l} ${o}`;
|
|
2826
2889
|
}
|
|
2827
|
-
function
|
|
2890
|
+
function Yt({
|
|
2828
2891
|
role: s = "assistant",
|
|
2829
2892
|
text: t,
|
|
2830
|
-
timestamp:
|
|
2893
|
+
timestamp: n,
|
|
2831
2894
|
feedbackValue: o = "idle",
|
|
2832
2895
|
onLike: a,
|
|
2833
|
-
onDislike:
|
|
2896
|
+
onDislike: r,
|
|
2834
2897
|
className: i = "",
|
|
2835
2898
|
...l
|
|
2836
2899
|
}) {
|
|
2837
|
-
const
|
|
2838
|
-
return !
|
|
2900
|
+
const m = s === "assistant" && (a || r), d = !!t, f = n ? Fs(n) : null;
|
|
2901
|
+
return !m && !d && !f ? null : /* @__PURE__ */ e.jsxs(
|
|
2839
2902
|
"div",
|
|
2840
2903
|
{
|
|
2841
2904
|
className: ["ds-message-footer", `ds-message-footer--${s}`, i].filter(Boolean).join(" "),
|
|
2842
2905
|
...l,
|
|
2843
2906
|
children: [
|
|
2844
|
-
s === "user" &&
|
|
2845
|
-
|
|
2846
|
-
d && /* @__PURE__ */ e.jsx(
|
|
2847
|
-
s === "assistant" &&
|
|
2907
|
+
s === "user" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f }),
|
|
2908
|
+
m && /* @__PURE__ */ e.jsx(Os, { className: "ds-message-action", value: o, onLike: a, onDislike: r }),
|
|
2909
|
+
d && /* @__PURE__ */ e.jsx(Is, { className: "ds-message-action", text: t }),
|
|
2910
|
+
s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f })
|
|
2848
2911
|
]
|
|
2849
2912
|
}
|
|
2850
2913
|
);
|
|
2851
2914
|
}
|
|
2852
|
-
function
|
|
2853
|
-
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...
|
|
2915
|
+
function qt({ label: s, className: t = "", ...n }) {
|
|
2916
|
+
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...n, children: [
|
|
2854
2917
|
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
2855
2918
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: s })
|
|
2856
2919
|
] });
|
|
2857
2920
|
}
|
|
2858
|
-
function
|
|
2859
|
-
const
|
|
2921
|
+
function Ht({ variant: s = "light", glow: t, mask: n = !0, style: o, ...a }) {
|
|
2922
|
+
const r = s === "dark", i = t ?? r, l = r ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", m = r ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
2860
2923
|
return /* @__PURE__ */ e.jsx(
|
|
2861
2924
|
"div",
|
|
2862
2925
|
{
|
|
@@ -2881,12 +2944,12 @@ function Yt({ variant: s = "light", glow: t, mask: r = !0, style: o, ...a }) {
|
|
|
2881
2944
|
backgroundImage: [
|
|
2882
2945
|
`linear-gradient(${l} 1px, transparent 1px)`,
|
|
2883
2946
|
`linear-gradient(90deg, ${l} 1px, transparent 1px)`,
|
|
2884
|
-
`linear-gradient(${
|
|
2885
|
-
`linear-gradient(90deg, ${
|
|
2947
|
+
`linear-gradient(${m} 1px, transparent 1px)`,
|
|
2948
|
+
`linear-gradient(90deg, ${m} 1px, transparent 1px)`
|
|
2886
2949
|
].join(", "),
|
|
2887
2950
|
backgroundSize: "80px 80px, 80px 80px, 16px 16px, 16px 16px",
|
|
2888
2951
|
backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
|
|
2889
|
-
...
|
|
2952
|
+
...n && {
|
|
2890
2953
|
WebkitMaskImage: "radial-gradient(ellipse at center, #000 30%, transparent 85%)",
|
|
2891
2954
|
maskImage: "radial-gradient(ellipse at center, #000 30%, transparent 85%)"
|
|
2892
2955
|
}
|
|
@@ -2896,92 +2959,93 @@ function Yt({ variant: s = "light", glow: t, mask: r = !0, style: o, ...a }) {
|
|
|
2896
2959
|
}
|
|
2897
2960
|
);
|
|
2898
2961
|
}
|
|
2899
|
-
function
|
|
2900
|
-
const
|
|
2962
|
+
function Kt({ children: s, axis: t = "y", style: n, className: o = "", ...a }) {
|
|
2963
|
+
const r = t === "x" ? { overflowX: "auto", overflowY: "hidden" } : t === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
2901
2964
|
return /* @__PURE__ */ e.jsx(
|
|
2902
2965
|
"div",
|
|
2903
2966
|
{
|
|
2904
2967
|
className: `ds-scrollable ${o}`,
|
|
2905
|
-
style: { ...
|
|
2968
|
+
style: { ...r, ...n },
|
|
2906
2969
|
...a,
|
|
2907
2970
|
children: s
|
|
2908
2971
|
}
|
|
2909
2972
|
);
|
|
2910
2973
|
}
|
|
2911
2974
|
export {
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2975
|
+
$e as Accordion,
|
|
2976
|
+
et as Alert,
|
|
2977
|
+
Rt as AnimatedNumber,
|
|
2978
|
+
ft as Avatar,
|
|
2979
|
+
de as Badge,
|
|
2980
|
+
Et as Banner,
|
|
2981
|
+
tt as BottomSheet,
|
|
2982
|
+
gt as Breadcrumb,
|
|
2983
|
+
ce as Button,
|
|
2984
|
+
Ks as Card,
|
|
2985
|
+
Pt as ChatMessage,
|
|
2986
|
+
dt as Checkbox,
|
|
2987
|
+
nt as Code,
|
|
2988
|
+
ps as CodeAccordion,
|
|
2989
|
+
Ut as ConfidenceBar,
|
|
2990
|
+
Is as CopyButton,
|
|
2991
|
+
Vt as DiffView,
|
|
2992
|
+
kt as Drawer,
|
|
2929
2993
|
Be as DrawerFooter,
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2994
|
+
$t as Dropdown,
|
|
2995
|
+
vt as EmptyState,
|
|
2996
|
+
Ht as EngineerGrid,
|
|
2997
|
+
Nt as FormField,
|
|
2998
|
+
Xs as H1,
|
|
2999
|
+
Gs as H2,
|
|
3000
|
+
Js as H3,
|
|
3001
|
+
Zs as H4,
|
|
3002
|
+
St as InView,
|
|
3003
|
+
Vs as Input,
|
|
3004
|
+
rt as Link,
|
|
3005
|
+
Os as MessageFeedback,
|
|
3006
|
+
Yt as MessageFooter,
|
|
3007
|
+
st as Modal,
|
|
3008
|
+
he as ModalFooter,
|
|
3009
|
+
Ft as ModelPicker,
|
|
3010
|
+
Qs as P1,
|
|
2947
3011
|
ds as P2,
|
|
2948
3012
|
Fe as P3,
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
3013
|
+
yt as Pagination,
|
|
3014
|
+
Tt as ProgressBar,
|
|
3015
|
+
Ot as PromptInput,
|
|
3016
|
+
ut as Radio,
|
|
3017
|
+
Bt as ReasoningBlock,
|
|
3018
|
+
Kt as Scrollable,
|
|
3019
|
+
it as SegmentedControl,
|
|
3020
|
+
qs as Select,
|
|
3021
|
+
bs as Skeleton,
|
|
3022
|
+
Wt as SourcesPanel,
|
|
2959
3023
|
ls as Spinner,
|
|
2960
|
-
|
|
2961
|
-
|
|
3024
|
+
wt as Stat,
|
|
3025
|
+
Lt as StepIndicator,
|
|
2962
3026
|
Hs as Stepper,
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
3027
|
+
Mt as StreamingText,
|
|
3028
|
+
ot as Tab,
|
|
3029
|
+
mt as Table,
|
|
3030
|
+
ht as TableBody,
|
|
3031
|
+
pt as TableHead,
|
|
3032
|
+
xt as TableRow,
|
|
3033
|
+
bt as TableSubheaderRow,
|
|
3034
|
+
at as Tabs,
|
|
3035
|
+
_t as Td,
|
|
3036
|
+
Ys as Textarea,
|
|
3037
|
+
jt as Th,
|
|
3038
|
+
qt as ThinkingDot,
|
|
3039
|
+
It as ToastContainer,
|
|
3040
|
+
ct as Toggle,
|
|
3041
|
+
Ct as TokenCounter,
|
|
3042
|
+
At as ToolCallBubble,
|
|
3043
|
+
At as ToolCallCard,
|
|
3044
|
+
lt as Tooltip,
|
|
2981
3045
|
I as iconSizes,
|
|
2982
|
-
|
|
3046
|
+
Es as useAnimatedNumber,
|
|
2983
3047
|
As as useAnimatedPlaceholder,
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
3048
|
+
$s as useInView,
|
|
3049
|
+
zt as useStreamScroll,
|
|
3050
|
+
Dt as useToast
|
|
2987
3051
|
};
|