@donkit-ai/design-system 1.4.40 → 1.4.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +833 -778
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import K, { useState as D, useRef as E, useEffect as M, useLayoutEffect as Ve } from "react";
|
|
2
|
-
import { Check as Ne, X as
|
|
2
|
+
import { Check as Ne, X as ne, ChevronDown as he, Minus as Ye, Plus as He, XCircle as we, AlertTriangle as ge, CheckCircle as ye, Info as ke, ChevronUp as qe, ChevronsUpDown as Ke, ChevronLeft as Xe, ChevronRight as Ge, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Re, Square as es, ArrowUp as ss, Zap as ts, Cpu as Se, FileText as rs, ThumbsUp as ns, ThumbsDown as as } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const I = {
|
|
5
5
|
1: 16,
|
|
@@ -19,26 +19,26 @@ var je = { exports: {} }, ue = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var De;
|
|
22
|
-
function
|
|
22
|
+
function os() {
|
|
23
23
|
if (De) return ue;
|
|
24
24
|
De = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
26
|
-
function
|
|
27
|
-
var
|
|
28
|
-
if (
|
|
29
|
-
|
|
26
|
+
function r(o, a, n) {
|
|
27
|
+
var i = null;
|
|
28
|
+
if (n !== void 0 && (i = "" + n), a.key !== void 0 && (i = "" + a.key), "key" in a) {
|
|
29
|
+
n = {};
|
|
30
30
|
for (var l in a)
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return a =
|
|
31
|
+
l !== "key" && (n[l] = a[l]);
|
|
32
|
+
} else n = a;
|
|
33
|
+
return a = n.ref, {
|
|
34
34
|
$$typeof: s,
|
|
35
|
-
type:
|
|
36
|
-
key:
|
|
35
|
+
type: o,
|
|
36
|
+
key: i,
|
|
37
37
|
ref: a !== void 0 ? a : null,
|
|
38
|
-
props:
|
|
38
|
+
props: n
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return ue.Fragment = t, ue.jsx =
|
|
41
|
+
return ue.Fragment = t, ue.jsx = r, ue.jsxs = r, ue;
|
|
42
42
|
}
|
|
43
43
|
var fe = {};
|
|
44
44
|
/**
|
|
@@ -51,7 +51,7 @@ var fe = {};
|
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
53
|
var Ae;
|
|
54
|
-
function
|
|
54
|
+
function is() {
|
|
55
55
|
return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function s(c) {
|
|
57
57
|
if (c == null) return null;
|
|
@@ -99,7 +99,7 @@ function os() {
|
|
|
99
99
|
function t(c) {
|
|
100
100
|
return "" + c;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function r(c) {
|
|
103
103
|
try {
|
|
104
104
|
t(c);
|
|
105
105
|
var w = !1;
|
|
@@ -116,7 +116,7 @@ function os() {
|
|
|
116
116
|
), t(c);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function o(c) {
|
|
120
120
|
if (c === R) return "<>";
|
|
121
121
|
if (typeof c == "object" && c !== null && c.$$typeof === F)
|
|
122
122
|
return "<...>";
|
|
@@ -131,10 +131,10 @@ function os() {
|
|
|
131
131
|
var c = X.A;
|
|
132
132
|
return c === null ? null : c.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function n() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function i(c) {
|
|
138
138
|
if (U.call(c, "key")) {
|
|
139
139
|
var w = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
140
140
|
if (w && w.isReactWarning) return !1;
|
|
@@ -153,7 +153,7 @@ function os() {
|
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function f() {
|
|
157
157
|
var c = s(this.type);
|
|
158
158
|
return P[c] || (P[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."
|
|
@@ -162,14 +162,14 @@ function os() {
|
|
|
162
162
|
function d(c, w, L, O, te, ae) {
|
|
163
163
|
var W = L.ref;
|
|
164
164
|
return c = {
|
|
165
|
-
$$typeof:
|
|
165
|
+
$$typeof: b,
|
|
166
166
|
type: c,
|
|
167
167
|
key: w,
|
|
168
168
|
props: L,
|
|
169
169
|
_owner: O
|
|
170
170
|
}, (W !== void 0 ? W : null) !== null ? Object.defineProperty(c, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
172
|
+
get: f
|
|
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,
|
|
@@ -223,10 +223,10 @@ 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, L !== void 0 && (
|
|
226
|
+
if (W = null, L !== void 0 && (r(L), W = "" + L), i(w) && (r(w.key), W = "" + w.key), "key" in w) {
|
|
227
227
|
L = {};
|
|
228
|
-
for (var
|
|
229
|
-
|
|
228
|
+
for (var oe in w)
|
|
229
|
+
oe !== "key" && (L[oe] = w[oe]);
|
|
230
230
|
} else L = w;
|
|
231
231
|
return W && l(
|
|
232
232
|
L,
|
|
@@ -244,20 +244,20 @@ React keys must be passed directly to JSX without using spread:
|
|
|
244
244
|
h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === F && (c._payload.status === "fulfilled" ? h(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(c) {
|
|
247
|
-
return typeof c == "object" && c !== null && c.$$typeof ===
|
|
247
|
+
return typeof c == "object" && c !== null && c.$$typeof === b;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var m = K, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), B = 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"), Y = 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 = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, x = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
m = {
|
|
253
253
|
react_stack_bottom_frame: function(c) {
|
|
254
254
|
return c();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var k, P = {}, q =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
)(), G = N(
|
|
257
|
+
var k, P = {}, q = m.react_stack_bottom_frame.bind(
|
|
258
|
+
m,
|
|
259
|
+
n
|
|
260
|
+
)(), G = N(o(n)), g = {};
|
|
261
261
|
fe.Fragment = R, fe.jsx = function(c, w, L) {
|
|
262
262
|
var O = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return u(
|
|
@@ -266,7 +266,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
266
266
|
L,
|
|
267
267
|
!1,
|
|
268
268
|
O ? Error("react-stack-top-frame") : q,
|
|
269
|
-
O ? N(
|
|
269
|
+
O ? N(o(c)) : G
|
|
270
270
|
);
|
|
271
271
|
}, fe.jsxs = function(c, w, L) {
|
|
272
272
|
var O = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
@@ -276,21 +276,21 @@ React keys must be passed directly to JSX without using spread:
|
|
|
276
276
|
L,
|
|
277
277
|
!0,
|
|
278
278
|
O ? Error("react-stack-top-frame") : q,
|
|
279
|
-
O ? N(
|
|
279
|
+
O ? N(o(c)) : G
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), fe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ? je.exports =
|
|
284
|
+
process.env.NODE_ENV === "production" ? je.exports = os() : je.exports = is();
|
|
285
285
|
var e = je.exports;
|
|
286
|
-
function ls({ size: s = "m", color: t = "default", className:
|
|
286
|
+
function ls({ size: s = "m", color: t = "default", className: r = "", ...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}`, r].filter(Boolean).join(" "),
|
|
291
291
|
role: "status",
|
|
292
292
|
"aria-label": "Loading",
|
|
293
|
-
...
|
|
293
|
+
...o
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}
|
|
@@ -298,32 +298,32 @@ const cs = { xs: 12, s: 14, m: 16, l: 20 };
|
|
|
298
298
|
function me({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
301
|
-
size:
|
|
302
|
-
fullWidth:
|
|
301
|
+
size: r = "m",
|
|
302
|
+
fullWidth: o = !1,
|
|
303
303
|
icon: a,
|
|
304
|
-
disabled:
|
|
305
|
-
state:
|
|
304
|
+
disabled: n = !1,
|
|
305
|
+
state: i = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
307
|
+
type: f = "button",
|
|
308
308
|
href: d,
|
|
309
309
|
"aria-label": u,
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const
|
|
313
|
+
const m = a && !s, b = i === "loading", j = i === "success", R = i === "error", $ = b || j || R, B = r === "xs" ? "s" : "m", y = t === "danger" ? "on-accent" : "default", T = cs[r] ?? 16, z = b ? /* @__PURE__ */ e.jsx(ls, { size: B, color: y }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Ne, { size: T, strokeWidth: 2.5 }) }) : R ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ne, { size: T, strokeWidth: 2.5 }) }) : null, A = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
|
-
`ds-button--${
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
`ds-button--${r}`,
|
|
317
|
+
o && "ds-button--full",
|
|
318
|
+
m && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "), Y =
|
|
320
|
+
].filter(Boolean).join(" "), Y = 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 (n || b) {
|
|
327
327
|
v.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
@@ -333,11 +333,11 @@ function me({
|
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: A,
|
|
336
|
-
href:
|
|
336
|
+
href: n || b ? void 0 : d,
|
|
337
337
|
onClick: F,
|
|
338
338
|
"aria-label": u,
|
|
339
|
-
"aria-disabled":
|
|
340
|
-
"aria-busy":
|
|
339
|
+
"aria-disabled": n || b ? "true" : void 0,
|
|
340
|
+
"aria-busy": b ? "true" : void 0,
|
|
341
341
|
"data-state": Y,
|
|
342
342
|
...h,
|
|
343
343
|
children: H
|
|
@@ -347,12 +347,12 @@ function me({
|
|
|
347
347
|
return /* @__PURE__ */ e.jsx(
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
|
-
type:
|
|
350
|
+
type: f,
|
|
351
351
|
className: A,
|
|
352
|
-
disabled:
|
|
353
|
-
onClick:
|
|
352
|
+
disabled: n,
|
|
353
|
+
onClick: b ? void 0 : l,
|
|
354
354
|
"aria-label": u,
|
|
355
|
-
"aria-busy":
|
|
355
|
+
"aria-busy": b ? "true" : void 0,
|
|
356
356
|
"data-state": Y,
|
|
357
357
|
...h,
|
|
358
358
|
children: H
|
|
@@ -362,18 +362,18 @@ function me({
|
|
|
362
362
|
function Us({
|
|
363
363
|
label: s,
|
|
364
364
|
error: t,
|
|
365
|
-
hint:
|
|
366
|
-
fullWidth:
|
|
365
|
+
hint: r,
|
|
366
|
+
fullWidth: o = !0,
|
|
367
367
|
icon: a,
|
|
368
|
-
iconRight:
|
|
369
|
-
onIconRightClick:
|
|
368
|
+
iconRight: n,
|
|
369
|
+
onIconRightClick: i,
|
|
370
370
|
size: l = "m",
|
|
371
|
-
disabled:
|
|
371
|
+
disabled: f,
|
|
372
372
|
id: d,
|
|
373
373
|
...u
|
|
374
374
|
}) {
|
|
375
|
-
const p = d || `input-${K.useId()}`, h =
|
|
376
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${
|
|
375
|
+
const p = d || `input-${K.useId()}`, h = r ? `${p}-hint` : void 0, m = t ? `${p}-error` : void 0, b = m || h;
|
|
376
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${o ? "ds-input-wrapper--full" : ""} ${f ? "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,81 +381,81 @@ 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" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
385
|
+
disabled: f,
|
|
386
386
|
"aria-invalid": t ? "true" : "false",
|
|
387
|
-
"aria-describedby":
|
|
387
|
+
"aria-describedby": b,
|
|
388
388
|
...u
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
|
|
391
|
+
n && /* @__PURE__ */ e.jsx(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
395
395
|
className: `ds-input-icon-right ds-input-icon-right--${l}`,
|
|
396
|
-
onClick:
|
|
396
|
+
onClick: i,
|
|
397
397
|
tabIndex: -1,
|
|
398
398
|
"aria-label": "Toggle visibility",
|
|
399
|
-
children:
|
|
399
|
+
children: n
|
|
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
|
+
r && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: r }),
|
|
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: m, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
407
|
function Vs({
|
|
408
408
|
label: s,
|
|
409
409
|
error: t,
|
|
410
|
-
hint:
|
|
411
|
-
fullWidth:
|
|
410
|
+
hint: r,
|
|
411
|
+
fullWidth: o = !0,
|
|
412
412
|
size: a = "m",
|
|
413
|
-
disabled:
|
|
414
|
-
id:
|
|
413
|
+
disabled: n,
|
|
414
|
+
id: i,
|
|
415
415
|
resize: l = !0,
|
|
416
|
-
rows:
|
|
416
|
+
rows: f = 3,
|
|
417
417
|
...d
|
|
418
418
|
}) {
|
|
419
|
-
const u =
|
|
420
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${
|
|
419
|
+
const u = i || `textarea-${K.useId()}`, p = r ? `${u}-hint` : void 0, h = t ? `${u}-error` : void 0, m = h || p;
|
|
420
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${o ? "ds-textarea-wrapper--full" : ""} ${n ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
421
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: u, children: s }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
423
423
|
"textarea",
|
|
424
424
|
{
|
|
425
425
|
id: u,
|
|
426
426
|
className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: n,
|
|
428
428
|
"aria-invalid": t ? "true" : "false",
|
|
429
|
-
"aria-describedby":
|
|
430
|
-
rows:
|
|
429
|
+
"aria-describedby": m,
|
|
430
|
+
rows: f,
|
|
431
431
|
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
|
|
434
|
+
r && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: r }),
|
|
435
435
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
438
|
function Ys({
|
|
439
439
|
label: s,
|
|
440
440
|
value: t,
|
|
441
|
-
onChange:
|
|
442
|
-
options:
|
|
441
|
+
onChange: r,
|
|
442
|
+
options: o = [],
|
|
443
443
|
placeholder: a = "Select option",
|
|
444
|
-
error:
|
|
445
|
-
fullWidth:
|
|
444
|
+
error: n,
|
|
445
|
+
fullWidth: i = !0,
|
|
446
446
|
size: l = "m",
|
|
447
|
-
disabled:
|
|
447
|
+
disabled: f = !1,
|
|
448
448
|
id: d,
|
|
449
449
|
...u
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = D(!1), [
|
|
452
|
-
|
|
451
|
+
const [p, h] = D(!1), [m, b] = D(!1), [j, R] = D({}), [$, B] = D("down"), [y, T] = D(-1), z = E(null), A = E(null), Y = E(null), H = E(null), F = d || `select-${K.useId()}`, v = `${F}-label`, C = n ? `${F}-error` : void 0, X = 150, U = (g = !1) => {
|
|
452
|
+
m || (b(!0), T(-1), H.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
|
-
h(!1),
|
|
454
|
+
h(!1), b(!1), g && ((c = Y.current) == null || c.focus());
|
|
455
455
|
}, X));
|
|
456
456
|
}, x = (g) => {
|
|
457
|
-
clearTimeout(H.current),
|
|
458
|
-
const c = g !== void 0 ? g : Math.max(
|
|
457
|
+
clearTimeout(H.current), b(!1);
|
|
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
|
M(() => () => clearTimeout(H.current), []);
|
|
@@ -478,7 +478,7 @@ function Ys({
|
|
|
478
478
|
z.current && !z.current.contains(c.target) && A.current && !A.current.contains(c.target) && U();
|
|
479
479
|
};
|
|
480
480
|
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
481
|
-
}, [
|
|
481
|
+
}, [m]), M(() => {
|
|
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" });
|
|
@@ -486,20 +486,20 @@ function Ys({
|
|
|
486
486
|
const k = (g) => {
|
|
487
487
|
switch (g.key) {
|
|
488
488
|
case "ArrowDown":
|
|
489
|
-
g.preventDefault(), p ? T((c) => Math.min(c + 1,
|
|
489
|
+
g.preventDefault(), p ? T((c) => Math.min(c + 1, o.length - 1)) : x();
|
|
490
490
|
break;
|
|
491
491
|
case "ArrowUp":
|
|
492
|
-
g.preventDefault(), p ? T((c) => Math.max(c - 1, 0)) : x(
|
|
492
|
+
g.preventDefault(), p ? T((c) => Math.max(c - 1, 0)) : x(o.length - 1);
|
|
493
493
|
break;
|
|
494
494
|
case "Home":
|
|
495
495
|
p && (g.preventDefault(), T(0));
|
|
496
496
|
break;
|
|
497
497
|
case "End":
|
|
498
|
-
p && (g.preventDefault(), T(
|
|
498
|
+
p && (g.preventDefault(), T(o.length - 1));
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
g.preventDefault(), p ? y >= 0 && (
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (r == null || r(o[y].value), U(!0)) : x();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
505
|
p && (g.preventDefault(), U(!0));
|
|
@@ -508,7 +508,7 @@ function Ys({
|
|
|
508
508
|
p && U(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
}, P =
|
|
511
|
+
}, P = o.find((g) => g.value === t), q = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], G = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
514
|
ref: A,
|
|
@@ -516,13 +516,13 @@ function Ys({
|
|
|
516
516
|
"aria-labelledby": s ? v : void 0,
|
|
517
517
|
tabIndex: -1,
|
|
518
518
|
className: [
|
|
519
|
-
"ds-select-dropdown",
|
|
519
|
+
"ds-select-dropdown ds-scrollable",
|
|
520
520
|
`ds-select-dropdown--${l}`,
|
|
521
521
|
`ds-select-dropdown--${$}`,
|
|
522
|
-
|
|
522
|
+
m && "ds-select-dropdown--closing"
|
|
523
523
|
].filter(Boolean).join(" "),
|
|
524
524
|
style: j,
|
|
525
|
-
children:
|
|
525
|
+
children: o.map((g, c) => /* @__PURE__ */ e.jsx(
|
|
526
526
|
"button",
|
|
527
527
|
{
|
|
528
528
|
id: `${F}-opt-${c}`,
|
|
@@ -537,7 +537,7 @@ function Ys({
|
|
|
537
537
|
c === y && "ds-select-option--active"
|
|
538
538
|
].filter(Boolean).join(" "),
|
|
539
539
|
onClick: () => {
|
|
540
|
-
|
|
540
|
+
r == null || r(g.value), U(!0);
|
|
541
541
|
},
|
|
542
542
|
children: g.label
|
|
543
543
|
},
|
|
@@ -545,7 +545,7 @@ function Ys({
|
|
|
545
545
|
))
|
|
546
546
|
}
|
|
547
547
|
);
|
|
548
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${
|
|
548
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${f ? "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",
|
|
@@ -558,14 +558,14 @@ 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": n ? "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} ${n ? "ds-select-trigger--error" : ""}`,
|
|
564
564
|
onClick: () => {
|
|
565
|
-
|
|
565
|
+
f || (p ? U() : x());
|
|
566
566
|
},
|
|
567
567
|
onKeyDown: k,
|
|
568
|
-
disabled:
|
|
568
|
+
disabled: f,
|
|
569
569
|
...u,
|
|
570
570
|
children: [
|
|
571
571
|
/* @__PURE__ */ e.jsx("span", { className: P ? "" : "ds-select-placeholder", children: (P == null ? void 0 : P.label) || a }),
|
|
@@ -581,53 +581,53 @@ function Ys({
|
|
|
581
581
|
]
|
|
582
582
|
}
|
|
583
583
|
) }),
|
|
584
|
-
|
|
584
|
+
n && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: n }),
|
|
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:
|
|
592
|
-
min:
|
|
591
|
+
onChange: r,
|
|
592
|
+
min: o = 0,
|
|
593
593
|
max: a = 100,
|
|
594
|
-
step:
|
|
595
|
-
size:
|
|
594
|
+
step: n = 1,
|
|
595
|
+
size: i = "m",
|
|
596
596
|
disabled: l = !1,
|
|
597
|
-
hint:
|
|
597
|
+
hint: f,
|
|
598
598
|
error: d,
|
|
599
599
|
...u
|
|
600
600
|
}) {
|
|
601
601
|
const p = () => {
|
|
602
602
|
if (l) return;
|
|
603
|
-
const $ = Math.min(Number(t) +
|
|
604
|
-
|
|
603
|
+
const $ = Math.min(Number(t) + n, a);
|
|
604
|
+
r == null || r($);
|
|
605
605
|
}, h = () => {
|
|
606
606
|
if (l) return;
|
|
607
|
-
const $ = Math.max(Number(t) -
|
|
608
|
-
|
|
609
|
-
},
|
|
607
|
+
const $ = Math.max(Number(t) - n, o);
|
|
608
|
+
r == null || r($);
|
|
609
|
+
}, m = ($) => {
|
|
610
610
|
if (l) return;
|
|
611
611
|
const B = $.target.value;
|
|
612
612
|
if (B === "") {
|
|
613
|
-
|
|
613
|
+
r == null || r(o);
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
616
|
const y = Number(B);
|
|
617
617
|
if (!isNaN(y)) {
|
|
618
|
-
const T = Math.min(Math.max(y,
|
|
619
|
-
|
|
618
|
+
const T = Math.min(Math.max(y, o), a);
|
|
619
|
+
r == null || r(T);
|
|
620
620
|
}
|
|
621
|
-
},
|
|
621
|
+
}, b = [
|
|
622
622
|
"ds-stepper-wrapper",
|
|
623
623
|
l && "ds-stepper-wrapper--disabled",
|
|
624
624
|
d && "ds-stepper-wrapper--error"
|
|
625
625
|
].filter(Boolean).join(" "), j = [
|
|
626
626
|
"ds-stepper",
|
|
627
|
-
`ds-stepper--${
|
|
627
|
+
`ds-stepper--${i}`,
|
|
628
628
|
l && "ds-stepper--disabled"
|
|
629
|
-
].filter(Boolean).join(" "), R =
|
|
630
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
629
|
+
].filter(Boolean).join(" "), R = i === "xs" ? I[1] : i === "small" ? I[2] : I[3];
|
|
630
|
+
return /* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
631
631
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
632
632
|
/* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
633
633
|
/* @__PURE__ */ e.jsx(
|
|
@@ -636,7 +636,7 @@ function Hs({
|
|
|
636
636
|
type: "button",
|
|
637
637
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
638
638
|
onClick: h,
|
|
639
|
-
disabled: l || t <=
|
|
639
|
+
disabled: l || t <= o,
|
|
640
640
|
"aria-label": "Decrease",
|
|
641
641
|
children: /* @__PURE__ */ e.jsx(Ye, { size: R, strokeWidth: 1.5 })
|
|
642
642
|
}
|
|
@@ -647,10 +647,10 @@ function Hs({
|
|
|
647
647
|
type: "number",
|
|
648
648
|
className: "ds-stepper-input",
|
|
649
649
|
value: t,
|
|
650
|
-
onChange:
|
|
651
|
-
min:
|
|
650
|
+
onChange: m,
|
|
651
|
+
min: o,
|
|
652
652
|
max: a,
|
|
653
|
-
step:
|
|
653
|
+
step: n,
|
|
654
654
|
disabled: l,
|
|
655
655
|
...u
|
|
656
656
|
}
|
|
@@ -667,41 +667,41 @@ function Hs({
|
|
|
667
667
|
}
|
|
668
668
|
)
|
|
669
669
|
] }),
|
|
670
|
-
|
|
670
|
+
f && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: f }),
|
|
671
671
|
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
672
672
|
] });
|
|
673
673
|
}
|
|
674
674
|
function qs({
|
|
675
675
|
children: s,
|
|
676
676
|
padding: t = "m",
|
|
677
|
-
variant:
|
|
678
|
-
hover:
|
|
677
|
+
variant: r = "info",
|
|
678
|
+
hover: o = !1,
|
|
679
679
|
// deprecated, use variant="interactive"
|
|
680
680
|
onClick: a,
|
|
681
|
-
href:
|
|
682
|
-
disabled:
|
|
681
|
+
href: n,
|
|
682
|
+
disabled: i = !1,
|
|
683
683
|
...l
|
|
684
684
|
}) {
|
|
685
|
-
const d = (
|
|
685
|
+
const d = (o ? "interactive" : r) === "interactive" || a || n, u = [
|
|
686
686
|
"ds-card",
|
|
687
687
|
`ds-card--${t}`,
|
|
688
688
|
d && "ds-card--interactive"
|
|
689
689
|
].filter(Boolean).join(" ");
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
|
|
690
|
+
if (n) {
|
|
691
|
+
const m = (b) => {
|
|
692
|
+
if (i) {
|
|
693
|
+
b.preventDefault();
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
|
-
|
|
696
|
+
b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(), a == null || a(b));
|
|
697
697
|
};
|
|
698
698
|
return /* @__PURE__ */ e.jsx(
|
|
699
699
|
"a",
|
|
700
700
|
{
|
|
701
701
|
className: u,
|
|
702
|
-
href:
|
|
703
|
-
onClick:
|
|
704
|
-
"aria-disabled":
|
|
702
|
+
href: i ? void 0 : n,
|
|
703
|
+
onClick: m,
|
|
704
|
+
"aria-disabled": i ? "true" : void 0,
|
|
705
705
|
...l,
|
|
706
706
|
children: s
|
|
707
707
|
}
|
|
@@ -710,7 +710,7 @@ function qs({
|
|
|
710
710
|
const p = d && a ? "button" : "div", h = d && a ? {
|
|
711
711
|
type: "button",
|
|
712
712
|
onClick: a,
|
|
713
|
-
disabled:
|
|
713
|
+
disabled: i
|
|
714
714
|
} : {};
|
|
715
715
|
return /* @__PURE__ */ e.jsx(
|
|
716
716
|
p,
|
|
@@ -735,28 +735,28 @@ function Gs({ children: s, ...t }) {
|
|
|
735
735
|
function Js({ children: s, ...t }) {
|
|
736
736
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
737
737
|
}
|
|
738
|
-
function Zs({ children: s, secondary: t = !1, ...
|
|
739
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...
|
|
738
|
+
function Zs({ children: s, secondary: t = !1, ...r }) {
|
|
739
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...r, 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, ...r }) {
|
|
742
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...r, 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, ...r }) {
|
|
745
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...r, children: s });
|
|
746
746
|
}
|
|
747
747
|
function ce({
|
|
748
748
|
children: s,
|
|
749
749
|
variant: t = "default",
|
|
750
|
-
size:
|
|
751
|
-
role:
|
|
750
|
+
size: r = "m",
|
|
751
|
+
role: o,
|
|
752
752
|
...a
|
|
753
753
|
}) {
|
|
754
|
-
const
|
|
754
|
+
const n = [
|
|
755
755
|
"ds-badge",
|
|
756
756
|
`ds-badge--${t}`,
|
|
757
|
-
`ds-badge--${
|
|
758
|
-
].filter(Boolean).join(" "),
|
|
759
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
757
|
+
`ds-badge--${r}`
|
|
758
|
+
].filter(Boolean).join(" "), i = o || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
759
|
+
return /* @__PURE__ */ e.jsx("span", { className: n, role: i, ...a, children: s });
|
|
760
760
|
}
|
|
761
761
|
const us = {
|
|
762
762
|
info: ke,
|
|
@@ -767,26 +767,26 @@ const us = {
|
|
|
767
767
|
function Qs({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: t = "info",
|
|
770
|
-
title:
|
|
771
|
-
onClose:
|
|
770
|
+
title: r,
|
|
771
|
+
onClose: o,
|
|
772
772
|
role: a,
|
|
773
|
-
...
|
|
773
|
+
...n
|
|
774
774
|
}) {
|
|
775
|
-
const
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${
|
|
777
|
-
|
|
775
|
+
const i = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${r ? "" : "ds-alert--no-title"}`, role: l, ...n, children: [
|
|
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
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
781
781
|
] }),
|
|
782
|
-
|
|
782
|
+
o && /* @__PURE__ */ e.jsx(
|
|
783
783
|
"button",
|
|
784
784
|
{
|
|
785
785
|
type: "button",
|
|
786
786
|
className: "ds-alert__close",
|
|
787
|
-
onClick:
|
|
787
|
+
onClick: o,
|
|
788
788
|
"aria-label": "Close alert",
|
|
789
|
-
children: /* @__PURE__ */ e.jsx(
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
@@ -795,15 +795,15 @@ const fs = 200;
|
|
|
795
795
|
function et({
|
|
796
796
|
children: s,
|
|
797
797
|
title: t,
|
|
798
|
-
onClose:
|
|
799
|
-
size:
|
|
798
|
+
onClose: r,
|
|
799
|
+
size: o = "m",
|
|
800
800
|
scrollable: a = !1,
|
|
801
|
-
subHeader:
|
|
802
|
-
...
|
|
801
|
+
subHeader: n,
|
|
802
|
+
...i
|
|
803
803
|
}) {
|
|
804
|
-
const l = E(null),
|
|
805
|
-
!
|
|
806
|
-
u(!1),
|
|
804
|
+
const l = E(null), f = K.useId(), [d, u] = D(!1), p = () => {
|
|
805
|
+
!r || d || (u(!0), setTimeout(() => {
|
|
806
|
+
u(!1), r();
|
|
807
807
|
}, fs));
|
|
808
808
|
};
|
|
809
809
|
M(() => {
|
|
@@ -815,35 +815,35 @@ 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 = K.Children.toArray(s),
|
|
820
|
-
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...
|
|
818
|
+
}, [r, d]);
|
|
819
|
+
const h = K.Children.toArray(s), m = h.find((j) => (j == null ? void 0 : j.type) === Ie), b = h.filter((j) => (j == null ? void 0 : j.type) !== Ie);
|
|
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
|
{
|
|
823
|
-
className: [`ds-modal ds-modal--${
|
|
823
|
+
className: [`ds-modal ds-modal--${o}`, a && "ds-modal--scrollable"].filter(Boolean).join(" "),
|
|
824
824
|
ref: l,
|
|
825
825
|
role: "dialog",
|
|
826
826
|
"aria-modal": "true",
|
|
827
|
-
"aria-labelledby": t ?
|
|
827
|
+
"aria-labelledby": t ? f : void 0,
|
|
828
828
|
children: [
|
|
829
|
-
(t ||
|
|
830
|
-
(t ||
|
|
831
|
-
t && /* @__PURE__ */ e.jsx("h3", { id:
|
|
832
|
-
|
|
829
|
+
(t || r || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
830
|
+
(t || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header-row", children: [
|
|
831
|
+
t && /* @__PURE__ */ e.jsx("h3", { id: f, className: "ds-modal__title", children: t }),
|
|
832
|
+
r && /* @__PURE__ */ e.jsx(
|
|
833
833
|
me,
|
|
834
834
|
{
|
|
835
835
|
variant: "ghost",
|
|
836
836
|
size: "small",
|
|
837
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
837
|
+
icon: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }),
|
|
838
838
|
onClick: p,
|
|
839
839
|
"aria-label": "Close modal"
|
|
840
840
|
}
|
|
841
841
|
)
|
|
842
842
|
] }),
|
|
843
|
-
|
|
843
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: n })
|
|
844
844
|
] }),
|
|
845
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body", children:
|
|
846
|
-
|
|
845
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: b }),
|
|
846
|
+
m
|
|
847
847
|
]
|
|
848
848
|
}
|
|
849
849
|
) });
|
|
@@ -854,22 +854,22 @@ function Ie({ children: s }) {
|
|
|
854
854
|
function ms({
|
|
855
855
|
children: s,
|
|
856
856
|
title: t = "Code",
|
|
857
|
-
defaultExpanded:
|
|
858
|
-
expanded:
|
|
857
|
+
defaultExpanded: r = !1,
|
|
858
|
+
expanded: o,
|
|
859
859
|
onToggle: a,
|
|
860
|
-
padding:
|
|
861
|
-
className:
|
|
860
|
+
padding: n = "s",
|
|
861
|
+
className: i = "",
|
|
862
862
|
...l
|
|
863
863
|
}) {
|
|
864
|
-
const [
|
|
865
|
-
u ? a == null || a(!
|
|
866
|
-
},
|
|
864
|
+
const [f, d] = D(r), u = o !== void 0, p = u ? o : f, h = () => {
|
|
865
|
+
u ? a == null || a(!o) : d((b) => !b);
|
|
866
|
+
}, m = [
|
|
867
867
|
"ds-code-accordion",
|
|
868
|
-
`ds-code-accordion--${
|
|
868
|
+
`ds-code-accordion--${n}`,
|
|
869
869
|
p && "ds-code-accordion--expanded",
|
|
870
|
-
|
|
870
|
+
i
|
|
871
871
|
].filter(Boolean).join(" ");
|
|
872
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
872
|
+
return /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
873
873
|
/* @__PURE__ */ e.jsxs(
|
|
874
874
|
"button",
|
|
875
875
|
{
|
|
@@ -890,59 +890,59 @@ function ms({
|
|
|
890
890
|
]
|
|
891
891
|
}
|
|
892
892
|
),
|
|
893
|
-
/* @__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", children: /* @__PURE__ */ e.jsx("code", { children: s }) }) }) })
|
|
893
|
+
/* @__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
894
|
] });
|
|
895
895
|
}
|
|
896
|
-
function st({ children: s, block: t = !1, collapsible:
|
|
897
|
-
return t ?
|
|
896
|
+
function st({ children: s, block: t = !1, collapsible: r = !1, title: o = "Code", defaultExpanded: a = !1, ...n }) {
|
|
897
|
+
return t ? r ? /* @__PURE__ */ e.jsx(ms, { title: o, defaultExpanded: a, ...n, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...n, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...n, children: s });
|
|
898
898
|
}
|
|
899
|
-
function tt({ href: s, children: t, onClick:
|
|
900
|
-
const l =
|
|
899
|
+
function tt({ href: s, children: t, onClick: r, target: o, rel: a, ...n }) {
|
|
900
|
+
const l = o === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
901
901
|
return /* @__PURE__ */ e.jsx(
|
|
902
902
|
"a",
|
|
903
903
|
{
|
|
904
904
|
href: s,
|
|
905
905
|
className: "ds-link",
|
|
906
|
-
onClick:
|
|
907
|
-
target:
|
|
906
|
+
onClick: r,
|
|
907
|
+
target: o,
|
|
908
908
|
rel: l,
|
|
909
|
-
...
|
|
909
|
+
...n,
|
|
910
910
|
children: t
|
|
911
911
|
}
|
|
912
912
|
);
|
|
913
913
|
}
|
|
914
|
-
function
|
|
915
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...
|
|
914
|
+
function rt({ children: s, size: t = "m", variant: r = "ghost", ...o }) {
|
|
915
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...o, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant: r }) : a) });
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
const d =
|
|
917
|
+
function nt({ children: s, selected: t = !1, onClick: r, size: o = "m", variant: a = "ghost", disabled: n = !1, icon: i, href: l, ...f }) {
|
|
918
|
+
const d = i && !s, u = [
|
|
919
919
|
"ds-tab",
|
|
920
|
-
`ds-tab--${
|
|
920
|
+
`ds-tab--${o}`,
|
|
921
921
|
`ds-tab--${a}`,
|
|
922
922
|
t && "ds-tab--selected",
|
|
923
923
|
d && "ds-tab--icon-only"
|
|
924
924
|
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
925
|
-
|
|
925
|
+
i && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: i }),
|
|
926
926
|
s
|
|
927
927
|
] });
|
|
928
928
|
if (l) {
|
|
929
|
-
const h = (
|
|
930
|
-
if (
|
|
931
|
-
|
|
929
|
+
const h = (m) => {
|
|
930
|
+
if (n) {
|
|
931
|
+
m.preventDefault();
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
|
-
|
|
934
|
+
m.metaKey || m.ctrlKey || m.button === 1 || (m.preventDefault(), r == null || r(m));
|
|
935
935
|
};
|
|
936
936
|
return /* @__PURE__ */ e.jsx(
|
|
937
937
|
"a",
|
|
938
938
|
{
|
|
939
939
|
role: "tab",
|
|
940
940
|
"aria-current": t ? "page" : void 0,
|
|
941
|
-
"aria-disabled":
|
|
941
|
+
"aria-disabled": n ? "true" : void 0,
|
|
942
942
|
className: u,
|
|
943
|
-
href:
|
|
943
|
+
href: n ? void 0 : l,
|
|
944
944
|
onClick: h,
|
|
945
|
-
...
|
|
945
|
+
...f,
|
|
946
946
|
children: p
|
|
947
947
|
}
|
|
948
948
|
);
|
|
@@ -953,70 +953,70 @@ function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant:
|
|
|
953
953
|
role: "tab",
|
|
954
954
|
"aria-selected": t,
|
|
955
955
|
className: u,
|
|
956
|
-
onClick:
|
|
957
|
-
disabled:
|
|
958
|
-
...
|
|
956
|
+
onClick: r,
|
|
957
|
+
disabled: n,
|
|
958
|
+
...f,
|
|
959
959
|
children: p
|
|
960
960
|
}
|
|
961
961
|
);
|
|
962
962
|
}
|
|
963
|
-
function at({ options: s, value: t, onChange:
|
|
964
|
-
const
|
|
965
|
-
if (!
|
|
966
|
-
const
|
|
967
|
-
if (!
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
if (!
|
|
971
|
-
const B =
|
|
963
|
+
function at({ options: s, value: t, onChange: r, size: o = "m", disabled: a = !1 }) {
|
|
964
|
+
const n = E(null), i = E(null), [l, f] = D(!1), d = E(!1), u = E(null), p = E(null), h = () => {
|
|
965
|
+
if (!n.current) return;
|
|
966
|
+
const m = n.current.querySelector(`[data-value="${t}"]`);
|
|
967
|
+
if (!m) return;
|
|
968
|
+
const b = n.current.getBoundingClientRect(), j = m.getBoundingClientRect(), R = j.left - b.left, $ = j.width;
|
|
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) : (f(!0), requestAnimationFrame(() => {
|
|
970
|
+
if (!i.current || !n.current) return;
|
|
971
|
+
const B = n.current.querySelector(`[data-value="${t}"]`);
|
|
972
972
|
if (!B) return;
|
|
973
|
-
const y =
|
|
974
|
-
|
|
973
|
+
const y = n.current.getBoundingClientRect(), T = B.getBoundingClientRect();
|
|
974
|
+
i.current.style.transition = "none", i.current.style.left = T.left - y.left + "px", i.current.style.width = T.width + "px";
|
|
975
975
|
}));
|
|
976
976
|
};
|
|
977
977
|
return p.current = h, Ve(() => {
|
|
978
|
-
const
|
|
979
|
-
u.current = t, d.current = l &&
|
|
978
|
+
const m = u.current !== t;
|
|
979
|
+
u.current = t, d.current = l && m, h();
|
|
980
980
|
}), M(() => {
|
|
981
|
-
if (!
|
|
982
|
-
const
|
|
981
|
+
if (!n.current) return;
|
|
982
|
+
const m = new ResizeObserver(() => {
|
|
983
983
|
d.current = !1, p.current();
|
|
984
984
|
});
|
|
985
|
-
return
|
|
985
|
+
return m.observe(n.current), () => m.disconnect();
|
|
986
986
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
987
987
|
"div",
|
|
988
988
|
{
|
|
989
989
|
className: [
|
|
990
990
|
"ds-seg",
|
|
991
|
-
`ds-seg--${
|
|
991
|
+
`ds-seg--${o}`,
|
|
992
992
|
a && "ds-seg--disabled"
|
|
993
993
|
].filter(Boolean).join(" "),
|
|
994
|
-
ref:
|
|
994
|
+
ref: n,
|
|
995
995
|
role: "group",
|
|
996
996
|
children: [
|
|
997
997
|
l && /* @__PURE__ */ e.jsx(
|
|
998
998
|
"div",
|
|
999
999
|
{
|
|
1000
|
-
ref:
|
|
1000
|
+
ref: i,
|
|
1001
1001
|
className: "ds-seg__pill",
|
|
1002
1002
|
"aria-hidden": "true"
|
|
1003
1003
|
}
|
|
1004
1004
|
),
|
|
1005
|
-
s.map((
|
|
1005
|
+
s.map((m) => /* @__PURE__ */ e.jsxs(
|
|
1006
1006
|
"button",
|
|
1007
1007
|
{
|
|
1008
1008
|
type: "button",
|
|
1009
|
-
"data-value":
|
|
1010
|
-
className: ["ds-seg__btn", t ===
|
|
1011
|
-
onClick: () => !a &&
|
|
1012
|
-
"aria-pressed": t ===
|
|
1009
|
+
"data-value": m.value,
|
|
1010
|
+
className: ["ds-seg__btn", t === m.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1011
|
+
onClick: () => !a && r(m.value),
|
|
1012
|
+
"aria-pressed": t === m.value,
|
|
1013
1013
|
disabled: a,
|
|
1014
1014
|
children: [
|
|
1015
|
-
|
|
1016
|
-
|
|
1015
|
+
m.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: m.icon }),
|
|
1016
|
+
m.label
|
|
1017
1017
|
]
|
|
1018
1018
|
},
|
|
1019
|
-
|
|
1019
|
+
m.value
|
|
1020
1020
|
))
|
|
1021
1021
|
]
|
|
1022
1022
|
}
|
|
@@ -1025,20 +1025,20 @@ function at({ options: s, value: t, onChange: n, size: i = "m", disabled: a = !1
|
|
|
1025
1025
|
function Ee({
|
|
1026
1026
|
children: s,
|
|
1027
1027
|
title: t,
|
|
1028
|
-
defaultExpanded:
|
|
1029
|
-
expanded:
|
|
1028
|
+
defaultExpanded: r = !1,
|
|
1029
|
+
expanded: o,
|
|
1030
1030
|
onToggle: a,
|
|
1031
|
-
padding:
|
|
1032
|
-
...
|
|
1031
|
+
padding: n = "m",
|
|
1032
|
+
...i
|
|
1033
1033
|
}) {
|
|
1034
|
-
const [l,
|
|
1035
|
-
d ? a == null || a(!
|
|
1034
|
+
const [l, f] = D(r), d = o !== void 0, u = d ? o : l, p = () => {
|
|
1035
|
+
d ? a == null || a(!o) : f((m) => !m);
|
|
1036
1036
|
}, h = [
|
|
1037
1037
|
"ds-accordion",
|
|
1038
|
-
`ds-accordion--${
|
|
1038
|
+
`ds-accordion--${n}`,
|
|
1039
1039
|
u && "ds-accordion--expanded"
|
|
1040
1040
|
].filter(Boolean).join(" ");
|
|
1041
|
-
return /* @__PURE__ */ e.jsxs("div", { className: h, ...
|
|
1041
|
+
return /* @__PURE__ */ e.jsxs("div", { className: h, ...i, children: [
|
|
1042
1042
|
/* @__PURE__ */ e.jsxs(
|
|
1043
1043
|
"button",
|
|
1044
1044
|
{
|
|
@@ -1062,42 +1062,42 @@ function Ee({
|
|
|
1062
1062
|
/* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-inner", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-body", children: s }) }) })
|
|
1063
1063
|
] });
|
|
1064
1064
|
}
|
|
1065
|
-
const
|
|
1066
|
-
function ps(s, t,
|
|
1067
|
-
const
|
|
1068
|
-
let a,
|
|
1065
|
+
const re = 8, le = 8;
|
|
1066
|
+
function ps(s, t, r) {
|
|
1067
|
+
const o = window.innerWidth;
|
|
1068
|
+
let a, n;
|
|
1069
1069
|
switch (s) {
|
|
1070
1070
|
case "top":
|
|
1071
|
-
a = t.top -
|
|
1071
|
+
a = t.top - r.height - re, n = t.left + t.width / 2 - r.width / 2;
|
|
1072
1072
|
break;
|
|
1073
1073
|
case "bottom":
|
|
1074
|
-
a = t.bottom +
|
|
1074
|
+
a = t.bottom + re, n = t.left + t.width / 2 - r.width / 2;
|
|
1075
1075
|
break;
|
|
1076
1076
|
case "left":
|
|
1077
|
-
a = t.top + t.height / 2 -
|
|
1077
|
+
a = t.top + t.height / 2 - r.height / 2, n = t.left - r.width - re;
|
|
1078
1078
|
break;
|
|
1079
1079
|
case "right":
|
|
1080
|
-
a = t.top + t.height / 2 -
|
|
1080
|
+
a = t.top + t.height / 2 - r.height / 2, n = t.right + re;
|
|
1081
1081
|
break;
|
|
1082
1082
|
default:
|
|
1083
|
-
a = t.bottom +
|
|
1083
|
+
a = t.bottom + re, n = t.left;
|
|
1084
1084
|
}
|
|
1085
|
-
const
|
|
1086
|
-
return { top: a, left:
|
|
1087
|
-
}
|
|
1088
|
-
function hs(s, t,
|
|
1089
|
-
const
|
|
1090
|
-
if (s.top >= t +
|
|
1091
|
-
if (a - s.bottom >= t +
|
|
1092
|
-
if (
|
|
1093
|
-
if (s.left >=
|
|
1094
|
-
const
|
|
1095
|
-
return
|
|
1096
|
-
}
|
|
1097
|
-
function
|
|
1098
|
-
const [a,
|
|
1085
|
+
const i = Math.max(le, Math.min(o - r.width - le, n)), l = n - i;
|
|
1086
|
+
return { top: a, left: i, arrowOffset: l };
|
|
1087
|
+
}
|
|
1088
|
+
function hs(s, t, r) {
|
|
1089
|
+
const o = window.innerWidth, a = window.innerHeight;
|
|
1090
|
+
if (s.top >= t + re + le) return "top";
|
|
1091
|
+
if (a - s.bottom >= t + re + le) return "bottom";
|
|
1092
|
+
if (o - s.right >= r + re + le) return "right";
|
|
1093
|
+
if (s.left >= r + re + le) return "left";
|
|
1094
|
+
const n = Math.max(s.top, a - s.bottom, s.left, o - s.right);
|
|
1095
|
+
return n === s.top ? "top" : n === a - s.bottom ? "bottom" : n === o - s.right ? "right" : "left";
|
|
1096
|
+
}
|
|
1097
|
+
function ot({ children: s, content: t, position: r, ...o }) {
|
|
1098
|
+
const [a, n] = D(!1), [i, l] = D({ visibility: "hidden" }), [f, d] = D(r || "top"), u = E(null), p = E(null), h = E(!1), m = () => {
|
|
1099
1099
|
if (!u.current || !p.current) return;
|
|
1100
|
-
const j = u.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), $ =
|
|
1100
|
+
const j = u.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), $ = r || hs(j, R.height, R.width), { top: B, left: y, arrowOffset: T } = ps($, j, R);
|
|
1101
1101
|
d($), l({
|
|
1102
1102
|
position: "fixed",
|
|
1103
1103
|
top: B,
|
|
@@ -1109,24 +1109,24 @@ function it({ children: s, content: t, position: n, ...i }) {
|
|
|
1109
1109
|
if (M(() => {
|
|
1110
1110
|
if (!a) return;
|
|
1111
1111
|
l({ position: "fixed", visibility: "hidden" });
|
|
1112
|
-
const j = requestAnimationFrame(
|
|
1113
|
-
return window.addEventListener("scroll",
|
|
1114
|
-
cancelAnimationFrame(j), window.removeEventListener("scroll",
|
|
1112
|
+
const j = requestAnimationFrame(m);
|
|
1113
|
+
return window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1114
|
+
cancelAnimationFrame(j), window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1115
1115
|
};
|
|
1116
|
-
}, [a,
|
|
1116
|
+
}, [a, r]), M(() => {
|
|
1117
1117
|
if (!a) return;
|
|
1118
1118
|
const j = (R) => {
|
|
1119
|
-
u.current && !u.current.contains(R.target) &&
|
|
1119
|
+
u.current && !u.current.contains(R.target) && n(!1);
|
|
1120
1120
|
};
|
|
1121
1121
|
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1122
1122
|
}, [a]), !t) return s;
|
|
1123
|
-
const
|
|
1123
|
+
const b = a && /* @__PURE__ */ e.jsx(
|
|
1124
1124
|
"div",
|
|
1125
1125
|
{
|
|
1126
1126
|
ref: p,
|
|
1127
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1127
|
+
className: `ds-tooltip ds-tooltip--${f}`,
|
|
1128
1128
|
role: "tooltip",
|
|
1129
|
-
style:
|
|
1129
|
+
style: i,
|
|
1130
1130
|
children: t
|
|
1131
1131
|
}
|
|
1132
1132
|
);
|
|
@@ -1136,37 +1136,37 @@ function it({ children: s, content: t, position: n, ...i }) {
|
|
|
1136
1136
|
ref: u,
|
|
1137
1137
|
className: "ds-tooltip-wrapper",
|
|
1138
1138
|
onMouseEnter: () => {
|
|
1139
|
-
h.current ||
|
|
1139
|
+
h.current || n(!0);
|
|
1140
1140
|
},
|
|
1141
1141
|
onMouseLeave: () => {
|
|
1142
|
-
h.current ||
|
|
1142
|
+
h.current || n(!1);
|
|
1143
1143
|
},
|
|
1144
1144
|
onTouchStart: () => {
|
|
1145
|
-
h.current = !0,
|
|
1145
|
+
h.current = !0, n((j) => !j);
|
|
1146
1146
|
},
|
|
1147
|
-
...
|
|
1147
|
+
...o,
|
|
1148
1148
|
children: [
|
|
1149
1149
|
s,
|
|
1150
|
-
typeof document < "u" && pe.createPortal(
|
|
1150
|
+
typeof document < "u" && pe.createPortal(b, document.body)
|
|
1151
1151
|
]
|
|
1152
1152
|
}
|
|
1153
1153
|
);
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function it({
|
|
1156
1156
|
checked: s = !1,
|
|
1157
1157
|
onChange: t,
|
|
1158
|
-
size:
|
|
1159
|
-
disabled:
|
|
1158
|
+
size: r = "m",
|
|
1159
|
+
disabled: o = !1,
|
|
1160
1160
|
label: a,
|
|
1161
|
-
id:
|
|
1162
|
-
...
|
|
1161
|
+
id: n,
|
|
1162
|
+
...i
|
|
1163
1163
|
}) {
|
|
1164
|
-
const l =
|
|
1164
|
+
const l = n || `toggle-${K.useId()}`, f = [
|
|
1165
1165
|
"ds-toggle",
|
|
1166
|
-
`ds-toggle--${
|
|
1167
|
-
|
|
1166
|
+
`ds-toggle--${r}`,
|
|
1167
|
+
o && "ds-toggle--disabled"
|
|
1168
1168
|
].filter(Boolean).join(" ");
|
|
1169
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1169
|
+
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: l, children: [
|
|
1170
1170
|
/* @__PURE__ */ e.jsx(
|
|
1171
1171
|
"input",
|
|
1172
1172
|
{
|
|
@@ -1175,8 +1175,8 @@ function ot({
|
|
|
1175
1175
|
className: "ds-toggle__input",
|
|
1176
1176
|
checked: s,
|
|
1177
1177
|
onChange: (d) => t == null ? void 0 : t(d.target.checked),
|
|
1178
|
-
disabled:
|
|
1179
|
-
...
|
|
1178
|
+
disabled: o,
|
|
1179
|
+
...i
|
|
1180
1180
|
}
|
|
1181
1181
|
),
|
|
1182
1182
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toggle__track", children: /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__thumb" }) }),
|
|
@@ -1186,18 +1186,18 @@ function ot({
|
|
|
1186
1186
|
function lt({
|
|
1187
1187
|
checked: s = !1,
|
|
1188
1188
|
onChange: t,
|
|
1189
|
-
size:
|
|
1190
|
-
disabled:
|
|
1189
|
+
size: r = "m",
|
|
1190
|
+
disabled: o = !1,
|
|
1191
1191
|
label: a,
|
|
1192
|
-
id:
|
|
1193
|
-
...
|
|
1192
|
+
id: n,
|
|
1193
|
+
...i
|
|
1194
1194
|
}) {
|
|
1195
|
-
const l =
|
|
1195
|
+
const l = n || `checkbox-${K.useId()}`, f = [
|
|
1196
1196
|
"ds-checkbox",
|
|
1197
|
-
`ds-checkbox--${
|
|
1198
|
-
|
|
1199
|
-
].filter(Boolean).join(" "), d =
|
|
1200
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1197
|
+
`ds-checkbox--${r}`,
|
|
1198
|
+
o && "ds-checkbox--disabled"
|
|
1199
|
+
].filter(Boolean).join(" "), d = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1200
|
+
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: l, children: [
|
|
1201
1201
|
/* @__PURE__ */ e.jsx(
|
|
1202
1202
|
"input",
|
|
1203
1203
|
{
|
|
@@ -1206,8 +1206,8 @@ function lt({
|
|
|
1206
1206
|
className: "ds-checkbox__input",
|
|
1207
1207
|
checked: s,
|
|
1208
1208
|
onChange: (u) => t == null ? void 0 : t(u.target.checked),
|
|
1209
|
-
disabled:
|
|
1210
|
-
...
|
|
1209
|
+
disabled: o,
|
|
1210
|
+
...i
|
|
1211
1211
|
}
|
|
1212
1212
|
),
|
|
1213
1213
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ e.jsx(
|
|
@@ -1224,18 +1224,18 @@ function lt({
|
|
|
1224
1224
|
function ct({
|
|
1225
1225
|
checked: s = !1,
|
|
1226
1226
|
onChange: t,
|
|
1227
|
-
size:
|
|
1228
|
-
disabled:
|
|
1227
|
+
size: r = "m",
|
|
1228
|
+
disabled: o = !1,
|
|
1229
1229
|
label: a,
|
|
1230
|
-
name:
|
|
1231
|
-
value:
|
|
1230
|
+
name: n,
|
|
1231
|
+
value: i,
|
|
1232
1232
|
id: l,
|
|
1233
|
-
...
|
|
1233
|
+
...f
|
|
1234
1234
|
}) {
|
|
1235
1235
|
const d = l || `radio-${K.useId()}`, u = [
|
|
1236
1236
|
"ds-radio",
|
|
1237
|
-
`ds-radio--${
|
|
1238
|
-
|
|
1237
|
+
`ds-radio--${r}`,
|
|
1238
|
+
o && "ds-radio--disabled"
|
|
1239
1239
|
].filter(Boolean).join(" ");
|
|
1240
1240
|
return /* @__PURE__ */ e.jsxs("label", { className: u, htmlFor: d, children: [
|
|
1241
1241
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1246,36 +1246,36 @@ function ct({
|
|
|
1246
1246
|
className: "ds-radio__input",
|
|
1247
1247
|
checked: s,
|
|
1248
1248
|
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1249
|
-
disabled:
|
|
1250
|
-
name:
|
|
1251
|
-
value:
|
|
1252
|
-
...
|
|
1249
|
+
disabled: o,
|
|
1250
|
+
name: n,
|
|
1251
|
+
value: i,
|
|
1252
|
+
...f
|
|
1253
1253
|
}
|
|
1254
1254
|
),
|
|
1255
1255
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1256
1256
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1257
1257
|
] });
|
|
1258
1258
|
}
|
|
1259
|
-
function xs({ width: s, height: t, shape:
|
|
1259
|
+
function xs({ width: s, height: t, shape: r = "rect", aspectRatio: o, className: a = "", style: n = {}, ...i }) {
|
|
1260
1260
|
return /* @__PURE__ */ e.jsx(
|
|
1261
1261
|
"span",
|
|
1262
1262
|
{
|
|
1263
|
-
className: ["ds-skeleton", `ds-skeleton--${
|
|
1264
|
-
style: { width: s, height: t, aspectRatio:
|
|
1263
|
+
className: ["ds-skeleton", `ds-skeleton--${r}`, a].filter(Boolean).join(" "),
|
|
1264
|
+
style: { width: s, height: t, aspectRatio: o, ...n },
|
|
1265
1265
|
"aria-hidden": "true",
|
|
1266
|
-
...
|
|
1266
|
+
...i
|
|
1267
1267
|
}
|
|
1268
1268
|
);
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1270
|
+
function bs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: o = "", style: a = {}, ...n }) {
|
|
1271
1271
|
return /* @__PURE__ */ e.jsx(
|
|
1272
1272
|
"span",
|
|
1273
1273
|
{
|
|
1274
|
-
className: ["ds-skeleton-text",
|
|
1275
|
-
style: { gap:
|
|
1274
|
+
className: ["ds-skeleton-text", o].filter(Boolean).join(" "),
|
|
1275
|
+
style: { gap: r, ...a },
|
|
1276
1276
|
"aria-hidden": "true",
|
|
1277
|
-
...
|
|
1278
|
-
children: Array.from({ length: s }, (
|
|
1277
|
+
...n,
|
|
1278
|
+
children: Array.from({ length: s }, (i, l) => /* @__PURE__ */ e.jsx(
|
|
1279
1279
|
"span",
|
|
1280
1280
|
{
|
|
1281
1281
|
className: "ds-skeleton ds-skeleton--text",
|
|
@@ -1286,55 +1286,55 @@ function _s({ lines: s = 1, lastLineWidth: t = "70%", gap: n, className: i = "",
|
|
|
1286
1286
|
}
|
|
1287
1287
|
);
|
|
1288
1288
|
}
|
|
1289
|
-
xs.Text =
|
|
1289
|
+
xs.Text = bs;
|
|
1290
1290
|
function js(s) {
|
|
1291
1291
|
let t = 2166136261;
|
|
1292
|
-
for (let
|
|
1293
|
-
t ^= s.charCodeAt(
|
|
1292
|
+
for (let r = 0; r < s.length; r++)
|
|
1293
|
+
t ^= s.charCodeAt(r), t = Math.imul(t, 16777619) >>> 0;
|
|
1294
1294
|
return t % 360;
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1296
|
+
function _s(s) {
|
|
1297
1297
|
if (!s) return "";
|
|
1298
1298
|
const t = s.trim().split(/\s+/);
|
|
1299
1299
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1300
1300
|
}
|
|
1301
|
-
function dt({ seed: s, icon: t, src:
|
|
1302
|
-
const l = js(s ?? ""), [
|
|
1301
|
+
function dt({ seed: s, icon: t, src: r, size: o = 32, className: a = "", style: n = {}, ...i }) {
|
|
1302
|
+
const l = js(s ?? ""), [f, d] = D(!1), u = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: _s(s) });
|
|
1303
1303
|
return /* @__PURE__ */ e.jsx(
|
|
1304
1304
|
"div",
|
|
1305
1305
|
{
|
|
1306
1306
|
className: ["ds-avatar", a].filter(Boolean).join(" "),
|
|
1307
|
-
style: { width:
|
|
1307
|
+
style: { width: o, height: o, "--ds-avatar-h": l, ...n },
|
|
1308
1308
|
"aria-hidden": "true",
|
|
1309
|
-
...
|
|
1310
|
-
children:
|
|
1309
|
+
...i,
|
|
1310
|
+
children: r && !f ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () => d(!0) }) : u
|
|
1311
1311
|
}
|
|
1312
1312
|
);
|
|
1313
1313
|
}
|
|
1314
1314
|
function ut({
|
|
1315
1315
|
children: s,
|
|
1316
1316
|
size: t = "compact",
|
|
1317
|
-
stickyTop:
|
|
1318
|
-
maxHeight:
|
|
1317
|
+
stickyTop: r,
|
|
1318
|
+
maxHeight: o,
|
|
1319
1319
|
className: a = "",
|
|
1320
|
-
style:
|
|
1321
|
-
...
|
|
1320
|
+
style: n = {},
|
|
1321
|
+
...i
|
|
1322
1322
|
}) {
|
|
1323
1323
|
const l = {
|
|
1324
|
-
...
|
|
1325
|
-
...
|
|
1326
|
-
...
|
|
1324
|
+
...o ? { maxHeight: o } : {},
|
|
1325
|
+
...r !== void 0 ? { "--ds-table-sticky-top": typeof r == "number" ? `${r}px` : r } : {},
|
|
1326
|
+
...n
|
|
1327
1327
|
};
|
|
1328
1328
|
return /* @__PURE__ */ e.jsx(
|
|
1329
1329
|
"div",
|
|
1330
1330
|
{
|
|
1331
|
-
className: ["ds-table-wrap",
|
|
1331
|
+
className: ["ds-table-wrap", "ds-scrollable", o ? "ds-table-wrap--scroll" : ""].filter(Boolean).join(" "),
|
|
1332
1332
|
style: l,
|
|
1333
1333
|
children: /* @__PURE__ */ e.jsx(
|
|
1334
1334
|
"table",
|
|
1335
1335
|
{
|
|
1336
1336
|
className: ["ds-table", `ds-table--${t}`, a].filter(Boolean).join(" "),
|
|
1337
|
-
...
|
|
1337
|
+
...i,
|
|
1338
1338
|
children: s
|
|
1339
1339
|
}
|
|
1340
1340
|
)
|
|
@@ -1347,62 +1347,62 @@ function ft({ children: s, ...t }) {
|
|
|
1347
1347
|
function mt({ children: s, ...t }) {
|
|
1348
1348
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1349
1349
|
}
|
|
1350
|
-
function pt({ children: s, interactive: t, selected:
|
|
1350
|
+
function pt({ children: s, interactive: t, selected: r, subheader: o, exiting: a, updated: n, className: i = "", onClick: l, ...f }) {
|
|
1351
1351
|
return /* @__PURE__ */ e.jsx(
|
|
1352
1352
|
"tr",
|
|
1353
1353
|
{
|
|
1354
1354
|
className: [
|
|
1355
1355
|
"ds-table-row",
|
|
1356
1356
|
t || l ? "ds-table-row--interactive" : "",
|
|
1357
|
-
|
|
1358
|
-
|
|
1357
|
+
r ? "ds-table-row--selected" : "",
|
|
1358
|
+
o ? "ds-table-row--subheader" : "",
|
|
1359
1359
|
a ? "ds-table-row--exiting" : "",
|
|
1360
|
-
|
|
1361
|
-
|
|
1360
|
+
n ? "ds-table-row--updated" : "",
|
|
1361
|
+
i
|
|
1362
1362
|
].filter(Boolean).join(" "),
|
|
1363
1363
|
onClick: l,
|
|
1364
|
-
...
|
|
1364
|
+
...f,
|
|
1365
1365
|
children: s
|
|
1366
1366
|
}
|
|
1367
1367
|
);
|
|
1368
1368
|
}
|
|
1369
|
-
function ht({ children: s, colSpan: t = 999, ...
|
|
1370
|
-
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...
|
|
1369
|
+
function ht({ children: s, colSpan: t = 999, ...r }) {
|
|
1370
|
+
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1371
1371
|
}
|
|
1372
|
-
function xt({ children: s, align: t = "left", sortDir:
|
|
1373
|
-
const
|
|
1372
|
+
function xt({ children: s, align: t = "left", sortDir: r, onSort: o, width: a, className: n = "", style: i = {}, ...l }) {
|
|
1373
|
+
const f = !!o || r !== void 0, d = r === "asc" ? qe : r === "desc" ? he : Ke;
|
|
1374
1374
|
return /* @__PURE__ */ e.jsx(
|
|
1375
1375
|
"th",
|
|
1376
1376
|
{
|
|
1377
1377
|
className: [
|
|
1378
1378
|
"ds-th",
|
|
1379
|
-
|
|
1380
|
-
|
|
1379
|
+
f ? "ds-th--sortable" : "",
|
|
1380
|
+
r ? "ds-th--sorted" : "",
|
|
1381
1381
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1382
|
-
|
|
1382
|
+
n
|
|
1383
1383
|
].filter(Boolean).join(" "),
|
|
1384
|
-
onClick:
|
|
1385
|
-
style: { width: a, ...
|
|
1384
|
+
onClick: o,
|
|
1385
|
+
style: { width: a, ...i },
|
|
1386
1386
|
...l,
|
|
1387
|
-
children:
|
|
1387
|
+
children: f ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1388
1388
|
s,
|
|
1389
1389
|
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
|
|
1390
1390
|
] }) : s
|
|
1391
1391
|
}
|
|
1392
1392
|
);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function bt({ children: s, align: t = "left", secondary: r, muted: o, truncate: a, nowrap: n, className: i = "", ...l }) {
|
|
1395
1395
|
return /* @__PURE__ */ e.jsx(
|
|
1396
1396
|
"td",
|
|
1397
1397
|
{
|
|
1398
1398
|
className: [
|
|
1399
1399
|
"ds-td",
|
|
1400
1400
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1401
|
-
|
|
1402
|
-
|
|
1401
|
+
r ? "ds-table-cell--secondary" : "",
|
|
1402
|
+
o ? "ds-table-cell--muted" : "",
|
|
1403
1403
|
a ? "ds-table-cell--truncate" : "",
|
|
1404
|
-
|
|
1405
|
-
|
|
1404
|
+
n ? "ds-table-cell--nowrap" : "",
|
|
1405
|
+
i
|
|
1406
1406
|
].filter(Boolean).join(" "),
|
|
1407
1407
|
...l,
|
|
1408
1408
|
children: s
|
|
@@ -1412,74 +1412,74 @@ function _t({ children: s, align: t = "left", secondary: n, muted: i, truncate:
|
|
|
1412
1412
|
function jt({
|
|
1413
1413
|
icon: s,
|
|
1414
1414
|
title: t,
|
|
1415
|
-
description:
|
|
1416
|
-
action:
|
|
1415
|
+
description: r,
|
|
1416
|
+
action: o,
|
|
1417
1417
|
size: a = "m",
|
|
1418
|
-
className:
|
|
1419
|
-
...
|
|
1418
|
+
className: n = "",
|
|
1419
|
+
...i
|
|
1420
1420
|
}) {
|
|
1421
1421
|
return /* @__PURE__ */ e.jsxs(
|
|
1422
1422
|
"div",
|
|
1423
1423
|
{
|
|
1424
|
-
className: ["ds-empty-state", `ds-empty-state--${a}`,
|
|
1425
|
-
...
|
|
1424
|
+
className: ["ds-empty-state", `ds-empty-state--${a}`, n].filter(Boolean).join(" "),
|
|
1425
|
+
...i,
|
|
1426
1426
|
children: [
|
|
1427
1427
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1428
1428
|
/* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__title", children: t }),
|
|
1429
|
-
|
|
1430
|
-
|
|
1429
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__description", children: r }),
|
|
1430
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__action", children: o })
|
|
1431
1431
|
]
|
|
1432
1432
|
}
|
|
1433
1433
|
);
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function _t({
|
|
1436
1436
|
label: s,
|
|
1437
1437
|
hint: t,
|
|
1438
|
-
error:
|
|
1439
|
-
required:
|
|
1438
|
+
error: r,
|
|
1439
|
+
required: o = !1,
|
|
1440
1440
|
disabled: a = !1,
|
|
1441
|
-
htmlFor:
|
|
1442
|
-
children:
|
|
1441
|
+
htmlFor: n,
|
|
1442
|
+
children: i,
|
|
1443
1443
|
className: l = "",
|
|
1444
|
-
style:
|
|
1444
|
+
style: f,
|
|
1445
1445
|
...d
|
|
1446
1446
|
}) {
|
|
1447
|
-
const u = K.useId(), p =
|
|
1447
|
+
const u = K.useId(), p = n ?? u, h = `${p}-hint`, m = `${p}-error`;
|
|
1448
1448
|
return /* @__PURE__ */ e.jsxs(
|
|
1449
1449
|
"div",
|
|
1450
1450
|
{
|
|
1451
1451
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1452
|
-
"data-state":
|
|
1453
|
-
"data-required":
|
|
1452
|
+
"data-state": r ? "error" : void 0,
|
|
1453
|
+
"data-required": o ? "" : void 0,
|
|
1454
1454
|
"data-disabled": a ? "" : void 0,
|
|
1455
|
-
style:
|
|
1455
|
+
style: f,
|
|
1456
1456
|
...d,
|
|
1457
1457
|
children: [
|
|
1458
1458
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1459
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children:
|
|
1460
|
-
t && !
|
|
1461
|
-
|
|
1459
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
|
|
1460
|
+
t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1461
|
+
r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: m, role: "alert", children: r })
|
|
1462
1462
|
]
|
|
1463
1463
|
}
|
|
1464
1464
|
);
|
|
1465
1465
|
}
|
|
1466
|
-
function vt({ label: s, value: t, delta:
|
|
1467
|
-
const
|
|
1466
|
+
function vt({ label: s, value: t, delta: r, size: o = "m", inline: a = !1, className: n = "", style: i, ...l }) {
|
|
1467
|
+
const f = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
|
|
1468
1468
|
return /* @__PURE__ */ e.jsxs(
|
|
1469
1469
|
"div",
|
|
1470
1470
|
{
|
|
1471
1471
|
className: [
|
|
1472
1472
|
"ds-stat",
|
|
1473
|
-
`ds-stat--${
|
|
1473
|
+
`ds-stat--${o}`,
|
|
1474
1474
|
a && "ds-stat--inline",
|
|
1475
|
-
|
|
1475
|
+
n
|
|
1476
1476
|
].filter(Boolean).join(" "),
|
|
1477
|
-
style:
|
|
1477
|
+
style: i,
|
|
1478
1478
|
...l,
|
|
1479
1479
|
children: [
|
|
1480
1480
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1481
1481
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1482
|
-
|
|
1482
|
+
r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${f}`, children: r })
|
|
1483
1483
|
]
|
|
1484
1484
|
}
|
|
1485
1485
|
);
|
|
@@ -1487,61 +1487,61 @@ function vt({ label: s, value: t, delta: n, size: i = "m", inline: a = !1, class
|
|
|
1487
1487
|
function Nt({
|
|
1488
1488
|
children: s,
|
|
1489
1489
|
separator: t = "/",
|
|
1490
|
-
"aria-label":
|
|
1491
|
-
className:
|
|
1490
|
+
"aria-label": r = "Breadcrumb",
|
|
1491
|
+
className: o = "",
|
|
1492
1492
|
style: a,
|
|
1493
|
-
...
|
|
1493
|
+
...n
|
|
1494
1494
|
}) {
|
|
1495
|
-
const
|
|
1495
|
+
const i = K.Children.toArray(s).filter(Boolean);
|
|
1496
1496
|
return /* @__PURE__ */ e.jsx(
|
|
1497
1497
|
"nav",
|
|
1498
1498
|
{
|
|
1499
|
-
className: `ds-breadcrumb${
|
|
1500
|
-
"aria-label":
|
|
1499
|
+
className: `ds-breadcrumb${o ? ` ${o}` : ""}`,
|
|
1500
|
+
"aria-label": r,
|
|
1501
1501
|
style: a,
|
|
1502
|
-
...
|
|
1503
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children:
|
|
1502
|
+
...n,
|
|
1503
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l, f) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1504
1504
|
l,
|
|
1505
|
-
|
|
1506
|
-
] },
|
|
1505
|
+
f < i.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
1506
|
+
] }, f)) })
|
|
1507
1507
|
}
|
|
1508
1508
|
);
|
|
1509
1509
|
}
|
|
1510
1510
|
function wt({
|
|
1511
1511
|
page: s,
|
|
1512
1512
|
total: t,
|
|
1513
|
-
onChange:
|
|
1514
|
-
siblings:
|
|
1513
|
+
onChange: r,
|
|
1514
|
+
siblings: o = 1,
|
|
1515
1515
|
"aria-label": a = "Pagination",
|
|
1516
|
-
className:
|
|
1517
|
-
style:
|
|
1516
|
+
className: n = "",
|
|
1517
|
+
style: i,
|
|
1518
1518
|
...l
|
|
1519
1519
|
}) {
|
|
1520
|
-
const
|
|
1520
|
+
const f = vs(s, t, o);
|
|
1521
1521
|
return /* @__PURE__ */ e.jsxs(
|
|
1522
1522
|
"nav",
|
|
1523
1523
|
{
|
|
1524
|
-
className: `ds-pagination${
|
|
1524
|
+
className: `ds-pagination${n ? ` ${n}` : ""}`,
|
|
1525
1525
|
"aria-label": a,
|
|
1526
|
-
style:
|
|
1526
|
+
style: i,
|
|
1527
1527
|
...l,
|
|
1528
1528
|
children: [
|
|
1529
1529
|
/* @__PURE__ */ e.jsx(
|
|
1530
1530
|
"button",
|
|
1531
1531
|
{
|
|
1532
1532
|
className: "ds-pagination-arrow",
|
|
1533
|
-
onClick: () =>
|
|
1533
|
+
onClick: () => r == null ? void 0 : r(s - 1),
|
|
1534
1534
|
disabled: s <= 1,
|
|
1535
1535
|
"aria-label": "Previous page",
|
|
1536
1536
|
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1537
1537
|
}
|
|
1538
1538
|
),
|
|
1539
|
-
|
|
1539
|
+
f.map(
|
|
1540
1540
|
(d, u) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${u}`) : /* @__PURE__ */ e.jsx(
|
|
1541
1541
|
"button",
|
|
1542
1542
|
{
|
|
1543
1543
|
className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
|
|
1544
|
-
onClick: () => d !== s && (
|
|
1544
|
+
onClick: () => d !== s && (r == null ? void 0 : r(d)),
|
|
1545
1545
|
"aria-current": d === s ? "page" : void 0,
|
|
1546
1546
|
"aria-label": `Page ${d}`,
|
|
1547
1547
|
children: d
|
|
@@ -1553,7 +1553,7 @@ function wt({
|
|
|
1553
1553
|
"button",
|
|
1554
1554
|
{
|
|
1555
1555
|
className: "ds-pagination-arrow",
|
|
1556
|
-
onClick: () =>
|
|
1556
|
+
onClick: () => r == null ? void 0 : r(s + 1),
|
|
1557
1557
|
disabled: s >= t,
|
|
1558
1558
|
"aria-label": "Next page",
|
|
1559
1559
|
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
@@ -1563,37 +1563,37 @@ function wt({
|
|
|
1563
1563
|
}
|
|
1564
1564
|
);
|
|
1565
1565
|
}
|
|
1566
|
-
function vs(s, t,
|
|
1567
|
-
if (t <= 7) return Array.from({ length: t }, (
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1570
|
-
for (let
|
|
1571
|
-
return a < t - 1 &&
|
|
1566
|
+
function vs(s, t, r) {
|
|
1567
|
+
if (t <= 7) return Array.from({ length: t }, (i, l) => l + 1);
|
|
1568
|
+
const o = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
|
|
1569
|
+
o > 2 && n.push("…");
|
|
1570
|
+
for (let i = o; i <= a; i++) n.push(i);
|
|
1571
|
+
return a < t - 1 && n.push("…"), n.push(t), n;
|
|
1572
1572
|
}
|
|
1573
1573
|
const Ns = 200;
|
|
1574
1574
|
function gt({
|
|
1575
1575
|
children: s,
|
|
1576
1576
|
title: t,
|
|
1577
|
-
onClose:
|
|
1578
|
-
side:
|
|
1577
|
+
onClose: r,
|
|
1578
|
+
side: o = "right",
|
|
1579
1579
|
...a
|
|
1580
1580
|
}) {
|
|
1581
|
-
const
|
|
1582
|
-
!
|
|
1583
|
-
|
|
1581
|
+
const n = E(null), i = K.useId(), [l, f] = D(!1), d = () => {
|
|
1582
|
+
!r || l || (f(!0), setTimeout(() => {
|
|
1583
|
+
f(!1), r();
|
|
1584
1584
|
}, Ns));
|
|
1585
1585
|
};
|
|
1586
1586
|
M(() => {
|
|
1587
|
-
const
|
|
1587
|
+
const m = (j) => {
|
|
1588
1588
|
j.key === "Escape" && d();
|
|
1589
|
-
},
|
|
1590
|
-
|
|
1589
|
+
}, b = (j) => {
|
|
1590
|
+
n.current && !n.current.contains(j.target) && d();
|
|
1591
1591
|
};
|
|
1592
|
-
return document.addEventListener("keydown",
|
|
1593
|
-
document.removeEventListener("keydown",
|
|
1592
|
+
return document.addEventListener("keydown", m), document.addEventListener("mousedown", b), () => {
|
|
1593
|
+
document.removeEventListener("keydown", m), document.removeEventListener("mousedown", b);
|
|
1594
1594
|
};
|
|
1595
|
-
}, [
|
|
1596
|
-
const u = K.Children.toArray(s), p = u.find((
|
|
1595
|
+
}, [r, l]);
|
|
1596
|
+
const u = K.Children.toArray(s), p = u.find((m) => (m == null ? void 0 : m.type) === Be), h = u.filter((m) => (m == null ? void 0 : m.type) !== Be);
|
|
1597
1597
|
return /* @__PURE__ */ e.jsx(
|
|
1598
1598
|
"div",
|
|
1599
1599
|
{
|
|
@@ -1603,17 +1603,17 @@ function gt({
|
|
|
1603
1603
|
"aside",
|
|
1604
1604
|
{
|
|
1605
1605
|
className: ["ds-drawer", l && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1606
|
-
"data-side":
|
|
1607
|
-
ref:
|
|
1606
|
+
"data-side": o,
|
|
1607
|
+
ref: n,
|
|
1608
1608
|
role: "dialog",
|
|
1609
1609
|
"aria-modal": "true",
|
|
1610
|
-
"aria-labelledby": t ?
|
|
1610
|
+
"aria-labelledby": t ? i : void 0,
|
|
1611
1611
|
children: [
|
|
1612
1612
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1613
|
-
t && /* @__PURE__ */ e.jsx("h3", { id:
|
|
1614
|
-
|
|
1613
|
+
t && /* @__PURE__ */ e.jsx("h3", { id: i, className: "ds-drawer-title", children: t }),
|
|
1614
|
+
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 }) })
|
|
1615
1615
|
] }),
|
|
1616
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1616
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body ds-scrollable", children: h }),
|
|
1617
1617
|
p
|
|
1618
1618
|
]
|
|
1619
1619
|
}
|
|
@@ -1633,29 +1633,29 @@ const ws = {
|
|
|
1633
1633
|
function yt({
|
|
1634
1634
|
children: s,
|
|
1635
1635
|
variant: t = "info",
|
|
1636
|
-
action:
|
|
1637
|
-
onAction:
|
|
1636
|
+
action: r,
|
|
1637
|
+
onAction: o,
|
|
1638
1638
|
onDismiss: a,
|
|
1639
|
-
role:
|
|
1640
|
-
...
|
|
1639
|
+
role: n,
|
|
1640
|
+
...i
|
|
1641
1641
|
}) {
|
|
1642
|
-
const l = ws[t],
|
|
1642
|
+
const l = ws[t], f = n || (t === "error" ? "alert" : "status");
|
|
1643
1643
|
return /* @__PURE__ */ e.jsxs(
|
|
1644
1644
|
"div",
|
|
1645
1645
|
{
|
|
1646
1646
|
className: `ds-banner ds-banner--${t}`,
|
|
1647
|
-
role:
|
|
1648
|
-
...
|
|
1647
|
+
role: f,
|
|
1648
|
+
...i,
|
|
1649
1649
|
children: [
|
|
1650
1650
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
1651
1651
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1652
|
-
|
|
1652
|
+
r && /* @__PURE__ */ e.jsx(
|
|
1653
1653
|
"button",
|
|
1654
1654
|
{
|
|
1655
1655
|
type: "button",
|
|
1656
1656
|
className: "ds-banner-action",
|
|
1657
|
-
onClick:
|
|
1658
|
-
children:
|
|
1657
|
+
onClick: o,
|
|
1658
|
+
children: r
|
|
1659
1659
|
}
|
|
1660
1660
|
),
|
|
1661
1661
|
a && /* @__PURE__ */ e.jsx(
|
|
@@ -1665,7 +1665,7 @@ function yt({
|
|
|
1665
1665
|
className: "ds-banner-dismiss",
|
|
1666
1666
|
onClick: a,
|
|
1667
1667
|
"aria-label": "Dismiss",
|
|
1668
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1668
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[2], strokeWidth: 1.5 })
|
|
1669
1669
|
}
|
|
1670
1670
|
)
|
|
1671
1671
|
]
|
|
@@ -1675,16 +1675,16 @@ function yt({
|
|
|
1675
1675
|
function kt({
|
|
1676
1676
|
trigger: s,
|
|
1677
1677
|
items: t = [],
|
|
1678
|
-
open:
|
|
1679
|
-
onOpenChange:
|
|
1678
|
+
open: r,
|
|
1679
|
+
onOpenChange: o,
|
|
1680
1680
|
align: a = "left",
|
|
1681
|
-
className:
|
|
1682
|
-
style:
|
|
1681
|
+
className: n = "",
|
|
1682
|
+
style: i,
|
|
1683
1683
|
...l
|
|
1684
1684
|
}) {
|
|
1685
|
-
const [
|
|
1685
|
+
const [f, d] = D(!1), [u, p] = D(!1), h = r !== void 0, m = h ? r : f, b = E(null), j = E(null), R = E(null), $ = E(null), [B, y] = D({}), T = E(null), z = 150, A = () => {
|
|
1686
1686
|
if (h)
|
|
1687
|
-
|
|
1687
|
+
o == null || o(!1);
|
|
1688
1688
|
else {
|
|
1689
1689
|
if (u) return;
|
|
1690
1690
|
p(!0), T.current = setTimeout(() => {
|
|
@@ -1692,16 +1692,16 @@ function kt({
|
|
|
1692
1692
|
}, z);
|
|
1693
1693
|
}
|
|
1694
1694
|
}, Y = () => {
|
|
1695
|
-
const x = !
|
|
1696
|
-
h ?
|
|
1695
|
+
const x = !m;
|
|
1696
|
+
h ? o == null || o(x) : x ? (clearTimeout(T.current), p(!1), d(!0)) : A();
|
|
1697
1697
|
}, H = () => {
|
|
1698
|
-
|
|
1698
|
+
m || (h ? o == null || o(!0) : (clearTimeout(T.current), p(!1), d(!0)));
|
|
1699
1699
|
};
|
|
1700
1700
|
M(() => () => clearTimeout(T.current), []), M(() => {
|
|
1701
|
-
if (!
|
|
1701
|
+
if (!m) return;
|
|
1702
1702
|
const x = 300, N = () => {
|
|
1703
1703
|
var G;
|
|
1704
|
-
const k = (G =
|
|
1704
|
+
const k = (G = b.current) == null ? void 0 : G.getBoundingClientRect();
|
|
1705
1705
|
if (!k) return;
|
|
1706
1706
|
const P = window.innerHeight - k.bottom, q = P < x + 8 && k.top > P;
|
|
1707
1707
|
y(
|
|
@@ -1711,7 +1711,7 @@ function kt({
|
|
|
1711
1711
|
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
1712
1712
|
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
1713
1713
|
};
|
|
1714
|
-
}, [
|
|
1714
|
+
}, [m, a]);
|
|
1715
1715
|
const F = () => {
|
|
1716
1716
|
var N;
|
|
1717
1717
|
const x = (N = R.current) == null ? void 0 : N.querySelector(
|
|
@@ -1720,29 +1720,29 @@ function kt({
|
|
|
1720
1720
|
x == null || x.focus();
|
|
1721
1721
|
};
|
|
1722
1722
|
M(() => {
|
|
1723
|
-
if (!
|
|
1723
|
+
if (!m) return;
|
|
1724
1724
|
const x = (k) => {
|
|
1725
1725
|
var P, q;
|
|
1726
|
-
!((P =
|
|
1726
|
+
!((P = b.current) != null && P.contains(k.target)) && !((q = j.current) != null && q.contains(k.target)) && A();
|
|
1727
1727
|
}, N = (k) => {
|
|
1728
1728
|
k.key === "Escape" && (A(), F());
|
|
1729
1729
|
};
|
|
1730
1730
|
return document.addEventListener("mousedown", x), document.addEventListener("keydown", N), () => {
|
|
1731
1731
|
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", N);
|
|
1732
1732
|
};
|
|
1733
|
-
}, [
|
|
1734
|
-
if (!
|
|
1733
|
+
}, [m]), M(() => {
|
|
1734
|
+
if (!m || !$.current || !j.current) return;
|
|
1735
1735
|
const x = v(), N = $.current === "last" ? x[x.length - 1] : x[0];
|
|
1736
1736
|
N == null || N.focus(), $.current = null;
|
|
1737
|
-
}, [
|
|
1737
|
+
}, [m]);
|
|
1738
1738
|
const v = () => j.current ? [...j.current.querySelectorAll(
|
|
1739
1739
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1740
1740
|
)] : [], C = (x) => {
|
|
1741
1741
|
var N, k;
|
|
1742
1742
|
if (x.key === "ArrowDown")
|
|
1743
|
-
x.preventDefault(),
|
|
1743
|
+
x.preventDefault(), m ? (N = v()[0]) == null || N.focus() : ($.current = "first", H());
|
|
1744
1744
|
else if (x.key === "ArrowUp")
|
|
1745
|
-
if (x.preventDefault(), !
|
|
1745
|
+
if (x.preventDefault(), !m)
|
|
1746
1746
|
$.current = "last", H();
|
|
1747
1747
|
else {
|
|
1748
1748
|
const P = v();
|
|
@@ -1768,7 +1768,7 @@ function kt({
|
|
|
1768
1768
|
A();
|
|
1769
1769
|
break;
|
|
1770
1770
|
}
|
|
1771
|
-
}, U =
|
|
1771
|
+
}, U = m && /* @__PURE__ */ e.jsx(
|
|
1772
1772
|
"div",
|
|
1773
1773
|
{
|
|
1774
1774
|
ref: j,
|
|
@@ -1816,9 +1816,9 @@ function kt({
|
|
|
1816
1816
|
return /* @__PURE__ */ e.jsxs(
|
|
1817
1817
|
"div",
|
|
1818
1818
|
{
|
|
1819
|
-
ref:
|
|
1820
|
-
className: ["ds-dropdown",
|
|
1821
|
-
style:
|
|
1819
|
+
ref: b,
|
|
1820
|
+
className: ["ds-dropdown", n].filter(Boolean).join(" "),
|
|
1821
|
+
style: i,
|
|
1822
1822
|
...l,
|
|
1823
1823
|
children: [
|
|
1824
1824
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1839,34 +1839,34 @@ function kt({
|
|
|
1839
1839
|
function Et({
|
|
1840
1840
|
value: s = 0,
|
|
1841
1841
|
size: t = "m",
|
|
1842
|
-
variant:
|
|
1843
|
-
showValue:
|
|
1842
|
+
variant: r = "default",
|
|
1843
|
+
showValue: o = !1,
|
|
1844
1844
|
min: a = 2,
|
|
1845
|
-
animate:
|
|
1845
|
+
animate: n = !0
|
|
1846
1846
|
}) {
|
|
1847
|
-
const
|
|
1847
|
+
const i = Math.min(100, Math.max(0, s)), l = Math.max(a, i), f = r === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : r;
|
|
1848
1848
|
return /* @__PURE__ */ e.jsxs(
|
|
1849
1849
|
"div",
|
|
1850
1850
|
{
|
|
1851
1851
|
className: [
|
|
1852
1852
|
"ds-progress",
|
|
1853
1853
|
`ds-progress--${t}`,
|
|
1854
|
-
!
|
|
1854
|
+
!n && "ds-progress--instant"
|
|
1855
1855
|
].filter(Boolean).join(" "),
|
|
1856
1856
|
role: "progressbar",
|
|
1857
|
-
"aria-valuenow":
|
|
1857
|
+
"aria-valuenow": i,
|
|
1858
1858
|
"aria-valuemin": 0,
|
|
1859
1859
|
"aria-valuemax": 100,
|
|
1860
1860
|
children: [
|
|
1861
1861
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
1862
1862
|
"div",
|
|
1863
1863
|
{
|
|
1864
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
1864
|
+
className: `ds-progress__fill ds-progress__fill--${f}`,
|
|
1865
1865
|
style: { width: `${l}%` }
|
|
1866
1866
|
}
|
|
1867
1867
|
) }),
|
|
1868
|
-
|
|
1869
|
-
Math.round(
|
|
1868
|
+
o && /* @__PURE__ */ e.jsxs("span", { className: "ds-progress__value", children: [
|
|
1869
|
+
Math.round(i),
|
|
1870
1870
|
"%"
|
|
1871
1871
|
] })
|
|
1872
1872
|
]
|
|
@@ -1875,61 +1875,61 @@ function Et({
|
|
|
1875
1875
|
}
|
|
1876
1876
|
const gs = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1877
1877
|
function ks(s, { duration: t = 600 } = {}) {
|
|
1878
|
-
const [
|
|
1878
|
+
const [r, o] = D(s), a = E(s), n = E(null);
|
|
1879
1879
|
return M(() => {
|
|
1880
1880
|
if (ys()) {
|
|
1881
|
-
|
|
1881
|
+
o(s), a.current = s;
|
|
1882
1882
|
return;
|
|
1883
1883
|
}
|
|
1884
|
-
const
|
|
1884
|
+
const i = a.current, l = s - i;
|
|
1885
1885
|
if (l === 0) return;
|
|
1886
|
-
let
|
|
1886
|
+
let f = null;
|
|
1887
1887
|
const d = (u) => {
|
|
1888
|
-
|
|
1889
|
-
const p = Math.min((u -
|
|
1890
|
-
i
|
|
1888
|
+
f || (f = u);
|
|
1889
|
+
const p = Math.min((u - f) / t, 1);
|
|
1890
|
+
o(i + l * gs(p)), p < 1 ? n.current = requestAnimationFrame(d) : a.current = s;
|
|
1891
1891
|
};
|
|
1892
|
-
return
|
|
1893
|
-
}, [s, t]),
|
|
1892
|
+
return n.current = requestAnimationFrame(d), () => cancelAnimationFrame(n.current);
|
|
1893
|
+
}, [s, t]), r;
|
|
1894
1894
|
}
|
|
1895
1895
|
function $t({
|
|
1896
1896
|
value: s,
|
|
1897
1897
|
duration: t = 600,
|
|
1898
|
-
decimals:
|
|
1899
|
-
prefix:
|
|
1898
|
+
decimals: r = 0,
|
|
1899
|
+
prefix: o = "",
|
|
1900
1900
|
suffix: a = ""
|
|
1901
1901
|
}) {
|
|
1902
|
-
const
|
|
1903
|
-
return `${
|
|
1902
|
+
const i = ks(s, { duration: t }).toFixed(r);
|
|
1903
|
+
return `${o}${i}${a}`;
|
|
1904
1904
|
}
|
|
1905
|
-
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once:
|
|
1906
|
-
const
|
|
1905
|
+
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
1906
|
+
const o = E(null), [a, n] = D(!1);
|
|
1907
1907
|
return M(() => {
|
|
1908
|
-
const
|
|
1909
|
-
if (!
|
|
1908
|
+
const i = o.current;
|
|
1909
|
+
if (!i) return;
|
|
1910
1910
|
const l = new IntersectionObserver(
|
|
1911
|
-
([
|
|
1912
|
-
|
|
1911
|
+
([f]) => {
|
|
1912
|
+
f.isIntersecting ? (n(!0), r && l.disconnect()) : r || n(!1);
|
|
1913
1913
|
},
|
|
1914
1914
|
{ threshold: s, rootMargin: t }
|
|
1915
1915
|
);
|
|
1916
|
-
return l.observe(
|
|
1917
|
-
}, [s, t,
|
|
1916
|
+
return l.observe(i), () => l.disconnect();
|
|
1917
|
+
}, [s, t, r]), { ref: o, inView: a };
|
|
1918
1918
|
}
|
|
1919
1919
|
function Tt({
|
|
1920
1920
|
children: s,
|
|
1921
1921
|
as: t = "div",
|
|
1922
|
-
once:
|
|
1923
|
-
threshold:
|
|
1922
|
+
once: r = !1,
|
|
1923
|
+
threshold: o = 0.1,
|
|
1924
1924
|
rootMargin: a = "0px",
|
|
1925
|
-
onEnter:
|
|
1926
|
-
onLeave:
|
|
1925
|
+
onEnter: n,
|
|
1926
|
+
onLeave: i,
|
|
1927
1927
|
...l
|
|
1928
1928
|
}) {
|
|
1929
|
-
const { ref:
|
|
1929
|
+
const { ref: f, inView: d } = Es({ threshold: o, rootMargin: a, once: r }), u = E(!1);
|
|
1930
1930
|
return M(() => {
|
|
1931
|
-
d && !u.current && (
|
|
1932
|
-
}, [d]), /* @__PURE__ */ e.jsx(t, { ref:
|
|
1931
|
+
d && !u.current && (n == null || n()), !d && u.current && (i == null || i()), u.current = d;
|
|
1932
|
+
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: f, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1933
1933
|
}
|
|
1934
1934
|
const Me = {
|
|
1935
1935
|
default: ke,
|
|
@@ -1938,9 +1938,9 @@ const Me = {
|
|
|
1938
1938
|
error: we
|
|
1939
1939
|
};
|
|
1940
1940
|
let de = [];
|
|
1941
|
-
const
|
|
1941
|
+
const _e = /* @__PURE__ */ new Set();
|
|
1942
1942
|
function We() {
|
|
1943
|
-
|
|
1943
|
+
_e.forEach((s) => s([...de]));
|
|
1944
1944
|
}
|
|
1945
1945
|
function $s(s) {
|
|
1946
1946
|
de = [...de, s], We();
|
|
@@ -1949,44 +1949,44 @@ function Ts(s) {
|
|
|
1949
1949
|
de = de.filter((t) => t.id !== s), We();
|
|
1950
1950
|
}
|
|
1951
1951
|
function Rt() {
|
|
1952
|
-
const s = (t,
|
|
1952
|
+
const s = (t, r = {}) => {
|
|
1953
1953
|
$s({
|
|
1954
1954
|
id: `${Date.now()}-${Math.random()}`,
|
|
1955
1955
|
message: t,
|
|
1956
1956
|
type: "default",
|
|
1957
1957
|
duration: 4e3,
|
|
1958
|
-
...
|
|
1958
|
+
...r
|
|
1959
1959
|
});
|
|
1960
1960
|
};
|
|
1961
|
-
return s.success = (t,
|
|
1961
|
+
return s.success = (t, r) => s(t, { ...r, type: "success" }), s.error = (t, r) => s(t, { ...r, type: "error" }), s.warning = (t, r) => s(t, { ...r, type: "warning" }), { toast: s };
|
|
1962
1962
|
}
|
|
1963
1963
|
function Rs({ data: s, onDismiss: t }) {
|
|
1964
|
-
const [
|
|
1965
|
-
M(() => (requestAnimationFrame(() =>
|
|
1966
|
-
function
|
|
1967
|
-
|
|
1964
|
+
const [r, o] = D(!1), a = E(null);
|
|
1965
|
+
M(() => (requestAnimationFrame(() => o(!0)), s.duration > 0 && (a.current = setTimeout(() => n(), s.duration)), () => clearTimeout(a.current)), []);
|
|
1966
|
+
function n() {
|
|
1967
|
+
o(!1), setTimeout(() => t(s.id), 250);
|
|
1968
1968
|
}
|
|
1969
|
-
const
|
|
1969
|
+
const i = Me[s.type] ?? Me.default;
|
|
1970
1970
|
return /* @__PURE__ */ e.jsxs(
|
|
1971
1971
|
"div",
|
|
1972
1972
|
{
|
|
1973
1973
|
className: [
|
|
1974
1974
|
"ds-toast",
|
|
1975
1975
|
`ds-toast--${s.type}`,
|
|
1976
|
-
|
|
1976
|
+
r && "ds-toast--visible"
|
|
1977
1977
|
].filter(Boolean).join(" "),
|
|
1978
1978
|
role: s.type === "error" ? "alert" : "status",
|
|
1979
1979
|
"aria-live": "polite",
|
|
1980
1980
|
children: [
|
|
1981
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(
|
|
1981
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(i, { size: I[3], strokeWidth: 1.5 }) }),
|
|
1982
1982
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: s.message }),
|
|
1983
1983
|
/* @__PURE__ */ e.jsx(
|
|
1984
1984
|
"button",
|
|
1985
1985
|
{
|
|
1986
1986
|
className: "ds-toast__close",
|
|
1987
|
-
onClick:
|
|
1987
|
+
onClick: n,
|
|
1988
1988
|
"aria-label": "Закрыть",
|
|
1989
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1989
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[3], strokeWidth: 1.5 })
|
|
1990
1990
|
}
|
|
1991
1991
|
)
|
|
1992
1992
|
]
|
|
@@ -1994,9 +1994,9 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1994
1994
|
);
|
|
1995
1995
|
}
|
|
1996
1996
|
function St({ position: s = "bottom-right" }) {
|
|
1997
|
-
const [t,
|
|
1998
|
-
return M(() => (
|
|
1999
|
-
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((
|
|
1997
|
+
const [t, r] = D(() => [...de]);
|
|
1998
|
+
return M(() => (_e.add(r), () => _e.delete(r)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
1999
|
+
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((o) => /* @__PURE__ */ e.jsx(Rs, { data: o, onDismiss: Ts }, o.id)) }),
|
|
2000
2000
|
document.body
|
|
2001
2001
|
);
|
|
2002
2002
|
}
|
|
@@ -2008,25 +2008,25 @@ const Ss = {
|
|
|
2008
2008
|
function Dt({
|
|
2009
2009
|
label: s,
|
|
2010
2010
|
status: t = "idle",
|
|
2011
|
-
icon:
|
|
2012
|
-
badge:
|
|
2011
|
+
icon: r,
|
|
2012
|
+
badge: o,
|
|
2013
2013
|
defaultExpanded: a = !1,
|
|
2014
|
-
expanded:
|
|
2015
|
-
onToggle:
|
|
2014
|
+
expanded: n,
|
|
2015
|
+
onToggle: i,
|
|
2016
2016
|
children: l,
|
|
2017
|
-
className:
|
|
2017
|
+
className: f = "",
|
|
2018
2018
|
...d
|
|
2019
2019
|
}) {
|
|
2020
2020
|
const u = t === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2021
|
-
|
|
2021
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
|
|
2022
2022
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2023
2023
|
Ss[t],
|
|
2024
|
-
|
|
2024
|
+
o
|
|
2025
2025
|
] });
|
|
2026
2026
|
return l ? /* @__PURE__ */ e.jsx(
|
|
2027
2027
|
"div",
|
|
2028
2028
|
{
|
|
2029
|
-
className: ["ds-tool-card", u && "ds-tool-card--running",
|
|
2029
|
+
className: ["ds-tool-card", u && "ds-tool-card--running", f].filter(Boolean).join(" "),
|
|
2030
2030
|
...d,
|
|
2031
2031
|
children: /* @__PURE__ */ e.jsx(
|
|
2032
2032
|
Ee,
|
|
@@ -2034,8 +2034,8 @@ function Dt({
|
|
|
2034
2034
|
title: p,
|
|
2035
2035
|
padding: "s",
|
|
2036
2036
|
defaultExpanded: a,
|
|
2037
|
-
expanded: u ? !1 :
|
|
2038
|
-
onToggle: u ? void 0 :
|
|
2037
|
+
expanded: u ? !1 : n,
|
|
2038
|
+
onToggle: u ? void 0 : i,
|
|
2039
2039
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2040
2040
|
}
|
|
2041
2041
|
)
|
|
@@ -2043,7 +2043,7 @@ function Dt({
|
|
|
2043
2043
|
) : /* @__PURE__ */ e.jsx(
|
|
2044
2044
|
"div",
|
|
2045
2045
|
{
|
|
2046
|
-
className: ["ds-tool-card", "ds-tool-card--bubble",
|
|
2046
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", f].filter(Boolean).join(" "),
|
|
2047
2047
|
...d,
|
|
2048
2048
|
children: p
|
|
2049
2049
|
}
|
|
@@ -2052,13 +2052,13 @@ function Dt({
|
|
|
2052
2052
|
function Ds({
|
|
2053
2053
|
text: s,
|
|
2054
2054
|
size: t = "xs",
|
|
2055
|
-
timeout:
|
|
2056
|
-
"aria-label":
|
|
2055
|
+
timeout: r = 800,
|
|
2056
|
+
"aria-label": o = "Copy to clipboard",
|
|
2057
2057
|
...a
|
|
2058
2058
|
}) {
|
|
2059
|
-
const [
|
|
2060
|
-
|
|
2061
|
-
|
|
2059
|
+
const [n, i] = D(!1), l = (f) => {
|
|
2060
|
+
f.currentTarget.blur(), navigator.clipboard.writeText(s).then(() => {
|
|
2061
|
+
i(!0), setTimeout(() => i(!1), r);
|
|
2062
2062
|
});
|
|
2063
2063
|
};
|
|
2064
2064
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -2066,29 +2066,29 @@ function Ds({
|
|
|
2066
2066
|
{
|
|
2067
2067
|
variant: "ghost",
|
|
2068
2068
|
size: t,
|
|
2069
|
-
state:
|
|
2069
|
+
state: n ? "success" : "idle",
|
|
2070
2070
|
icon: /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
|
|
2071
|
-
"aria-label":
|
|
2071
|
+
"aria-label": o,
|
|
2072
2072
|
onClick: l,
|
|
2073
2073
|
...a
|
|
2074
2074
|
}
|
|
2075
2075
|
);
|
|
2076
2076
|
}
|
|
2077
|
-
function At({ content: s, streaming: t = !1, ...
|
|
2078
|
-
const [
|
|
2077
|
+
function At({ content: s, streaming: t = !1, ...r }) {
|
|
2078
|
+
const [o, a] = D(t);
|
|
2079
2079
|
return M(() => {
|
|
2080
2080
|
a(!!t);
|
|
2081
2081
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
2082
2082
|
Ee,
|
|
2083
2083
|
{
|
|
2084
|
-
expanded:
|
|
2084
|
+
expanded: o,
|
|
2085
2085
|
onToggle: a,
|
|
2086
2086
|
padding: "s",
|
|
2087
2087
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2088
2088
|
/* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2089
2089
|
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2090
2090
|
] }),
|
|
2091
|
-
...
|
|
2091
|
+
...r,
|
|
2092
2092
|
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2093
2093
|
s,
|
|
2094
2094
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
@@ -2099,16 +2099,16 @@ function At({ content: s, streaming: t = !1, ...n }) {
|
|
|
2099
2099
|
function It({
|
|
2100
2100
|
count: s,
|
|
2101
2101
|
current: t = 0,
|
|
2102
|
-
done:
|
|
2103
|
-
onChange:
|
|
2102
|
+
done: r = [],
|
|
2103
|
+
onChange: o,
|
|
2104
2104
|
showCounter: a = !0,
|
|
2105
|
-
className:
|
|
2106
|
-
"aria-label":
|
|
2105
|
+
className: n = "",
|
|
2106
|
+
"aria-label": i = "Steps",
|
|
2107
2107
|
...l
|
|
2108
2108
|
}) {
|
|
2109
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2110
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label":
|
|
2111
|
-
const u = d === t, p =
|
|
2109
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
|
|
2110
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: s }, (f, d) => {
|
|
2111
|
+
const u = d === t, p = r.includes(d) && !u, h = o && (d <= t || r.includes(d)), m = [
|
|
2112
2112
|
"ds-step-indicator__dot",
|
|
2113
2113
|
u && "ds-step-indicator__dot--active",
|
|
2114
2114
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2117,12 +2117,12 @@ function It({
|
|
|
2117
2117
|
"button",
|
|
2118
2118
|
{
|
|
2119
2119
|
type: "button",
|
|
2120
|
-
className:
|
|
2120
|
+
className: m,
|
|
2121
2121
|
role: "tab",
|
|
2122
2122
|
"aria-selected": u,
|
|
2123
2123
|
"aria-label": `Step ${d + 1}`,
|
|
2124
2124
|
disabled: !h || d === t,
|
|
2125
|
-
onClick: () =>
|
|
2125
|
+
onClick: () => o == null ? void 0 : o(d),
|
|
2126
2126
|
children: p ? /* @__PURE__ */ e.jsx(Ne, { size: 8, strokeWidth: 3 }) : null
|
|
2127
2127
|
},
|
|
2128
2128
|
d
|
|
@@ -2138,115 +2138,115 @@ function It({
|
|
|
2138
2138
|
function Bt({
|
|
2139
2139
|
content: s,
|
|
2140
2140
|
isStreaming: t = !1,
|
|
2141
|
-
cursor:
|
|
2142
|
-
onChunk:
|
|
2141
|
+
cursor: r = "line",
|
|
2142
|
+
onChunk: o,
|
|
2143
2143
|
className: a = "",
|
|
2144
|
-
...
|
|
2144
|
+
...n
|
|
2145
2145
|
}) {
|
|
2146
|
-
const
|
|
2146
|
+
const i = E(s);
|
|
2147
2147
|
return M(() => {
|
|
2148
|
-
s !==
|
|
2149
|
-
}, [s,
|
|
2148
|
+
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(" "), ...n, children: [
|
|
2150
2150
|
s,
|
|
2151
|
-
t &&
|
|
2151
|
+
t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
|
|
2152
2152
|
] });
|
|
2153
2153
|
}
|
|
2154
2154
|
function Mt({
|
|
2155
2155
|
role: s = "assistant",
|
|
2156
2156
|
header: t,
|
|
2157
|
-
footer:
|
|
2158
|
-
attachments:
|
|
2157
|
+
footer: r,
|
|
2158
|
+
attachments: o,
|
|
2159
2159
|
isStreaming: a = !1,
|
|
2160
|
-
children:
|
|
2161
|
-
className:
|
|
2160
|
+
children: n,
|
|
2161
|
+
className: i = "",
|
|
2162
2162
|
...l
|
|
2163
2163
|
}) {
|
|
2164
|
-
const
|
|
2164
|
+
const f = [
|
|
2165
2165
|
"ds-chat-message",
|
|
2166
2166
|
`ds-chat-message--${s}`,
|
|
2167
2167
|
a && "ds-chat-message--streaming",
|
|
2168
|
-
|
|
2168
|
+
i
|
|
2169
2169
|
].filter(Boolean).join(" ");
|
|
2170
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2171
|
-
|
|
2172
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2173
|
-
|
|
2174
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2170
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: f, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: n }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: f, ...l, children: [
|
|
2171
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: o }),
|
|
2172
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: n }),
|
|
2173
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2174
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: f, ...l, children: [
|
|
2175
2175
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2176
|
-
|
|
2177
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2178
|
-
|
|
2176
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: o }),
|
|
2177
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: n }),
|
|
2178
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2179
2179
|
] });
|
|
2180
2180
|
}
|
|
2181
|
-
function Pt(s, { containerRef: t, smartPause:
|
|
2182
|
-
const
|
|
2181
|
+
function Pt(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
2182
|
+
const o = E(!1), a = E(0);
|
|
2183
2183
|
M(() => {
|
|
2184
|
-
const
|
|
2185
|
-
if (!
|
|
2186
|
-
const
|
|
2187
|
-
const l =
|
|
2188
|
-
!l &&
|
|
2184
|
+
const n = t == null ? void 0 : t.current;
|
|
2185
|
+
if (!n) return;
|
|
2186
|
+
const i = () => {
|
|
2187
|
+
const l = n.scrollHeight - n.scrollTop - n.clientHeight < 64;
|
|
2188
|
+
!l && n.scrollTop < a.current && (o.current = !0), l && (o.current = !1), a.current = n.scrollTop;
|
|
2189
2189
|
};
|
|
2190
|
-
return
|
|
2190
|
+
return n.addEventListener("scroll", i, { passive: !0 }), () => n.removeEventListener("scroll", i);
|
|
2191
2191
|
}, [t]), M(() => {
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2192
|
+
const n = t == null ? void 0 : t.current;
|
|
2193
|
+
n && (r && o.current || (n.scrollTop = n.scrollHeight));
|
|
2194
2194
|
}, s);
|
|
2195
2195
|
}
|
|
2196
2196
|
function As({
|
|
2197
2197
|
prompts: s,
|
|
2198
2198
|
enabled: t,
|
|
2199
|
-
typingSpeed:
|
|
2200
|
-
erasingSpeed:
|
|
2199
|
+
typingSpeed: r = 38,
|
|
2200
|
+
erasingSpeed: o = 18,
|
|
2201
2201
|
holdTime: a = 2200,
|
|
2202
|
-
betweenTime:
|
|
2203
|
-
manualPauseMs:
|
|
2202
|
+
betweenTime: n = 380,
|
|
2203
|
+
manualPauseMs: i = 5e3
|
|
2204
2204
|
}) {
|
|
2205
|
-
const [l,
|
|
2205
|
+
const [l, f] = D(0), [d, u] = D(""), p = E("typing"), h = E(0), m = E(0), b = E(null), j = E(0);
|
|
2206
2206
|
M(() => {
|
|
2207
|
-
|
|
2207
|
+
m.current = l;
|
|
2208
2208
|
}, [l]), M(() => {
|
|
2209
|
-
if (
|
|
2209
|
+
if (b.current && (clearTimeout(b.current), b.current = null), !t || s.length === 0) {
|
|
2210
2210
|
u(""), h.current = 0, p.current = "typing";
|
|
2211
2211
|
return;
|
|
2212
2212
|
}
|
|
2213
2213
|
const T = () => {
|
|
2214
2214
|
const z = Date.now();
|
|
2215
2215
|
if (j.current > z) {
|
|
2216
|
-
|
|
2216
|
+
b.current = setTimeout(T, j.current - z);
|
|
2217
2217
|
return;
|
|
2218
2218
|
}
|
|
2219
|
-
const A = s[
|
|
2220
|
-
p.current === "typing" ? (h.current += 1, u(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding",
|
|
2219
|
+
const A = s[m.current % s.length] ?? "";
|
|
2220
|
+
p.current === "typing" ? (h.current += 1, u(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", b.current = setTimeout(T, a)) : b.current = setTimeout(T, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", b.current = setTimeout(T, o)) : (h.current = Math.max(0, h.current - 1), u(A.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", m.current = (m.current + 1) % s.length, f(m.current), b.current = setTimeout(T, n)) : b.current = setTimeout(T, o));
|
|
2221
2221
|
};
|
|
2222
|
-
return
|
|
2223
|
-
|
|
2222
|
+
return b.current = setTimeout(T, 260), () => {
|
|
2223
|
+
b.current && clearTimeout(b.current);
|
|
2224
2224
|
};
|
|
2225
|
-
}, [t, s,
|
|
2225
|
+
}, [t, s, r, o, a, n]);
|
|
2226
2226
|
const R = (T) => {
|
|
2227
2227
|
if (s.length === 0) return;
|
|
2228
2228
|
const z = (T % s.length + s.length) % s.length, A = s[z];
|
|
2229
|
-
|
|
2230
|
-
}, $ = () => R(
|
|
2229
|
+
m.current = z, h.current = A.length, p.current = "holding", j.current = Date.now() + i, f(z), u(A);
|
|
2230
|
+
}, $ = () => R(m.current + 1), B = () => R(m.current - 1), y = s[l % s.length] ?? "";
|
|
2231
2231
|
return { displayed: d, currentPrompt: y, index: l, next: $, prev: B };
|
|
2232
2232
|
}
|
|
2233
2233
|
let Is = 0;
|
|
2234
2234
|
function Lt({
|
|
2235
2235
|
value: s = "",
|
|
2236
2236
|
onChange: t,
|
|
2237
|
-
onSubmit:
|
|
2238
|
-
onStop:
|
|
2237
|
+
onSubmit: r,
|
|
2238
|
+
onStop: o,
|
|
2239
2239
|
onKeyDown: a,
|
|
2240
|
-
loading:
|
|
2241
|
-
disabled:
|
|
2240
|
+
loading: n = !1,
|
|
2241
|
+
disabled: i = !1,
|
|
2242
2242
|
placeholder: l = "Let's get things done...",
|
|
2243
|
-
animatedPlaceholders:
|
|
2243
|
+
animatedPlaceholders: f,
|
|
2244
2244
|
attachments: d,
|
|
2245
2245
|
images: u,
|
|
2246
2246
|
onAttachFiles: p,
|
|
2247
2247
|
onAttachImages: h,
|
|
2248
|
-
onRemoveAttachment:
|
|
2249
|
-
onRemoveImage:
|
|
2248
|
+
onRemoveAttachment: m,
|
|
2249
|
+
onRemoveImage: b,
|
|
2250
2250
|
acceptImage: j,
|
|
2251
2251
|
acceptFile: R,
|
|
2252
2252
|
maxImages: $,
|
|
@@ -2256,48 +2256,48 @@ function Lt({
|
|
|
2256
2256
|
className: z = "",
|
|
2257
2257
|
...A
|
|
2258
2258
|
}) {
|
|
2259
|
-
const Y = E(null), H = E(null), F = E(0), [v, C] = D(!1), [X, U] = D([]), x = (
|
|
2259
|
+
const Y = E(null), H = E(null), F = E(0), [v, C] = D(!1), [X, U] = D([]), x = (_) => {
|
|
2260
2260
|
const S = ++Is;
|
|
2261
|
-
U((V) => [...V, { id: S, msg:
|
|
2262
|
-
}, N = (
|
|
2261
|
+
U((V) => [...V, { id: S, msg: _ }]), setTimeout(() => U((V) => V.filter((J) => J.id !== S)), 6e3);
|
|
2262
|
+
}, N = (_) => U((S) => S.filter((V) => V.id !== _)), k = (_) => _.type.startsWith("image/"), P = () => !0, q = j ?? k, G = R ?? P, g = (_) => {
|
|
2263
2263
|
const S = [], V = [], J = [], Z = [];
|
|
2264
|
-
let ee = 0,
|
|
2265
|
-
for (const se of
|
|
2266
|
-
q(se) ? B && se.size > B ? J.push(se.name) :
|
|
2264
|
+
let ee = 0, ie = $ != null ? $ - ((u == null ? void 0 : u.length) ?? 0) : 1 / 0;
|
|
2265
|
+
for (const se of _)
|
|
2266
|
+
q(se) ? B && se.size > B ? J.push(se.name) : ie > 0 ? (S.push(se), ie--) : ee++ : G(se) ? V.push(se) : Z.push(se.name);
|
|
2267
2267
|
return { imageFiles: S, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2268
|
-
}, c = (
|
|
2269
|
-
const { imageFiles: S, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(
|
|
2268
|
+
}, c = (_) => {
|
|
2269
|
+
const { imageFiles: S, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(_);
|
|
2270
2270
|
J.length && x(`File${J.length > 1 ? "s" : ""} too large${B ? ` (max ${B / 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);
|
|
2271
|
-
const
|
|
2272
|
-
p &&
|
|
2271
|
+
const ie = V.concat(h ? [] : S);
|
|
2272
|
+
p && ie.length && p(ie);
|
|
2273
2273
|
};
|
|
2274
2274
|
M(() => {
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2275
|
+
const _ = H.current;
|
|
2276
|
+
_ && (_.style.height = "auto", _.style.height = `${Math.min(_.scrollHeight, 200)}px`);
|
|
2277
2277
|
}, [s]), M(() => {
|
|
2278
|
-
const
|
|
2278
|
+
const _ = (S) => {
|
|
2279
2279
|
var J, Z, ee;
|
|
2280
|
-
if (
|
|
2280
|
+
if (n || i) return;
|
|
2281
2281
|
const V = (J = S.target) == null ? void 0 : J.tagName;
|
|
2282
2282
|
V === "INPUT" || V === "TEXTAREA" || V === "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
2283
|
};
|
|
2284
|
-
return document.addEventListener("keydown",
|
|
2285
|
-
}, [
|
|
2286
|
-
const w = (
|
|
2287
|
-
|
|
2288
|
-
}, L = (
|
|
2289
|
-
|
|
2290
|
-
}, O = (
|
|
2291
|
-
|
|
2292
|
-
const S = Array.from(
|
|
2284
|
+
return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
|
|
2285
|
+
}, [n, i]);
|
|
2286
|
+
const w = (_) => {
|
|
2287
|
+
_.preventDefault(), F.current++, _.dataTransfer.types.includes("Files") && C(!0);
|
|
2288
|
+
}, L = (_) => {
|
|
2289
|
+
_.preventDefault(), F.current--, F.current === 0 && C(!1);
|
|
2290
|
+
}, O = (_) => _.preventDefault(), te = (_) => {
|
|
2291
|
+
_.preventDefault(), F.current = 0, C(!1);
|
|
2292
|
+
const S = Array.from(_.dataTransfer.files);
|
|
2293
2293
|
S.length && c(S);
|
|
2294
|
-
}, ae = (
|
|
2295
|
-
const S = Array.from(
|
|
2294
|
+
}, ae = (_) => {
|
|
2295
|
+
const S = Array.from(_.target.files || []);
|
|
2296
2296
|
Y.current && (Y.current.value = ""), S.length && c(S);
|
|
2297
|
-
}, W = (
|
|
2297
|
+
}, W = (_) => {
|
|
2298
2298
|
var se;
|
|
2299
2299
|
if (!h) return;
|
|
2300
|
-
const S = (se =
|
|
2300
|
+
const S = (se = _.clipboardData) == null ? void 0 : se.items;
|
|
2301
2301
|
if (!S) return;
|
|
2302
2302
|
const V = [];
|
|
2303
2303
|
for (const Ue of S) {
|
|
@@ -2305,28 +2305,28 @@ function Lt({
|
|
|
2305
2305
|
Te && V.push(Te);
|
|
2306
2306
|
}
|
|
2307
2307
|
if (V.length === 0) return;
|
|
2308
|
-
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded:
|
|
2309
|
-
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`),
|
|
2310
|
-
}, Q = !
|
|
2311
|
-
prompts:
|
|
2308
|
+
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: ie } = g(V);
|
|
2309
|
+
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 = !n && !i && !!(f != null && f.length) && s.length === 0, oe = As({
|
|
2311
|
+
prompts: f ?? [],
|
|
2312
2312
|
enabled: Q
|
|
2313
|
-
}), xe = (
|
|
2313
|
+
}), xe = (_) => {
|
|
2314
2314
|
if (Q) {
|
|
2315
|
-
if (
|
|
2316
|
-
|
|
2315
|
+
if (_.key === "ArrowDown" || _.key === "ArrowRight") {
|
|
2316
|
+
_.preventDefault(), oe.next();
|
|
2317
2317
|
return;
|
|
2318
2318
|
}
|
|
2319
|
-
if (
|
|
2320
|
-
|
|
2319
|
+
if (_.key === "ArrowUp" || _.key === "ArrowLeft") {
|
|
2320
|
+
_.preventDefault(), oe.prev();
|
|
2321
2321
|
return;
|
|
2322
2322
|
}
|
|
2323
|
-
if (
|
|
2324
|
-
|
|
2323
|
+
if (_.key === "Tab" && !_.shiftKey) {
|
|
2324
|
+
_.preventDefault(), t == null || t(oe.currentPrompt);
|
|
2325
2325
|
return;
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
-
a == null || a(
|
|
2329
|
-
}, Ce = (s.trim() || (u == null ? void 0 : u.length) > 0 || (d == null ? void 0 : d.length) > 0) && !
|
|
2328
|
+
a == null || a(_);
|
|
2329
|
+
}, Ce = (s.trim() || (u == null ? void 0 : u.length) > 0 || (d == null ? void 0 : d.length) > 0) && !i, $e = p || h;
|
|
2330
2330
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", z].filter(Boolean).join(" "), ...A, children: [
|
|
2331
2331
|
$e && /* @__PURE__ */ e.jsx(
|
|
2332
2332
|
"input",
|
|
@@ -2354,55 +2354,55 @@ function Lt({
|
|
|
2354
2354
|
{
|
|
2355
2355
|
ref: H,
|
|
2356
2356
|
value: s,
|
|
2357
|
-
onChange: (
|
|
2357
|
+
onChange: (_) => t == null ? void 0 : t(_.target.value),
|
|
2358
2358
|
onKeyDown: xe,
|
|
2359
2359
|
onPaste: W,
|
|
2360
2360
|
placeholder: Q ? "" : l,
|
|
2361
|
-
disabled:
|
|
2361
|
+
disabled: n || i,
|
|
2362
2362
|
rows: 1,
|
|
2363
2363
|
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2364
2364
|
}
|
|
2365
2365
|
),
|
|
2366
2366
|
Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
|
|
2367
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children:
|
|
2367
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: oe.displayed }),
|
|
2368
2368
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2369
2369
|
] }),
|
|
2370
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((
|
|
2371
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2370
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((_, S) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2371
|
+
/* @__PURE__ */ e.jsx("img", { src: _.preview, alt: "" }),
|
|
2372
2372
|
/* @__PURE__ */ e.jsx(
|
|
2373
2373
|
"button",
|
|
2374
2374
|
{
|
|
2375
2375
|
className: "ds-prompt-input__image-remove",
|
|
2376
|
-
onClick: () =>
|
|
2376
|
+
onClick: () => b == null ? void 0 : b(S),
|
|
2377
2377
|
"aria-label": "Remove image",
|
|
2378
2378
|
type: "button",
|
|
2379
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2379
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: 12, strokeWidth: 2 })
|
|
2380
2380
|
}
|
|
2381
2381
|
)
|
|
2382
2382
|
] }, S)) }),
|
|
2383
|
-
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((
|
|
2384
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2383
|
+
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((_) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2384
|
+
/* @__PURE__ */ e.jsx("span", { children: _.msg }),
|
|
2385
2385
|
/* @__PURE__ */ e.jsx(
|
|
2386
2386
|
"button",
|
|
2387
2387
|
{
|
|
2388
2388
|
type: "button",
|
|
2389
2389
|
className: "ds-prompt-input__warning-close",
|
|
2390
|
-
onClick: () => N(
|
|
2390
|
+
onClick: () => N(_.id),
|
|
2391
2391
|
"aria-label": "Dismiss",
|
|
2392
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2392
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
|
|
2393
2393
|
}
|
|
2394
2394
|
)
|
|
2395
|
-
] },
|
|
2396
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2395
|
+
] }, _.id)) }),
|
|
2396
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((_, S) => /* @__PURE__ */ e.jsx(ce, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2397
|
+
_.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: I[1], strokeWidth: 1.5 }),
|
|
2398
|
+
_.filename,
|
|
2399
|
+
_.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2400
2400
|
"button",
|
|
2401
2401
|
{
|
|
2402
2402
|
type: "button",
|
|
2403
2403
|
className: "ds-prompt-input__remove-btn",
|
|
2404
|
-
onClick: () =>
|
|
2405
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2404
|
+
onClick: () => m == null ? void 0 : m(S),
|
|
2405
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: I[1], strokeWidth: 1.5 })
|
|
2406
2406
|
}
|
|
2407
2407
|
)
|
|
2408
2408
|
] }) }, S)) }),
|
|
@@ -2415,21 +2415,21 @@ function Lt({
|
|
|
2415
2415
|
icon: /* @__PURE__ */ e.jsx(Re, { size: I[2], strokeWidth: 1.5 }),
|
|
2416
2416
|
"aria-label": "Attach files",
|
|
2417
2417
|
onClick: () => {
|
|
2418
|
-
var
|
|
2419
|
-
return (
|
|
2418
|
+
var _;
|
|
2419
|
+
return (_ = Y.current) == null ? void 0 : _.click();
|
|
2420
2420
|
}
|
|
2421
2421
|
}
|
|
2422
2422
|
),
|
|
2423
2423
|
y,
|
|
2424
2424
|
T,
|
|
2425
2425
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2426
|
-
|
|
2426
|
+
n ? /* @__PURE__ */ e.jsx(
|
|
2427
2427
|
me,
|
|
2428
2428
|
{
|
|
2429
2429
|
variant: "primary",
|
|
2430
2430
|
size: "xs",
|
|
2431
2431
|
icon: /* @__PURE__ */ e.jsx(es, { size: I[2], strokeWidth: 1.5 }),
|
|
2432
|
-
onClick:
|
|
2432
|
+
onClick: o,
|
|
2433
2433
|
"aria-label": "Stop"
|
|
2434
2434
|
}
|
|
2435
2435
|
) : /* @__PURE__ */ e.jsx(
|
|
@@ -2438,7 +2438,7 @@ function Lt({
|
|
|
2438
2438
|
variant: "primary",
|
|
2439
2439
|
size: "xs",
|
|
2440
2440
|
icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
|
|
2441
|
-
onClick:
|
|
2441
|
+
onClick: r,
|
|
2442
2442
|
disabled: !Ce,
|
|
2443
2443
|
"aria-label": "Send"
|
|
2444
2444
|
}
|
|
@@ -2453,15 +2453,15 @@ const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard
|
|
|
2453
2453
|
function zt({
|
|
2454
2454
|
models: s = [],
|
|
2455
2455
|
value: t,
|
|
2456
|
-
onChange:
|
|
2457
|
-
size:
|
|
2456
|
+
onChange: r,
|
|
2457
|
+
size: o = "xs",
|
|
2458
2458
|
minTier: a,
|
|
2459
|
-
showAutoOption:
|
|
2460
|
-
groupByTier:
|
|
2459
|
+
showAutoOption: n = !1,
|
|
2460
|
+
groupByTier: i = !0,
|
|
2461
2461
|
className: l = "",
|
|
2462
|
-
...
|
|
2462
|
+
...f
|
|
2463
2463
|
}) {
|
|
2464
|
-
const [d, u] = D(!1), p = E(null), h = E(null),
|
|
2464
|
+
const [d, u] = D(!1), p = E(null), h = E(null), m = E(null), [b, j] = D({}), R = s.filter((v) => !a || v.name === "auto" ? !0 : (Pe[v.tier] ?? 1) >= (Pe[a] ?? 1)), $ = R.find((v) => v.name === "auto"), B = R.filter((v) => v.name !== "auto"), y = s.find((v) => v.name === t), z = new Set(B.map((v) => v.tier).filter(Boolean)).size > 1;
|
|
2465
2465
|
M(() => {
|
|
2466
2466
|
if (!d) return;
|
|
2467
2467
|
const v = 320, C = () => {
|
|
@@ -2479,7 +2479,7 @@ function zt({
|
|
|
2479
2479
|
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
2480
2480
|
const X = (x) => {
|
|
2481
2481
|
var N, k;
|
|
2482
|
-
!((N = p.current) != null && N.contains(x.target)) && !((k =
|
|
2482
|
+
!((N = p.current) != null && N.contains(x.target)) && !((k = m.current) != null && k.contains(x.target)) && u(!1);
|
|
2483
2483
|
}, U = (x) => {
|
|
2484
2484
|
x.key === "Escape" && u(!1);
|
|
2485
2485
|
};
|
|
@@ -2488,7 +2488,7 @@ function zt({
|
|
|
2488
2488
|
};
|
|
2489
2489
|
}, [d]);
|
|
2490
2490
|
const A = (v) => {
|
|
2491
|
-
|
|
2491
|
+
r == null || r(v), u(!1);
|
|
2492
2492
|
}, Y = (v) => /* @__PURE__ */ e.jsxs(
|
|
2493
2493
|
"button",
|
|
2494
2494
|
{
|
|
@@ -2505,14 +2505,14 @@ function zt({
|
|
|
2505
2505
|
]
|
|
2506
2506
|
},
|
|
2507
2507
|
v.name
|
|
2508
|
-
), H = () => !
|
|
2508
|
+
), H = () => !i || !z ? B.map(Y) : ["fast", "standard", "premium"].flatMap((v) => {
|
|
2509
2509
|
const C = B.filter((X) => X.tier === v);
|
|
2510
2510
|
return C.length ? [
|
|
2511
2511
|
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": v, children: v.charAt(0).toUpperCase() + v.slice(1) }, `lbl-${v}`),
|
|
2512
2512
|
...C.map(Y)
|
|
2513
2513
|
] : [];
|
|
2514
|
-
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref:
|
|
2515
|
-
|
|
2514
|
+
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref: m, className: "ds-model-picker__menu ds-scrollable", style: b, children: [
|
|
2515
|
+
n && $ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2516
2516
|
/* @__PURE__ */ e.jsxs(
|
|
2517
2517
|
"button",
|
|
2518
2518
|
{
|
|
@@ -2538,7 +2538,7 @@ function zt({
|
|
|
2538
2538
|
{
|
|
2539
2539
|
ref: p,
|
|
2540
2540
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2541
|
-
...
|
|
2541
|
+
...f,
|
|
2542
2542
|
children: [
|
|
2543
2543
|
/* @__PURE__ */ e.jsxs(
|
|
2544
2544
|
"button",
|
|
@@ -2570,54 +2570,54 @@ function ve(s) {
|
|
|
2570
2570
|
}
|
|
2571
2571
|
function Ms(s) {
|
|
2572
2572
|
const t = /* @__PURE__ */ new Map();
|
|
2573
|
-
for (const
|
|
2574
|
-
t.has(
|
|
2573
|
+
for (const r of s)
|
|
2574
|
+
t.has(r.filename) || t.set(r.filename, { filename: r.filename, url: r.url, items: [] }), t.get(r.filename).items.push(r);
|
|
2575
2575
|
return [...t.values()];
|
|
2576
2576
|
}
|
|
2577
2577
|
function Ot({
|
|
2578
2578
|
sources: s = [],
|
|
2579
2579
|
layout: t = "list",
|
|
2580
|
-
title:
|
|
2581
|
-
maxVisible:
|
|
2580
|
+
title: r = "Sources",
|
|
2581
|
+
maxVisible: o = 5,
|
|
2582
2582
|
onSourceClick: a
|
|
2583
2583
|
}) {
|
|
2584
|
-
const [
|
|
2584
|
+
const [n, i] = D(!1), l = Ms(s), f = l.length > o, d = n ? l : l.slice(0, o), u = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2585
2585
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2586
2586
|
d.map((h) => {
|
|
2587
|
-
const
|
|
2587
|
+
const m = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2588
2588
|
return /* @__PURE__ */ e.jsxs(
|
|
2589
2589
|
"div",
|
|
2590
2590
|
{
|
|
2591
|
-
className: `ds-sources-panel__compact-row${
|
|
2592
|
-
onClick:
|
|
2591
|
+
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2592
|
+
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2593
2593
|
children: [
|
|
2594
|
-
/* @__PURE__ */ e.jsx(
|
|
2594
|
+
/* @__PURE__ */ e.jsx(rs, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2595
2595
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2596
|
-
|
|
2596
|
+
m.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(m) })
|
|
2597
2597
|
]
|
|
2598
2598
|
},
|
|
2599
2599
|
h.filename
|
|
2600
2600
|
);
|
|
2601
2601
|
}),
|
|
2602
|
-
|
|
2602
|
+
f && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2603
2603
|
"+",
|
|
2604
|
-
l.length -
|
|
2604
|
+
l.length - o,
|
|
2605
2605
|
" more sources"
|
|
2606
2606
|
] })
|
|
2607
2607
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2608
|
-
|
|
2608
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
|
|
2609
2609
|
d.map((h) => {
|
|
2610
|
-
const
|
|
2610
|
+
const m = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2611
2611
|
return u ? /* @__PURE__ */ e.jsx(
|
|
2612
2612
|
Ee,
|
|
2613
2613
|
{
|
|
2614
|
-
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages:
|
|
2614
|
+
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: m }),
|
|
2615
2615
|
padding: "s",
|
|
2616
2616
|
children: h.items.map((j, R) => /* @__PURE__ */ e.jsx(
|
|
2617
2617
|
"div",
|
|
2618
2618
|
{
|
|
2619
|
-
className: `ds-sources-panel__snippet${
|
|
2620
|
-
onClick:
|
|
2619
|
+
className: `ds-sources-panel__snippet${b ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2620
|
+
onClick: b ? () => a(j) : void 0,
|
|
2621
2621
|
children: j.snippet ?? `p. ${j.page}`
|
|
2622
2622
|
},
|
|
2623
2623
|
R
|
|
@@ -2627,19 +2627,19 @@ function Ot({
|
|
|
2627
2627
|
) : /* @__PURE__ */ e.jsxs(
|
|
2628
2628
|
"div",
|
|
2629
2629
|
{
|
|
2630
|
-
className: `ds-sources-panel__row${
|
|
2631
|
-
onClick:
|
|
2630
|
+
className: `ds-sources-panel__row${b ? " ds-sources-panel__row--clickable" : ""}`,
|
|
2631
|
+
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2632
2632
|
children: [
|
|
2633
2633
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2634
|
-
|
|
2634
|
+
m.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(m) })
|
|
2635
2635
|
]
|
|
2636
2636
|
},
|
|
2637
2637
|
h.filename
|
|
2638
2638
|
);
|
|
2639
2639
|
}),
|
|
2640
|
-
|
|
2640
|
+
f && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2641
2641
|
"+",
|
|
2642
|
-
l.length -
|
|
2642
|
+
l.length - o,
|
|
2643
2643
|
" more sources"
|
|
2644
2644
|
] })
|
|
2645
2645
|
] });
|
|
@@ -2650,17 +2650,17 @@ function ze(s) {
|
|
|
2650
2650
|
function Ft({
|
|
2651
2651
|
used: s,
|
|
2652
2652
|
limit: t,
|
|
2653
|
-
size:
|
|
2654
|
-
showCount:
|
|
2653
|
+
size: r = "s",
|
|
2654
|
+
showCount: o = !0,
|
|
2655
2655
|
showPercent: a = !1,
|
|
2656
|
-
warningThreshold:
|
|
2657
|
-
errorThreshold:
|
|
2656
|
+
warningThreshold: n = 0.8,
|
|
2657
|
+
errorThreshold: i = 1
|
|
2658
2658
|
}) {
|
|
2659
|
-
const l = t > 0 ? s / t : 0,
|
|
2659
|
+
const l = t > 0 ? s / t : 0, f = Math.min(l * 100, 100), d = l >= i ? "error" : l >= n ? "warning" : "normal";
|
|
2660
2660
|
return /* @__PURE__ */ e.jsxs(
|
|
2661
2661
|
"div",
|
|
2662
2662
|
{
|
|
2663
|
-
className: `ds-token-counter ds-token-counter--${
|
|
2663
|
+
className: `ds-token-counter ds-token-counter--${r}`,
|
|
2664
2664
|
role: "meter",
|
|
2665
2665
|
"aria-valuenow": s,
|
|
2666
2666
|
"aria-valuemax": t,
|
|
@@ -2669,11 +2669,11 @@ function Ft({
|
|
|
2669
2669
|
"div",
|
|
2670
2670
|
{
|
|
2671
2671
|
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2672
|
-
style: { width: `${
|
|
2672
|
+
style: { width: `${f}%` }
|
|
2673
2673
|
}
|
|
2674
2674
|
) }),
|
|
2675
|
-
(
|
|
2676
|
-
|
|
2675
|
+
(o || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
2676
|
+
o && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2677
2677
|
ze(s),
|
|
2678
2678
|
" / ",
|
|
2679
2679
|
ze(t),
|
|
@@ -2695,28 +2695,28 @@ function Ps(s) {
|
|
|
2695
2695
|
function Wt({
|
|
2696
2696
|
value: s = 0,
|
|
2697
2697
|
size: t = "xs",
|
|
2698
|
-
showLabel:
|
|
2699
|
-
layout:
|
|
2698
|
+
showLabel: r = "none",
|
|
2699
|
+
layout: o = "inline"
|
|
2700
2700
|
}) {
|
|
2701
|
-
const a = Math.max(0, Math.min(1, s)),
|
|
2701
|
+
const a = Math.max(0, Math.min(1, s)), n = Math.round(a * Oe), i = Ps(a);
|
|
2702
2702
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2703
2703
|
"ds-confidence-bar",
|
|
2704
2704
|
`ds-confidence-bar--${t}`,
|
|
2705
|
-
`ds-confidence-bar--${
|
|
2706
|
-
|
|
2705
|
+
`ds-confidence-bar--${i}`,
|
|
2706
|
+
o === "block" && "ds-confidence-bar--block"
|
|
2707
2707
|
].filter(Boolean).join(" "), children: [
|
|
2708
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l,
|
|
2708
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, f) => /* @__PURE__ */ e.jsx(
|
|
2709
2709
|
"div",
|
|
2710
2710
|
{
|
|
2711
|
-
className: `ds-confidence-bar__seg${
|
|
2711
|
+
className: `ds-confidence-bar__seg${f < n ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2712
2712
|
},
|
|
2713
|
-
|
|
2713
|
+
f
|
|
2714
2714
|
)) }),
|
|
2715
|
-
|
|
2715
|
+
r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
2716
2716
|
] });
|
|
2717
2717
|
}
|
|
2718
2718
|
const Ls = { add: "+", remove: "-", context: " " };
|
|
2719
|
-
function
|
|
2719
|
+
function be({ line: s, lineNumbers: t }) {
|
|
2720
2720
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
|
|
2721
2721
|
t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
|
|
2722
2722
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Ls[s.type] }),
|
|
@@ -2726,50 +2726,50 @@ function _e({ line: s, lineNumbers: t }) {
|
|
|
2726
2726
|
function Ct({
|
|
2727
2727
|
lines: s = [],
|
|
2728
2728
|
layout: t = "inline",
|
|
2729
|
-
wordWrap:
|
|
2730
|
-
lineNumbers:
|
|
2729
|
+
wordWrap: r = !1,
|
|
2730
|
+
lineNumbers: o = !0,
|
|
2731
2731
|
maxHeight: a,
|
|
2732
|
-
title:
|
|
2732
|
+
title: n
|
|
2733
2733
|
}) {
|
|
2734
|
-
const
|
|
2734
|
+
const i = [
|
|
2735
2735
|
"ds-diff-view",
|
|
2736
2736
|
`ds-diff-view--${t}`,
|
|
2737
|
-
|
|
2737
|
+
r && "ds-diff-view--wrap"
|
|
2738
2738
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2739
2739
|
if (t === "split") {
|
|
2740
|
-
const
|
|
2741
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
2742
|
-
|
|
2743
|
-
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2744
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children:
|
|
2745
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((u, p) => /* @__PURE__ */ e.jsx(
|
|
2740
|
+
const f = s.filter((u) => u.type === "remove" || u.type === "context"), d = s.filter((u) => u.type === "add" || u.type === "context");
|
|
2741
|
+
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
2742
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2743
|
+
/* @__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: f.map((u, p) => /* @__PURE__ */ e.jsx(be, { line: u, lineNumbers: o }, p)) }),
|
|
2745
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((u, p) => /* @__PURE__ */ e.jsx(be, { line: u, lineNumbers: o }, p)) })
|
|
2746
2746
|
] })
|
|
2747
2747
|
] });
|
|
2748
2748
|
}
|
|
2749
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
2750
|
-
|
|
2751
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((
|
|
2749
|
+
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
2750
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2751
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: s.map((f, d) => /* @__PURE__ */ e.jsx(be, { line: f, lineNumbers: o }, d)) })
|
|
2752
2752
|
] });
|
|
2753
2753
|
}
|
|
2754
2754
|
function zs({
|
|
2755
2755
|
value: s = "idle",
|
|
2756
2756
|
onLike: t,
|
|
2757
|
-
onDislike:
|
|
2758
|
-
className:
|
|
2757
|
+
onDislike: r,
|
|
2758
|
+
className: o = "",
|
|
2759
2759
|
...a
|
|
2760
2760
|
}) {
|
|
2761
|
-
const
|
|
2761
|
+
const n = s !== "idle";
|
|
2762
2762
|
return /* @__PURE__ */ e.jsxs(
|
|
2763
2763
|
"div",
|
|
2764
2764
|
{
|
|
2765
2765
|
className: [
|
|
2766
2766
|
"ds-message-feedback",
|
|
2767
|
-
|
|
2768
|
-
|
|
2767
|
+
n && "ds-message-feedback--voted",
|
|
2768
|
+
o
|
|
2769
2769
|
].filter(Boolean).join(" "),
|
|
2770
2770
|
...a,
|
|
2771
2771
|
children: [
|
|
2772
|
-
(!
|
|
2772
|
+
(!n || s === "liked") && /* @__PURE__ */ e.jsx(
|
|
2773
2773
|
"button",
|
|
2774
2774
|
{
|
|
2775
2775
|
className: [
|
|
@@ -2777,11 +2777,11 @@ function zs({
|
|
|
2777
2777
|
s === "liked" && "ds-message-feedback__btn--liked"
|
|
2778
2778
|
].filter(Boolean).join(" "),
|
|
2779
2779
|
onClick: t,
|
|
2780
|
-
disabled:
|
|
2780
|
+
disabled: n,
|
|
2781
2781
|
"aria-label": "Like",
|
|
2782
2782
|
"aria-pressed": s === "liked",
|
|
2783
2783
|
children: /* @__PURE__ */ e.jsx(
|
|
2784
|
-
|
|
2784
|
+
ns,
|
|
2785
2785
|
{
|
|
2786
2786
|
size: I[1],
|
|
2787
2787
|
strokeWidth: 1.5,
|
|
@@ -2790,15 +2790,15 @@ function zs({
|
|
|
2790
2790
|
)
|
|
2791
2791
|
}
|
|
2792
2792
|
),
|
|
2793
|
-
(!
|
|
2793
|
+
(!n || s === "disliked") && /* @__PURE__ */ e.jsx(
|
|
2794
2794
|
"button",
|
|
2795
2795
|
{
|
|
2796
2796
|
className: [
|
|
2797
2797
|
"ds-message-feedback__btn",
|
|
2798
2798
|
s === "disliked" && "ds-message-feedback__btn--disliked"
|
|
2799
2799
|
].filter(Boolean).join(" "),
|
|
2800
|
-
onClick:
|
|
2801
|
-
disabled:
|
|
2800
|
+
onClick: r,
|
|
2801
|
+
disabled: n,
|
|
2802
2802
|
"aria-label": "Dislike",
|
|
2803
2803
|
"aria-pressed": s === "disliked",
|
|
2804
2804
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -2818,43 +2818,96 @@ function zs({
|
|
|
2818
2818
|
function Os(s) {
|
|
2819
2819
|
const t = s instanceof Date ? s : new Date(s);
|
|
2820
2820
|
if (isNaN(t)) return null;
|
|
2821
|
-
const
|
|
2822
|
-
if (t >= a) return
|
|
2823
|
-
if (t >=
|
|
2824
|
-
const
|
|
2825
|
-
return `${
|
|
2821
|
+
const r = /* @__PURE__ */ new Date(), o = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(r.getFullYear(), r.getMonth(), r.getDate()), n = new Date(a - 864e5);
|
|
2822
|
+
if (t >= a) return o;
|
|
2823
|
+
if (t >= n) return `Yesterday ${o}`;
|
|
2824
|
+
const i = t.getDate(), l = t.toLocaleString([], { month: "short" });
|
|
2825
|
+
return `${i} ${l} ${o}`;
|
|
2826
2826
|
}
|
|
2827
2827
|
function Ut({
|
|
2828
2828
|
role: s = "assistant",
|
|
2829
2829
|
text: t,
|
|
2830
|
-
timestamp:
|
|
2831
|
-
feedbackValue:
|
|
2830
|
+
timestamp: r,
|
|
2831
|
+
feedbackValue: o = "idle",
|
|
2832
2832
|
onLike: a,
|
|
2833
|
-
onDislike:
|
|
2834
|
-
className:
|
|
2833
|
+
onDislike: n,
|
|
2834
|
+
className: i = "",
|
|
2835
2835
|
...l
|
|
2836
2836
|
}) {
|
|
2837
|
-
const
|
|
2838
|
-
return !
|
|
2837
|
+
const f = s === "assistant" && (a || n), d = !!t, u = r ? Os(r) : null;
|
|
2838
|
+
return !f && !d && !u ? null : /* @__PURE__ */ e.jsxs(
|
|
2839
2839
|
"div",
|
|
2840
2840
|
{
|
|
2841
|
-
className: ["ds-message-footer", `ds-message-footer--${s}`,
|
|
2841
|
+
className: ["ds-message-footer", `ds-message-footer--${s}`, i].filter(Boolean).join(" "),
|
|
2842
2842
|
...l,
|
|
2843
2843
|
children: [
|
|
2844
2844
|
s === "user" && u && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: u }),
|
|
2845
|
-
|
|
2845
|
+
f && /* @__PURE__ */ e.jsx(zs, { className: "ds-message-action", value: o, onLike: a, onDislike: n }),
|
|
2846
2846
|
d && /* @__PURE__ */ e.jsx(Ds, { className: "ds-message-action", text: t }),
|
|
2847
2847
|
s === "assistant" && u && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: u })
|
|
2848
2848
|
]
|
|
2849
2849
|
}
|
|
2850
2850
|
);
|
|
2851
2851
|
}
|
|
2852
|
-
function Vt({ label: s, className: t = "", ...
|
|
2853
|
-
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...
|
|
2852
|
+
function Vt({ label: s, className: t = "", ...r }) {
|
|
2853
|
+
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...r, children: [
|
|
2854
2854
|
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
2855
2855
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: s })
|
|
2856
2856
|
] });
|
|
2857
2857
|
}
|
|
2858
|
+
function Yt({ variant: s = "light", glow: t, mask: r = !0, style: o, ...a }) {
|
|
2859
|
+
const n = s === "dark", i = t ?? n, l = n ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", f = n ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
2860
|
+
return /* @__PURE__ */ e.jsx(
|
|
2861
|
+
"div",
|
|
2862
|
+
{
|
|
2863
|
+
style: {
|
|
2864
|
+
position: "absolute",
|
|
2865
|
+
inset: 0,
|
|
2866
|
+
pointerEvents: "none",
|
|
2867
|
+
overflow: "hidden",
|
|
2868
|
+
zIndex: 0,
|
|
2869
|
+
...i && {
|
|
2870
|
+
background: "radial-gradient(ellipse 1000px 500px at 50% 30%, rgba(234,100,100,0.18), transparent 70%)"
|
|
2871
|
+
},
|
|
2872
|
+
...o
|
|
2873
|
+
},
|
|
2874
|
+
...a,
|
|
2875
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2876
|
+
"div",
|
|
2877
|
+
{
|
|
2878
|
+
style: {
|
|
2879
|
+
position: "absolute",
|
|
2880
|
+
inset: 0,
|
|
2881
|
+
backgroundImage: [
|
|
2882
|
+
`linear-gradient(${l} 1px, transparent 1px)`,
|
|
2883
|
+
`linear-gradient(90deg, ${l} 1px, transparent 1px)`,
|
|
2884
|
+
`linear-gradient(${f} 1px, transparent 1px)`,
|
|
2885
|
+
`linear-gradient(90deg, ${f} 1px, transparent 1px)`
|
|
2886
|
+
].join(", "),
|
|
2887
|
+
backgroundSize: "80px 80px, 80px 80px, 16px 16px, 16px 16px",
|
|
2888
|
+
backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
|
|
2889
|
+
...r && {
|
|
2890
|
+
WebkitMaskImage: "radial-gradient(ellipse at center, #000 30%, transparent 85%)",
|
|
2891
|
+
maskImage: "radial-gradient(ellipse at center, #000 30%, transparent 85%)"
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
)
|
|
2896
|
+
}
|
|
2897
|
+
);
|
|
2898
|
+
}
|
|
2899
|
+
function Ht({ children: s, axis: t = "y", style: r, className: o = "", ...a }) {
|
|
2900
|
+
const n = t === "x" ? { overflowX: "auto", overflowY: "hidden" } : t === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
2901
|
+
return /* @__PURE__ */ e.jsx(
|
|
2902
|
+
"div",
|
|
2903
|
+
{
|
|
2904
|
+
className: `ds-scrollable ${o}`,
|
|
2905
|
+
style: { ...n, ...r },
|
|
2906
|
+
...a,
|
|
2907
|
+
children: s
|
|
2908
|
+
}
|
|
2909
|
+
);
|
|
2910
|
+
}
|
|
2858
2911
|
export {
|
|
2859
2912
|
Ee as Accordion,
|
|
2860
2913
|
Qs as Alert,
|
|
@@ -2876,7 +2929,8 @@ export {
|
|
|
2876
2929
|
Be as DrawerFooter,
|
|
2877
2930
|
kt as Dropdown,
|
|
2878
2931
|
jt as EmptyState,
|
|
2879
|
-
|
|
2932
|
+
Yt as EngineerGrid,
|
|
2933
|
+
_t as FormField,
|
|
2880
2934
|
Ks as H1,
|
|
2881
2935
|
Xs as H2,
|
|
2882
2936
|
Gs as H3,
|
|
@@ -2897,6 +2951,7 @@ export {
|
|
|
2897
2951
|
Lt as PromptInput,
|
|
2898
2952
|
ct as Radio,
|
|
2899
2953
|
At as ReasoningBlock,
|
|
2954
|
+
Ht as Scrollable,
|
|
2900
2955
|
at as SegmentedControl,
|
|
2901
2956
|
Ys as Select,
|
|
2902
2957
|
xs as Skeleton,
|
|
@@ -2906,23 +2961,23 @@ export {
|
|
|
2906
2961
|
It as StepIndicator,
|
|
2907
2962
|
Hs as Stepper,
|
|
2908
2963
|
Bt as StreamingText,
|
|
2909
|
-
|
|
2964
|
+
nt as Tab,
|
|
2910
2965
|
ut as Table,
|
|
2911
2966
|
mt as TableBody,
|
|
2912
2967
|
ft as TableHead,
|
|
2913
2968
|
pt as TableRow,
|
|
2914
2969
|
ht as TableSubheaderRow,
|
|
2915
|
-
|
|
2916
|
-
|
|
2970
|
+
rt as Tabs,
|
|
2971
|
+
bt as Td,
|
|
2917
2972
|
Vs as Textarea,
|
|
2918
2973
|
xt as Th,
|
|
2919
2974
|
Vt as ThinkingDot,
|
|
2920
2975
|
St as ToastContainer,
|
|
2921
|
-
|
|
2976
|
+
it as Toggle,
|
|
2922
2977
|
Ft as TokenCounter,
|
|
2923
2978
|
Dt as ToolCallBubble,
|
|
2924
2979
|
Dt as ToolCallCard,
|
|
2925
|
-
|
|
2980
|
+
ot as Tooltip,
|
|
2926
2981
|
I as iconSizes,
|
|
2927
2982
|
ks as useAnimatedNumber,
|
|
2928
2983
|
As as useAnimatedPlaceholder,
|