@donkit-ai/design-system 1.4.26 → 1.4.28
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 +2 -2
- package/dist/index.es.js +402 -398
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -59,24 +59,24 @@ function os() {
|
|
|
59
59
|
return c.$$typeof === C ? null : c.displayName || c.name || null;
|
|
60
60
|
if (typeof c == "string") return c;
|
|
61
61
|
switch (c) {
|
|
62
|
-
case
|
|
62
|
+
case R:
|
|
63
63
|
return "Fragment";
|
|
64
64
|
case B:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case $:
|
|
67
67
|
return "StrictMode";
|
|
68
68
|
case A:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case Y:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case v:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof c == "object")
|
|
76
76
|
switch (typeof c.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), c.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case j:
|
|
80
80
|
return "Portal";
|
|
81
81
|
case T:
|
|
82
82
|
return c.displayName || "Context";
|
|
@@ -117,7 +117,7 @@ function os() {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function i(c) {
|
|
120
|
-
if (c ===
|
|
120
|
+
if (c === R) return "<>";
|
|
121
121
|
if (typeof c == "object" && c !== null && c.$$typeof === F)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
@@ -153,7 +153,7 @@ function os() {
|
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function m() {
|
|
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: _,
|
|
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: m
|
|
173
173
|
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -196,7 +196,7 @@ function os() {
|
|
|
196
196
|
var W = w.children;
|
|
197
197
|
if (W !== void 0)
|
|
198
198
|
if (O)
|
|
199
|
-
if (
|
|
199
|
+
if (x(W)) {
|
|
200
200
|
for (O = 0; O < W.length; O++)
|
|
201
201
|
p(W[O]);
|
|
202
202
|
Object.freeze && Object.freeze(W);
|
|
@@ -244,21 +244,21 @@ 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 === _;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var f = K, _ = 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 = f.__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
|
+
f = {
|
|
253
253
|
react_stack_bottom_frame: function(c) {
|
|
254
254
|
return c();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var k, P = {}, q =
|
|
258
|
-
|
|
257
|
+
var k, P = {}, q = f.react_stack_bottom_frame.bind(
|
|
258
|
+
f,
|
|
259
259
|
r
|
|
260
260
|
)(), G = N(i(r)), g = {};
|
|
261
|
-
fe.Fragment =
|
|
261
|
+
fe.Fragment = R, fe.jsx = function(c, w, L) {
|
|
262
262
|
var O = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return u(
|
|
264
264
|
c,
|
|
@@ -304,40 +304,40 @@ function me({
|
|
|
304
304
|
disabled: r = !1,
|
|
305
305
|
state: o = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
307
|
+
type: m = "button",
|
|
308
308
|
href: d,
|
|
309
309
|
"aria-label": u,
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const
|
|
313
|
+
const f = a && !s, _ = o === "loading", j = o === "success", R = o === "error", $ = _ || j || R, B = n === "xs" ? "s" : "m", y = t === "danger" ? "on-accent" : "default", T = cs[n] ?? 16, z = _ ? /* @__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(re, { size: T, strokeWidth: 2.5 }) }) : null, A = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
316
|
`ds-button--${n}`,
|
|
317
317
|
i && "ds-button--full",
|
|
318
|
-
|
|
318
|
+
f && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
320
|
].filter(Boolean).join(" "), Y = o !== "idle" ? o : 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
|
-
const F = (
|
|
326
|
-
if (r ||
|
|
327
|
-
|
|
325
|
+
const F = (v) => {
|
|
326
|
+
if (r || _) {
|
|
327
|
+
v.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
v.metaKey || v.ctrlKey || v.button === 1 || (v.preventDefault(), l == null || l(v));
|
|
331
331
|
};
|
|
332
332
|
return /* @__PURE__ */ e.jsx(
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: A,
|
|
336
|
-
href: r ||
|
|
336
|
+
href: r || _ ? void 0 : d,
|
|
337
337
|
onClick: F,
|
|
338
338
|
"aria-label": u,
|
|
339
|
-
"aria-disabled": r ||
|
|
340
|
-
"aria-busy":
|
|
339
|
+
"aria-disabled": r || _ ? "true" : void 0,
|
|
340
|
+
"aria-busy": _ ? "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: m,
|
|
351
351
|
className: A,
|
|
352
352
|
disabled: r,
|
|
353
|
-
onClick:
|
|
353
|
+
onClick: _ ? void 0 : l,
|
|
354
354
|
"aria-label": u,
|
|
355
|
-
"aria-busy":
|
|
355
|
+
"aria-busy": _ ? "true" : void 0,
|
|
356
356
|
"data-state": Y,
|
|
357
357
|
...h,
|
|
358
358
|
children: H
|
|
@@ -368,12 +368,12 @@ function Us({
|
|
|
368
368
|
iconRight: r,
|
|
369
369
|
onIconRightClick: o,
|
|
370
370
|
size: l = "m",
|
|
371
|
-
disabled:
|
|
371
|
+
disabled: m,
|
|
372
372
|
id: d,
|
|
373
373
|
...u
|
|
374
374
|
}) {
|
|
375
|
-
const p = d || `input-${K.useId()}`, h = n ? `${p}-hint` : void 0,
|
|
376
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${
|
|
375
|
+
const p = d || `input-${K.useId()}`, h = n ? `${p}-hint` : void 0, f = t ? `${p}-error` : void 0, _ = f || h;
|
|
376
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
377
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
378
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
379
379
|
a && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: a }),
|
|
@@ -382,9 +382,9 @@ function Us({
|
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
384
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${r ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
385
|
-
disabled:
|
|
385
|
+
disabled: m,
|
|
386
386
|
"aria-invalid": t ? "true" : "false",
|
|
387
|
-
"aria-describedby":
|
|
387
|
+
"aria-describedby": _,
|
|
388
388
|
...u
|
|
389
389
|
}
|
|
390
390
|
),
|
|
@@ -401,7 +401,7 @@ function Us({
|
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
403
403
|
n && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: n }),
|
|
404
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id:
|
|
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: f, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
407
|
function Vs({
|
|
@@ -413,10 +413,10 @@ function Vs({
|
|
|
413
413
|
disabled: r,
|
|
414
414
|
id: o,
|
|
415
415
|
resize: l = !0,
|
|
416
|
-
rows:
|
|
416
|
+
rows: m = 3,
|
|
417
417
|
...d
|
|
418
418
|
}) {
|
|
419
|
-
const u = o || `textarea-${K.useId()}`, p = n ? `${u}-hint` : void 0, h = t ? `${u}-error` : void 0,
|
|
419
|
+
const u = o || `textarea-${K.useId()}`, p = n ? `${u}-hint` : void 0, h = t ? `${u}-error` : void 0, f = h || p;
|
|
420
420
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${r ? "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(
|
|
@@ -426,8 +426,8 @@ function Vs({
|
|
|
426
426
|
className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
427
|
disabled: r,
|
|
428
428
|
"aria-invalid": t ? "true" : "false",
|
|
429
|
-
"aria-describedby":
|
|
430
|
-
rows:
|
|
429
|
+
"aria-describedby": f,
|
|
430
|
+
rows: m,
|
|
431
431
|
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
@@ -444,17 +444,17 @@ function Ys({
|
|
|
444
444
|
error: r,
|
|
445
445
|
fullWidth: o = !0,
|
|
446
446
|
size: l = "m",
|
|
447
|
-
disabled:
|
|
447
|
+
disabled: m = !1,
|
|
448
448
|
id: d,
|
|
449
449
|
...u
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] = D(!1), [
|
|
452
|
-
|
|
451
|
+
const [p, h] = D(!1), [f, _] = 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 = r ? `${F}-error` : void 0, X = 150, U = (g = !1) => {
|
|
452
|
+
f || (_(!0), T(-1), H.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
|
-
h(!1),
|
|
454
|
+
h(!1), _(!1), g && ((c = Y.current) == null || c.focus());
|
|
455
455
|
}, X));
|
|
456
|
-
},
|
|
457
|
-
clearTimeout(H.current),
|
|
456
|
+
}, x = (g) => {
|
|
457
|
+
clearTimeout(H.current), _(!1);
|
|
458
458
|
const c = g !== void 0 ? g : Math.max(i.findIndex((w) => w.value === t), 0);
|
|
459
459
|
T(c), h(!0);
|
|
460
460
|
};
|
|
@@ -464,7 +464,7 @@ function Ys({
|
|
|
464
464
|
const g = (ae = z.current) == null ? void 0 : ae.getBoundingClientRect();
|
|
465
465
|
if (!g) return;
|
|
466
466
|
const c = window.innerHeight, w = c - g.bottom, L = g.top, te = w < 300 && L > w;
|
|
467
|
-
B(te ? "up" : "down"),
|
|
467
|
+
B(te ? "up" : "down"), R(
|
|
468
468
|
te ? { bottom: c - g.top + 4, left: g.left, width: g.width } : { top: g.bottom + 4, left: g.left, width: g.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
@@ -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
|
+
}, [f]), 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,10 +486,10 @@ 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, i.length - 1)) :
|
|
489
|
+
g.preventDefault(), p ? T((c) => Math.min(c + 1, i.length - 1)) : x();
|
|
490
490
|
break;
|
|
491
491
|
case "ArrowUp":
|
|
492
|
-
g.preventDefault(), p ? T((c) => Math.max(c - 1, 0)) :
|
|
492
|
+
g.preventDefault(), p ? T((c) => Math.max(c - 1, 0)) : x(i.length - 1);
|
|
493
493
|
break;
|
|
494
494
|
case "Home":
|
|
495
495
|
p && (g.preventDefault(), T(0));
|
|
@@ -499,7 +499,7 @@ function Ys({
|
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
g.preventDefault(), p ? y >= 0 && (n == null || n(i[y].value), U(!0)) :
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (n == null || n(i[y].value), U(!0)) : x();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
505
|
p && (g.preventDefault(), U(!0));
|
|
@@ -513,15 +513,15 @@ function Ys({
|
|
|
513
513
|
{
|
|
514
514
|
ref: A,
|
|
515
515
|
role: "listbox",
|
|
516
|
-
"aria-labelledby": s ?
|
|
516
|
+
"aria-labelledby": s ? v : void 0,
|
|
517
517
|
tabIndex: -1,
|
|
518
518
|
className: [
|
|
519
519
|
"ds-select-dropdown",
|
|
520
520
|
`ds-select-dropdown--${l}`,
|
|
521
|
-
`ds-select-dropdown--${
|
|
522
|
-
|
|
521
|
+
`ds-select-dropdown--${$}`,
|
|
522
|
+
f && "ds-select-dropdown--closing"
|
|
523
523
|
].filter(Boolean).join(" "),
|
|
524
|
-
style:
|
|
524
|
+
style: j,
|
|
525
525
|
children: i.map((g, c) => /* @__PURE__ */ e.jsx(
|
|
526
526
|
"button",
|
|
527
527
|
{
|
|
@@ -545,8 +545,8 @@ function Ys({
|
|
|
545
545
|
))
|
|
546
546
|
}
|
|
547
547
|
);
|
|
548
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${
|
|
549
|
-
s && /* @__PURE__ */ e.jsx("label", { id:
|
|
548
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
549
|
+
s && /* @__PURE__ */ e.jsx("label", { id: v, className: "ds-select-label", children: s }),
|
|
550
550
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: z, children: /* @__PURE__ */ e.jsxs(
|
|
551
551
|
"button",
|
|
552
552
|
{
|
|
@@ -557,15 +557,15 @@ function Ys({
|
|
|
557
557
|
"aria-haspopup": "listbox",
|
|
558
558
|
"aria-expanded": p,
|
|
559
559
|
"aria-activedescendant": p && y >= 0 ? `${F}-opt-${y}` : void 0,
|
|
560
|
-
"aria-labelledby": s ?
|
|
560
|
+
"aria-labelledby": s ? v : void 0,
|
|
561
561
|
"aria-invalid": r ? "true" : "false",
|
|
562
562
|
"aria-describedby": C,
|
|
563
563
|
className: `ds-select-trigger ds-select-trigger--${l} ${r ? "ds-select-trigger--error" : ""}`,
|
|
564
564
|
onClick: () => {
|
|
565
|
-
|
|
565
|
+
m || (p ? U() : x());
|
|
566
566
|
},
|
|
567
567
|
onKeyDown: k,
|
|
568
|
-
disabled:
|
|
568
|
+
disabled: m,
|
|
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 }),
|
|
@@ -574,7 +574,7 @@ function Ys({
|
|
|
574
574
|
{
|
|
575
575
|
size: q,
|
|
576
576
|
strokeWidth: 1.5,
|
|
577
|
-
className: `ds-select-icon ${p &&
|
|
577
|
+
className: `ds-select-icon ${p && $ === "down" ? "ds-select-icon--open" : ""} ${p && $ === "up" ? "ds-select-icon--up" : ""}`,
|
|
578
578
|
"aria-hidden": "true"
|
|
579
579
|
}
|
|
580
580
|
)
|
|
@@ -594,21 +594,21 @@ function Hs({
|
|
|
594
594
|
step: r = 1,
|
|
595
595
|
size: o = "m",
|
|
596
596
|
disabled: l = !1,
|
|
597
|
-
hint:
|
|
597
|
+
hint: m,
|
|
598
598
|
error: d,
|
|
599
599
|
...u
|
|
600
600
|
}) {
|
|
601
601
|
const p = () => {
|
|
602
602
|
if (l) return;
|
|
603
|
-
const
|
|
604
|
-
n == null || n(
|
|
603
|
+
const $ = Math.min(Number(t) + r, a);
|
|
604
|
+
n == null || n($);
|
|
605
605
|
}, h = () => {
|
|
606
606
|
if (l) return;
|
|
607
|
-
const
|
|
608
|
-
n == null || n(
|
|
609
|
-
},
|
|
607
|
+
const $ = Math.max(Number(t) - r, i);
|
|
608
|
+
n == null || n($);
|
|
609
|
+
}, f = ($) => {
|
|
610
610
|
if (l) return;
|
|
611
|
-
const B =
|
|
611
|
+
const B = $.target.value;
|
|
612
612
|
if (B === "") {
|
|
613
613
|
n == null || n(i);
|
|
614
614
|
return;
|
|
@@ -618,18 +618,18 @@ function Hs({
|
|
|
618
618
|
const T = Math.min(Math.max(y, i), a);
|
|
619
619
|
n == null || n(T);
|
|
620
620
|
}
|
|
621
|
-
},
|
|
621
|
+
}, _ = [
|
|
622
622
|
"ds-stepper-wrapper",
|
|
623
623
|
l && "ds-stepper-wrapper--disabled",
|
|
624
624
|
d && "ds-stepper-wrapper--error"
|
|
625
|
-
].filter(Boolean).join(" "),
|
|
625
|
+
].filter(Boolean).join(" "), j = [
|
|
626
626
|
"ds-stepper",
|
|
627
627
|
`ds-stepper--${o}`,
|
|
628
628
|
l && "ds-stepper--disabled"
|
|
629
|
-
].filter(Boolean).join(" "),
|
|
630
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
629
|
+
].filter(Boolean).join(" "), R = o === "xs" ? I[1] : o === "small" ? I[2] : I[3];
|
|
630
|
+
return /* @__PURE__ */ e.jsxs("div", { className: _, children: [
|
|
631
631
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
632
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
632
|
+
/* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
633
633
|
/* @__PURE__ */ e.jsx(
|
|
634
634
|
"button",
|
|
635
635
|
{
|
|
@@ -638,7 +638,7 @@ function Hs({
|
|
|
638
638
|
onClick: h,
|
|
639
639
|
disabled: l || t <= i,
|
|
640
640
|
"aria-label": "Decrease",
|
|
641
|
-
children: /* @__PURE__ */ e.jsx(Ye, { size:
|
|
641
|
+
children: /* @__PURE__ */ e.jsx(Ye, { size: R, strokeWidth: 1.5 })
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
644
|
/* @__PURE__ */ e.jsx(
|
|
@@ -647,7 +647,7 @@ function Hs({
|
|
|
647
647
|
type: "number",
|
|
648
648
|
className: "ds-stepper-input",
|
|
649
649
|
value: t,
|
|
650
|
-
onChange:
|
|
650
|
+
onChange: f,
|
|
651
651
|
min: i,
|
|
652
652
|
max: a,
|
|
653
653
|
step: r,
|
|
@@ -663,11 +663,11 @@ function Hs({
|
|
|
663
663
|
onClick: p,
|
|
664
664
|
disabled: l || t >= a,
|
|
665
665
|
"aria-label": "Increase",
|
|
666
|
-
children: /* @__PURE__ */ e.jsx(He, { size:
|
|
666
|
+
children: /* @__PURE__ */ e.jsx(He, { size: R, strokeWidth: 1.5 })
|
|
667
667
|
}
|
|
668
668
|
)
|
|
669
669
|
] }),
|
|
670
|
-
|
|
670
|
+
m && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: m }),
|
|
671
671
|
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
672
672
|
] });
|
|
673
673
|
}
|
|
@@ -688,19 +688,19 @@ function qs({
|
|
|
688
688
|
d && "ds-card--interactive"
|
|
689
689
|
].filter(Boolean).join(" ");
|
|
690
690
|
if (r) {
|
|
691
|
-
const
|
|
691
|
+
const f = (_) => {
|
|
692
692
|
if (o) {
|
|
693
|
-
|
|
693
|
+
_.preventDefault();
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
|
-
|
|
696
|
+
_.metaKey || _.ctrlKey || _.button === 1 || (_.preventDefault(), a == null || a(_));
|
|
697
697
|
};
|
|
698
698
|
return /* @__PURE__ */ e.jsx(
|
|
699
699
|
"a",
|
|
700
700
|
{
|
|
701
701
|
className: u,
|
|
702
702
|
href: o ? void 0 : r,
|
|
703
|
-
onClick:
|
|
703
|
+
onClick: f,
|
|
704
704
|
"aria-disabled": o ? "true" : void 0,
|
|
705
705
|
...l,
|
|
706
706
|
children: s
|
|
@@ -798,48 +798,52 @@ function et({
|
|
|
798
798
|
onClose: n,
|
|
799
799
|
size: i = "m",
|
|
800
800
|
scrollable: a = !1,
|
|
801
|
-
|
|
801
|
+
subHeader: r,
|
|
802
|
+
...o
|
|
802
803
|
}) {
|
|
803
|
-
const
|
|
804
|
-
!n ||
|
|
805
|
-
|
|
804
|
+
const l = E(null), m = K.useId(), [d, u] = D(!1), p = () => {
|
|
805
|
+
!n || d || (u(!0), setTimeout(() => {
|
|
806
|
+
u(!1), n();
|
|
806
807
|
}, fs));
|
|
807
808
|
};
|
|
808
809
|
M(() => {
|
|
809
|
-
const
|
|
810
|
-
$.key === "Escape" &&
|
|
811
|
-
},
|
|
812
|
-
|
|
810
|
+
const j = ($) => {
|
|
811
|
+
$.key === "Escape" && p();
|
|
812
|
+
}, R = ($) => {
|
|
813
|
+
l.current && !l.current.contains($.target) && p();
|
|
813
814
|
};
|
|
814
|
-
return document.addEventListener("keydown",
|
|
815
|
-
document.removeEventListener("keydown",
|
|
815
|
+
return document.addEventListener("keydown", j), document.addEventListener("mousedown", R), () => {
|
|
816
|
+
document.removeEventListener("keydown", j), document.removeEventListener("mousedown", R);
|
|
816
817
|
};
|
|
817
|
-
}, [n,
|
|
818
|
-
const
|
|
819
|
-
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay",
|
|
818
|
+
}, [n, d]);
|
|
819
|
+
const h = K.Children.toArray(s), f = h.find((j) => (j == null ? void 0 : j.type) === Ie), _ = 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(" "), ...o, children: /* @__PURE__ */ e.jsxs(
|
|
820
821
|
"div",
|
|
821
822
|
{
|
|
822
823
|
className: [`ds-modal ds-modal--${i}`, a && "ds-modal--scrollable"].filter(Boolean).join(" "),
|
|
823
|
-
ref:
|
|
824
|
+
ref: l,
|
|
824
825
|
role: "dialog",
|
|
825
826
|
"aria-modal": "true",
|
|
826
|
-
"aria-labelledby": t ?
|
|
827
|
+
"aria-labelledby": t ? m : void 0,
|
|
827
828
|
children: [
|
|
828
|
-
(t || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
829
|
-
t && /* @__PURE__ */ e.
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
829
|
+
(t || n || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
830
|
+
(t || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header-row", children: [
|
|
831
|
+
t && /* @__PURE__ */ e.jsx("h3", { id: m, className: "ds-modal__title", children: t }),
|
|
832
|
+
n && /* @__PURE__ */ e.jsx(
|
|
833
|
+
me,
|
|
834
|
+
{
|
|
835
|
+
variant: "ghost",
|
|
836
|
+
size: "small",
|
|
837
|
+
icon: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 }),
|
|
838
|
+
onClick: p,
|
|
839
|
+
"aria-label": "Close modal"
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
] }),
|
|
843
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: r })
|
|
840
844
|
] }),
|
|
841
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body", children:
|
|
842
|
-
|
|
845
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body", children: _ }),
|
|
846
|
+
f
|
|
843
847
|
]
|
|
844
848
|
}
|
|
845
849
|
) });
|
|
@@ -857,15 +861,15 @@ function ms({
|
|
|
857
861
|
className: o = "",
|
|
858
862
|
...l
|
|
859
863
|
}) {
|
|
860
|
-
const [
|
|
861
|
-
u ? a == null || a(!i) : d((
|
|
862
|
-
},
|
|
864
|
+
const [m, d] = D(n), u = i !== void 0, p = u ? i : m, h = () => {
|
|
865
|
+
u ? a == null || a(!i) : d((_) => !_);
|
|
866
|
+
}, f = [
|
|
863
867
|
"ds-code-accordion",
|
|
864
868
|
`ds-code-accordion--${r}`,
|
|
865
869
|
p && "ds-code-accordion--expanded",
|
|
866
870
|
o
|
|
867
871
|
].filter(Boolean).join(" ");
|
|
868
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
872
|
+
return /* @__PURE__ */ e.jsxs("div", { className: f, ...l, children: [
|
|
869
873
|
/* @__PURE__ */ e.jsxs(
|
|
870
874
|
"button",
|
|
871
875
|
{
|
|
@@ -910,7 +914,7 @@ function tt({ href: s, children: t, onClick: n, target: i, rel: a, ...r }) {
|
|
|
910
914
|
function nt({ children: s, size: t = "m", variant: n = "ghost", ...i }) {
|
|
911
915
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant: n }) : a) });
|
|
912
916
|
}
|
|
913
|
-
function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant: a = "ghost", disabled: r = !1, icon: o, href: l, ...
|
|
917
|
+
function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant: a = "ghost", disabled: r = !1, icon: o, href: l, ...m }) {
|
|
914
918
|
const d = o && !s, u = [
|
|
915
919
|
"ds-tab",
|
|
916
920
|
`ds-tab--${i}`,
|
|
@@ -922,12 +926,12 @@ function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant:
|
|
|
922
926
|
s
|
|
923
927
|
] });
|
|
924
928
|
if (l) {
|
|
925
|
-
const h = (
|
|
929
|
+
const h = (f) => {
|
|
926
930
|
if (r) {
|
|
927
|
-
|
|
931
|
+
f.preventDefault();
|
|
928
932
|
return;
|
|
929
933
|
}
|
|
930
|
-
|
|
934
|
+
f.metaKey || f.ctrlKey || f.button === 1 || (f.preventDefault(), n == null || n(f));
|
|
931
935
|
};
|
|
932
936
|
return /* @__PURE__ */ e.jsx(
|
|
933
937
|
"a",
|
|
@@ -938,7 +942,7 @@ function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant:
|
|
|
938
942
|
className: u,
|
|
939
943
|
href: r ? void 0 : l,
|
|
940
944
|
onClick: h,
|
|
941
|
-
...
|
|
945
|
+
...m,
|
|
942
946
|
children: p
|
|
943
947
|
}
|
|
944
948
|
);
|
|
@@ -951,18 +955,18 @@ function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant:
|
|
|
951
955
|
className: u,
|
|
952
956
|
onClick: n,
|
|
953
957
|
disabled: r,
|
|
954
|
-
...
|
|
958
|
+
...m,
|
|
955
959
|
children: p
|
|
956
960
|
}
|
|
957
961
|
);
|
|
958
962
|
}
|
|
959
963
|
function at({ options: s, value: t, onChange: n, size: i = "m", disabled: a = !1 }) {
|
|
960
|
-
const r = E(null), o = E(null), [l,
|
|
964
|
+
const r = E(null), o = E(null), [l, m] = D(!1), d = E(!1), u = E(null), p = E(null), h = () => {
|
|
961
965
|
if (!r.current) return;
|
|
962
|
-
const
|
|
963
|
-
if (!
|
|
964
|
-
const
|
|
965
|
-
o.current ? (o.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left =
|
|
966
|
+
const f = r.current.querySelector(`[data-value="${t}"]`);
|
|
967
|
+
if (!f) return;
|
|
968
|
+
const _ = r.current.getBoundingClientRect(), j = f.getBoundingClientRect(), R = j.left - _.left, $ = j.width;
|
|
969
|
+
o.current ? (o.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = R + "px", o.current.style.width = $ + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
966
970
|
if (!o.current || !r.current) return;
|
|
967
971
|
const B = r.current.querySelector(`[data-value="${t}"]`);
|
|
968
972
|
if (!B) return;
|
|
@@ -971,14 +975,14 @@ function at({ options: s, value: t, onChange: n, size: i = "m", disabled: a = !1
|
|
|
971
975
|
}));
|
|
972
976
|
};
|
|
973
977
|
return p.current = h, Ve(() => {
|
|
974
|
-
const
|
|
975
|
-
u.current = t, d.current = l &&
|
|
978
|
+
const f = u.current !== t;
|
|
979
|
+
u.current = t, d.current = l && f, h();
|
|
976
980
|
}), M(() => {
|
|
977
981
|
if (!r.current) return;
|
|
978
|
-
const
|
|
982
|
+
const f = new ResizeObserver(() => {
|
|
979
983
|
d.current = !1, p.current();
|
|
980
984
|
});
|
|
981
|
-
return
|
|
985
|
+
return f.observe(r.current), () => f.disconnect();
|
|
982
986
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
983
987
|
"div",
|
|
984
988
|
{
|
|
@@ -998,21 +1002,21 @@ function at({ options: s, value: t, onChange: n, size: i = "m", disabled: a = !1
|
|
|
998
1002
|
"aria-hidden": "true"
|
|
999
1003
|
}
|
|
1000
1004
|
),
|
|
1001
|
-
s.map((
|
|
1005
|
+
s.map((f) => /* @__PURE__ */ e.jsxs(
|
|
1002
1006
|
"button",
|
|
1003
1007
|
{
|
|
1004
1008
|
type: "button",
|
|
1005
|
-
"data-value":
|
|
1006
|
-
className: ["ds-seg__btn", t ===
|
|
1007
|
-
onClick: () => !a && n(
|
|
1008
|
-
"aria-pressed": t ===
|
|
1009
|
+
"data-value": f.value,
|
|
1010
|
+
className: ["ds-seg__btn", t === f.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1011
|
+
onClick: () => !a && n(f.value),
|
|
1012
|
+
"aria-pressed": t === f.value,
|
|
1009
1013
|
disabled: a,
|
|
1010
1014
|
children: [
|
|
1011
|
-
|
|
1012
|
-
|
|
1015
|
+
f.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: f.icon }),
|
|
1016
|
+
f.label
|
|
1013
1017
|
]
|
|
1014
1018
|
},
|
|
1015
|
-
|
|
1019
|
+
f.value
|
|
1016
1020
|
))
|
|
1017
1021
|
]
|
|
1018
1022
|
}
|
|
@@ -1027,8 +1031,8 @@ function Ee({
|
|
|
1027
1031
|
padding: r = "m",
|
|
1028
1032
|
...o
|
|
1029
1033
|
}) {
|
|
1030
|
-
const [l,
|
|
1031
|
-
d ? a == null || a(!i) :
|
|
1034
|
+
const [l, m] = D(n), d = i !== void 0, u = d ? i : l, p = () => {
|
|
1035
|
+
d ? a == null || a(!i) : m((f) => !f);
|
|
1032
1036
|
}, h = [
|
|
1033
1037
|
"ds-accordion",
|
|
1034
1038
|
`ds-accordion--${r}`,
|
|
@@ -1091,10 +1095,10 @@ function hs(s, t, n) {
|
|
|
1091
1095
|
return r === s.top ? "top" : r === a - s.bottom ? "bottom" : r === i - s.right ? "right" : "left";
|
|
1092
1096
|
}
|
|
1093
1097
|
function it({ children: s, content: t, position: n, ...i }) {
|
|
1094
|
-
const [a, r] = D(!1), [o, l] = D({ visibility: "hidden" }), [
|
|
1098
|
+
const [a, r] = D(!1), [o, l] = D({ visibility: "hidden" }), [m, d] = D(n || "top"), u = E(null), p = E(null), h = E(!1), f = () => {
|
|
1095
1099
|
if (!u.current || !p.current) return;
|
|
1096
|
-
const
|
|
1097
|
-
d(
|
|
1100
|
+
const j = u.current.getBoundingClientRect(), R = p.current.getBoundingClientRect(), $ = n || hs(j, R.height, R.width), { top: B, left: y, arrowOffset: T } = ps($, j, R);
|
|
1101
|
+
d($), l({
|
|
1098
1102
|
position: "fixed",
|
|
1099
1103
|
top: B,
|
|
1100
1104
|
left: y,
|
|
@@ -1105,22 +1109,22 @@ function it({ children: s, content: t, position: n, ...i }) {
|
|
|
1105
1109
|
if (M(() => {
|
|
1106
1110
|
if (!a) return;
|
|
1107
1111
|
l({ position: "fixed", visibility: "hidden" });
|
|
1108
|
-
const
|
|
1109
|
-
return window.addEventListener("scroll",
|
|
1110
|
-
cancelAnimationFrame(
|
|
1112
|
+
const j = requestAnimationFrame(f);
|
|
1113
|
+
return window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
1114
|
+
cancelAnimationFrame(j), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
1111
1115
|
};
|
|
1112
1116
|
}, [a, n]), M(() => {
|
|
1113
1117
|
if (!a) return;
|
|
1114
|
-
const
|
|
1115
|
-
u.current && !u.current.contains(
|
|
1118
|
+
const j = (R) => {
|
|
1119
|
+
u.current && !u.current.contains(R.target) && r(!1);
|
|
1116
1120
|
};
|
|
1117
|
-
return document.addEventListener("touchstart",
|
|
1121
|
+
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1118
1122
|
}, [a]), !t) return s;
|
|
1119
|
-
const
|
|
1123
|
+
const _ = a && /* @__PURE__ */ e.jsx(
|
|
1120
1124
|
"div",
|
|
1121
1125
|
{
|
|
1122
1126
|
ref: p,
|
|
1123
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1127
|
+
className: `ds-tooltip ds-tooltip--${m}`,
|
|
1124
1128
|
role: "tooltip",
|
|
1125
1129
|
style: o,
|
|
1126
1130
|
children: t
|
|
@@ -1138,12 +1142,12 @@ function it({ children: s, content: t, position: n, ...i }) {
|
|
|
1138
1142
|
h.current || r(!1);
|
|
1139
1143
|
},
|
|
1140
1144
|
onTouchStart: () => {
|
|
1141
|
-
h.current = !0, r((
|
|
1145
|
+
h.current = !0, r((j) => !j);
|
|
1142
1146
|
},
|
|
1143
1147
|
...i,
|
|
1144
1148
|
children: [
|
|
1145
1149
|
s,
|
|
1146
|
-
typeof document < "u" && pe.createPortal(
|
|
1150
|
+
typeof document < "u" && pe.createPortal(_, document.body)
|
|
1147
1151
|
]
|
|
1148
1152
|
}
|
|
1149
1153
|
);
|
|
@@ -1157,12 +1161,12 @@ function ot({
|
|
|
1157
1161
|
id: r,
|
|
1158
1162
|
...o
|
|
1159
1163
|
}) {
|
|
1160
|
-
const l = r || `toggle-${K.useId()}`,
|
|
1164
|
+
const l = r || `toggle-${K.useId()}`, m = [
|
|
1161
1165
|
"ds-toggle",
|
|
1162
1166
|
`ds-toggle--${n}`,
|
|
1163
1167
|
i && "ds-toggle--disabled"
|
|
1164
1168
|
].filter(Boolean).join(" ");
|
|
1165
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1169
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1166
1170
|
/* @__PURE__ */ e.jsx(
|
|
1167
1171
|
"input",
|
|
1168
1172
|
{
|
|
@@ -1188,12 +1192,12 @@ function lt({
|
|
|
1188
1192
|
id: r,
|
|
1189
1193
|
...o
|
|
1190
1194
|
}) {
|
|
1191
|
-
const l = r || `checkbox-${K.useId()}`,
|
|
1195
|
+
const l = r || `checkbox-${K.useId()}`, m = [
|
|
1192
1196
|
"ds-checkbox",
|
|
1193
1197
|
`ds-checkbox--${n}`,
|
|
1194
1198
|
i && "ds-checkbox--disabled"
|
|
1195
1199
|
].filter(Boolean).join(" "), d = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1196
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1200
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1197
1201
|
/* @__PURE__ */ e.jsx(
|
|
1198
1202
|
"input",
|
|
1199
1203
|
{
|
|
@@ -1226,7 +1230,7 @@ function ct({
|
|
|
1226
1230
|
name: r,
|
|
1227
1231
|
value: o,
|
|
1228
1232
|
id: l,
|
|
1229
|
-
...
|
|
1233
|
+
...m
|
|
1230
1234
|
}) {
|
|
1231
1235
|
const d = l || `radio-${K.useId()}`, u = [
|
|
1232
1236
|
"ds-radio",
|
|
@@ -1245,7 +1249,7 @@ function ct({
|
|
|
1245
1249
|
disabled: i,
|
|
1246
1250
|
name: r,
|
|
1247
1251
|
value: o,
|
|
1248
|
-
...
|
|
1252
|
+
...m
|
|
1249
1253
|
}
|
|
1250
1254
|
),
|
|
1251
1255
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
@@ -1295,7 +1299,7 @@ function bs(s) {
|
|
|
1295
1299
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1296
1300
|
}
|
|
1297
1301
|
function dt({ seed: s, icon: t, src: n, size: i = 32, className: a = "", style: r = {}, ...o }) {
|
|
1298
|
-
const l = js(s ?? ""), [
|
|
1302
|
+
const l = js(s ?? ""), [m, d] = D(!1), u = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: bs(s) });
|
|
1299
1303
|
return /* @__PURE__ */ e.jsx(
|
|
1300
1304
|
"div",
|
|
1301
1305
|
{
|
|
@@ -1303,7 +1307,7 @@ function dt({ seed: s, icon: t, src: n, size: i = 32, className: a = "", style:
|
|
|
1303
1307
|
style: { width: i, height: i, "--ds-avatar-h": l, ...r },
|
|
1304
1308
|
"aria-hidden": "true",
|
|
1305
1309
|
...o,
|
|
1306
|
-
children: n && !
|
|
1310
|
+
children: n && !m ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => d(!0) }) : u
|
|
1307
1311
|
}
|
|
1308
1312
|
);
|
|
1309
1313
|
}
|
|
@@ -1343,7 +1347,7 @@ function ft({ children: s, ...t }) {
|
|
|
1343
1347
|
function mt({ children: s, ...t }) {
|
|
1344
1348
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1345
1349
|
}
|
|
1346
|
-
function pt({ children: s, interactive: t, selected: n, subheader: i, exiting: a, updated: r, className: o = "", onClick: l, ...
|
|
1350
|
+
function pt({ children: s, interactive: t, selected: n, subheader: i, exiting: a, updated: r, className: o = "", onClick: l, ...m }) {
|
|
1347
1351
|
return /* @__PURE__ */ e.jsx(
|
|
1348
1352
|
"tr",
|
|
1349
1353
|
{
|
|
@@ -1357,7 +1361,7 @@ function pt({ children: s, interactive: t, selected: n, subheader: i, exiting: a
|
|
|
1357
1361
|
o
|
|
1358
1362
|
].filter(Boolean).join(" "),
|
|
1359
1363
|
onClick: l,
|
|
1360
|
-
...
|
|
1364
|
+
...m,
|
|
1361
1365
|
children: s
|
|
1362
1366
|
}
|
|
1363
1367
|
);
|
|
@@ -1366,13 +1370,13 @@ function ht({ children: s, colSpan: t = 999, ...n }) {
|
|
|
1366
1370
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1367
1371
|
}
|
|
1368
1372
|
function xt({ children: s, align: t = "left", sortDir: n, onSort: i, width: a, className: r = "", style: o = {}, ...l }) {
|
|
1369
|
-
const
|
|
1373
|
+
const m = !!i || n !== void 0, d = n === "asc" ? qe : n === "desc" ? he : Ke;
|
|
1370
1374
|
return /* @__PURE__ */ e.jsx(
|
|
1371
1375
|
"th",
|
|
1372
1376
|
{
|
|
1373
1377
|
className: [
|
|
1374
1378
|
"ds-th",
|
|
1375
|
-
|
|
1379
|
+
m ? "ds-th--sortable" : "",
|
|
1376
1380
|
n ? "ds-th--sorted" : "",
|
|
1377
1381
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1378
1382
|
r
|
|
@@ -1380,7 +1384,7 @@ function xt({ children: s, align: t = "left", sortDir: n, onSort: i, width: a, c
|
|
|
1380
1384
|
onClick: i,
|
|
1381
1385
|
style: { width: a, ...o },
|
|
1382
1386
|
...l,
|
|
1383
|
-
children:
|
|
1387
|
+
children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1384
1388
|
s,
|
|
1385
1389
|
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
|
|
1386
1390
|
] }) : s
|
|
@@ -1437,10 +1441,10 @@ function bt({
|
|
|
1437
1441
|
htmlFor: r,
|
|
1438
1442
|
children: o,
|
|
1439
1443
|
className: l = "",
|
|
1440
|
-
style:
|
|
1444
|
+
style: m,
|
|
1441
1445
|
...d
|
|
1442
1446
|
}) {
|
|
1443
|
-
const u = K.useId(), p = r ?? u, h = `${p}-hint`,
|
|
1447
|
+
const u = K.useId(), p = r ?? u, h = `${p}-hint`, f = `${p}-error`;
|
|
1444
1448
|
return /* @__PURE__ */ e.jsxs(
|
|
1445
1449
|
"div",
|
|
1446
1450
|
{
|
|
@@ -1448,19 +1452,19 @@ function bt({
|
|
|
1448
1452
|
"data-state": n ? "error" : void 0,
|
|
1449
1453
|
"data-required": i ? "" : void 0,
|
|
1450
1454
|
"data-disabled": a ? "" : void 0,
|
|
1451
|
-
style:
|
|
1455
|
+
style: m,
|
|
1452
1456
|
...d,
|
|
1453
1457
|
children: [
|
|
1454
1458
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1455
1459
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
|
|
1456
1460
|
t && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1457
|
-
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id:
|
|
1461
|
+
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: f, role: "alert", children: n })
|
|
1458
1462
|
]
|
|
1459
1463
|
}
|
|
1460
1464
|
);
|
|
1461
1465
|
}
|
|
1462
1466
|
function vt({ label: s, value: t, delta: n, size: i = "m", inline: a = !1, className: r = "", style: o, ...l }) {
|
|
1463
|
-
const
|
|
1467
|
+
const m = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1464
1468
|
return /* @__PURE__ */ e.jsxs(
|
|
1465
1469
|
"div",
|
|
1466
1470
|
{
|
|
@@ -1475,7 +1479,7 @@ function vt({ label: s, value: t, delta: n, size: i = "m", inline: a = !1, class
|
|
|
1475
1479
|
children: [
|
|
1476
1480
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1477
1481
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1478
|
-
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${
|
|
1482
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: n })
|
|
1479
1483
|
]
|
|
1480
1484
|
}
|
|
1481
1485
|
);
|
|
@@ -1496,10 +1500,10 @@ function Nt({
|
|
|
1496
1500
|
"aria-label": n,
|
|
1497
1501
|
style: a,
|
|
1498
1502
|
...r,
|
|
1499
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l,
|
|
1503
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1500
1504
|
l,
|
|
1501
|
-
|
|
1502
|
-
] },
|
|
1505
|
+
m < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
1506
|
+
] }, m)) })
|
|
1503
1507
|
}
|
|
1504
1508
|
);
|
|
1505
1509
|
}
|
|
@@ -1513,7 +1517,7 @@ function wt({
|
|
|
1513
1517
|
style: o,
|
|
1514
1518
|
...l
|
|
1515
1519
|
}) {
|
|
1516
|
-
const
|
|
1520
|
+
const m = vs(s, t, i);
|
|
1517
1521
|
return /* @__PURE__ */ e.jsxs(
|
|
1518
1522
|
"nav",
|
|
1519
1523
|
{
|
|
@@ -1532,7 +1536,7 @@ function wt({
|
|
|
1532
1536
|
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1533
1537
|
}
|
|
1534
1538
|
),
|
|
1535
|
-
|
|
1539
|
+
m.map(
|
|
1536
1540
|
(d, u) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${u}`) : /* @__PURE__ */ e.jsx(
|
|
1537
1541
|
"button",
|
|
1538
1542
|
{
|
|
@@ -1574,22 +1578,22 @@ function gt({
|
|
|
1574
1578
|
side: i = "right",
|
|
1575
1579
|
...a
|
|
1576
1580
|
}) {
|
|
1577
|
-
const r = E(null), o = K.useId(), [l,
|
|
1578
|
-
!n || l || (
|
|
1579
|
-
|
|
1581
|
+
const r = E(null), o = K.useId(), [l, m] = D(!1), d = () => {
|
|
1582
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
1583
|
+
m(!1), n();
|
|
1580
1584
|
}, Ns));
|
|
1581
1585
|
};
|
|
1582
1586
|
M(() => {
|
|
1583
|
-
const
|
|
1584
|
-
|
|
1585
|
-
},
|
|
1586
|
-
r.current && !r.current.contains(
|
|
1587
|
+
const f = (j) => {
|
|
1588
|
+
j.key === "Escape" && d();
|
|
1589
|
+
}, _ = (j) => {
|
|
1590
|
+
r.current && !r.current.contains(j.target) && d();
|
|
1587
1591
|
};
|
|
1588
|
-
return document.addEventListener("keydown",
|
|
1589
|
-
document.removeEventListener("keydown",
|
|
1592
|
+
return document.addEventListener("keydown", f), document.addEventListener("mousedown", _), () => {
|
|
1593
|
+
document.removeEventListener("keydown", f), document.removeEventListener("mousedown", _);
|
|
1590
1594
|
};
|
|
1591
1595
|
}, [n, l]);
|
|
1592
|
-
const u = K.Children.toArray(s), p = u.find((
|
|
1596
|
+
const u = K.Children.toArray(s), p = u.find((f) => (f == null ? void 0 : f.type) === Be), h = u.filter((f) => (f == null ? void 0 : f.type) !== Be);
|
|
1593
1597
|
return /* @__PURE__ */ e.jsx(
|
|
1594
1598
|
"div",
|
|
1595
1599
|
{
|
|
@@ -1635,12 +1639,12 @@ function yt({
|
|
|
1635
1639
|
role: r,
|
|
1636
1640
|
...o
|
|
1637
1641
|
}) {
|
|
1638
|
-
const l = ws[t],
|
|
1642
|
+
const l = ws[t], m = r || (t === "error" ? "alert" : "status");
|
|
1639
1643
|
return /* @__PURE__ */ e.jsxs(
|
|
1640
1644
|
"div",
|
|
1641
1645
|
{
|
|
1642
1646
|
className: `ds-banner ds-banner--${t}`,
|
|
1643
|
-
role:
|
|
1647
|
+
role: m,
|
|
1644
1648
|
...o,
|
|
1645
1649
|
children: [
|
|
1646
1650
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
@@ -1678,7 +1682,7 @@ function kt({
|
|
|
1678
1682
|
style: o,
|
|
1679
1683
|
...l
|
|
1680
1684
|
}) {
|
|
1681
|
-
const [
|
|
1685
|
+
const [m, d] = D(!1), [u, p] = D(!1), h = n !== void 0, f = h ? n : m, _ = E(null), j = E(null), R = E(null), $ = E(null), [B, y] = D({}), T = E(null), z = 150, A = () => {
|
|
1682
1686
|
if (h)
|
|
1683
1687
|
i == null || i(!1);
|
|
1684
1688
|
else {
|
|
@@ -1688,18 +1692,18 @@ function kt({
|
|
|
1688
1692
|
}, z);
|
|
1689
1693
|
}
|
|
1690
1694
|
}, Y = () => {
|
|
1691
|
-
const
|
|
1692
|
-
h ? i == null || i(
|
|
1695
|
+
const x = !f;
|
|
1696
|
+
h ? i == null || i(x) : x ? (clearTimeout(T.current), p(!1), d(!0)) : A();
|
|
1693
1697
|
}, H = () => {
|
|
1694
|
-
|
|
1698
|
+
f || (h ? i == null || i(!0) : (clearTimeout(T.current), p(!1), d(!0)));
|
|
1695
1699
|
};
|
|
1696
1700
|
M(() => () => clearTimeout(T.current), []), M(() => {
|
|
1697
|
-
if (!
|
|
1698
|
-
const
|
|
1701
|
+
if (!f) return;
|
|
1702
|
+
const x = 300, N = () => {
|
|
1699
1703
|
var G;
|
|
1700
|
-
const k = (G =
|
|
1704
|
+
const k = (G = _.current) == null ? void 0 : G.getBoundingClientRect();
|
|
1701
1705
|
if (!k) return;
|
|
1702
|
-
const P = window.innerHeight - k.bottom, q = P <
|
|
1706
|
+
const P = window.innerHeight - k.bottom, q = P < x + 8 && k.top > P;
|
|
1703
1707
|
y(
|
|
1704
1708
|
a === "right" ? q ? { bottom: window.innerHeight - k.top + 4, top: "auto", right: window.innerWidth - k.right } : { top: k.bottom + 4, bottom: "auto", right: window.innerWidth - k.right } : q ? { bottom: window.innerHeight - k.top + 4, top: "auto", left: k.left } : { top: k.bottom + 4, bottom: "auto", left: k.left }
|
|
1705
1709
|
);
|
|
@@ -1707,67 +1711,67 @@ function kt({
|
|
|
1707
1711
|
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
1708
1712
|
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
1709
1713
|
};
|
|
1710
|
-
}, [
|
|
1714
|
+
}, [f, a]);
|
|
1711
1715
|
const F = () => {
|
|
1712
1716
|
var N;
|
|
1713
|
-
const
|
|
1717
|
+
const x = (N = R.current) == null ? void 0 : N.querySelector(
|
|
1714
1718
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
1715
1719
|
);
|
|
1716
|
-
|
|
1720
|
+
x == null || x.focus();
|
|
1717
1721
|
};
|
|
1718
1722
|
M(() => {
|
|
1719
|
-
if (!
|
|
1720
|
-
const
|
|
1723
|
+
if (!f) return;
|
|
1724
|
+
const x = (k) => {
|
|
1721
1725
|
var P, q;
|
|
1722
|
-
!((P =
|
|
1726
|
+
!((P = _.current) != null && P.contains(k.target)) && !((q = j.current) != null && q.contains(k.target)) && A();
|
|
1723
1727
|
}, N = (k) => {
|
|
1724
1728
|
k.key === "Escape" && (A(), F());
|
|
1725
1729
|
};
|
|
1726
|
-
return document.addEventListener("mousedown",
|
|
1727
|
-
document.removeEventListener("mousedown",
|
|
1730
|
+
return document.addEventListener("mousedown", x), document.addEventListener("keydown", N), () => {
|
|
1731
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", N);
|
|
1728
1732
|
};
|
|
1729
|
-
}, [
|
|
1730
|
-
if (!
|
|
1731
|
-
const
|
|
1732
|
-
N == null || N.focus(),
|
|
1733
|
-
}, [
|
|
1734
|
-
const
|
|
1733
|
+
}, [f]), M(() => {
|
|
1734
|
+
if (!f || !$.current || !j.current) return;
|
|
1735
|
+
const x = v(), N = $.current === "last" ? x[x.length - 1] : x[0];
|
|
1736
|
+
N == null || N.focus(), $.current = null;
|
|
1737
|
+
}, [f]);
|
|
1738
|
+
const v = () => j.current ? [...j.current.querySelectorAll(
|
|
1735
1739
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1736
|
-
)] : [], C = (
|
|
1740
|
+
)] : [], C = (x) => {
|
|
1737
1741
|
var N, k;
|
|
1738
|
-
if (
|
|
1739
|
-
|
|
1740
|
-
else if (
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1742
|
+
if (x.key === "ArrowDown")
|
|
1743
|
+
x.preventDefault(), f ? (N = v()[0]) == null || N.focus() : ($.current = "first", H());
|
|
1744
|
+
else if (x.key === "ArrowUp")
|
|
1745
|
+
if (x.preventDefault(), !f)
|
|
1746
|
+
$.current = "last", H();
|
|
1743
1747
|
else {
|
|
1744
|
-
const P =
|
|
1748
|
+
const P = v();
|
|
1745
1749
|
(k = P[P.length - 1]) == null || k.focus();
|
|
1746
1750
|
}
|
|
1747
|
-
}, X = (
|
|
1751
|
+
}, X = (x) => {
|
|
1748
1752
|
var P, q, G, g;
|
|
1749
|
-
const N =
|
|
1750
|
-
switch (
|
|
1753
|
+
const N = v(), k = N.findIndex((c) => c === document.activeElement);
|
|
1754
|
+
switch (x.key) {
|
|
1751
1755
|
case "ArrowDown":
|
|
1752
|
-
|
|
1756
|
+
x.preventDefault(), (P = N[Math.min(k + 1, N.length - 1)]) == null || P.focus();
|
|
1753
1757
|
break;
|
|
1754
1758
|
case "ArrowUp":
|
|
1755
|
-
|
|
1759
|
+
x.preventDefault(), k <= 0 ? F() : (q = N[k - 1]) == null || q.focus();
|
|
1756
1760
|
break;
|
|
1757
1761
|
case "Home":
|
|
1758
|
-
|
|
1762
|
+
x.preventDefault(), (G = N[0]) == null || G.focus();
|
|
1759
1763
|
break;
|
|
1760
1764
|
case "End":
|
|
1761
|
-
|
|
1765
|
+
x.preventDefault(), (g = N[N.length - 1]) == null || g.focus();
|
|
1762
1766
|
break;
|
|
1763
1767
|
case "Tab":
|
|
1764
1768
|
A();
|
|
1765
1769
|
break;
|
|
1766
1770
|
}
|
|
1767
|
-
}, U =
|
|
1771
|
+
}, U = f && /* @__PURE__ */ e.jsx(
|
|
1768
1772
|
"div",
|
|
1769
1773
|
{
|
|
1770
|
-
ref:
|
|
1774
|
+
ref: j,
|
|
1771
1775
|
role: "menu",
|
|
1772
1776
|
className: [
|
|
1773
1777
|
"ds-dropdown__menu",
|
|
@@ -1776,32 +1780,32 @@ function kt({
|
|
|
1776
1780
|
].filter(Boolean).join(" "),
|
|
1777
1781
|
style: B,
|
|
1778
1782
|
onKeyDown: X,
|
|
1779
|
-
children: t.map((
|
|
1780
|
-
if (
|
|
1783
|
+
children: t.map((x, N) => {
|
|
1784
|
+
if (x.separator)
|
|
1781
1785
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, N);
|
|
1782
|
-
if (
|
|
1786
|
+
if (x.type === "section")
|
|
1783
1787
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
1784
|
-
|
|
1785
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
1788
|
+
x.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
|
|
1789
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
|
|
1786
1790
|
] }, N);
|
|
1787
|
-
const k = !!
|
|
1791
|
+
const k = !!x.href, P = k ? "a" : "button", q = k ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
|
|
1788
1792
|
return /* @__PURE__ */ e.jsxs(
|
|
1789
1793
|
P,
|
|
1790
1794
|
{
|
|
1791
1795
|
role: "menuitem",
|
|
1792
1796
|
className: [
|
|
1793
1797
|
"ds-dropdown__item",
|
|
1794
|
-
|
|
1798
|
+
x.danger && "ds-dropdown__item--danger"
|
|
1795
1799
|
].filter(Boolean).join(" "),
|
|
1796
1800
|
...q,
|
|
1797
1801
|
onClick: () => {
|
|
1798
1802
|
var G;
|
|
1799
|
-
(G =
|
|
1803
|
+
(G = x.onClick) == null || G.call(x), A();
|
|
1800
1804
|
},
|
|
1801
1805
|
children: [
|
|
1802
|
-
|
|
1803
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
1804
|
-
|
|
1806
|
+
x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
1807
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: x.label }),
|
|
1808
|
+
x.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: x.shortcut })
|
|
1805
1809
|
]
|
|
1806
1810
|
},
|
|
1807
1811
|
N
|
|
@@ -1812,7 +1816,7 @@ function kt({
|
|
|
1812
1816
|
return /* @__PURE__ */ e.jsxs(
|
|
1813
1817
|
"div",
|
|
1814
1818
|
{
|
|
1815
|
-
ref:
|
|
1819
|
+
ref: _,
|
|
1816
1820
|
className: ["ds-dropdown", r].filter(Boolean).join(" "),
|
|
1817
1821
|
style: o,
|
|
1818
1822
|
...l,
|
|
@@ -1820,7 +1824,7 @@ function kt({
|
|
|
1820
1824
|
/* @__PURE__ */ e.jsx(
|
|
1821
1825
|
"div",
|
|
1822
1826
|
{
|
|
1823
|
-
ref:
|
|
1827
|
+
ref: R,
|
|
1824
1828
|
className: "ds-dropdown__trigger",
|
|
1825
1829
|
onClick: Y,
|
|
1826
1830
|
onKeyDown: C,
|
|
@@ -1840,7 +1844,7 @@ function Et({
|
|
|
1840
1844
|
min: a = 2,
|
|
1841
1845
|
animate: r = !0
|
|
1842
1846
|
}) {
|
|
1843
|
-
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o),
|
|
1847
|
+
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m = n === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : n;
|
|
1844
1848
|
return /* @__PURE__ */ e.jsxs(
|
|
1845
1849
|
"div",
|
|
1846
1850
|
{
|
|
@@ -1857,7 +1861,7 @@ function Et({
|
|
|
1857
1861
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
1858
1862
|
"div",
|
|
1859
1863
|
{
|
|
1860
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
1864
|
+
className: `ds-progress__fill ds-progress__fill--${m}`,
|
|
1861
1865
|
style: { width: `${l}%` }
|
|
1862
1866
|
}
|
|
1863
1867
|
) }),
|
|
@@ -1879,10 +1883,10 @@ function ks(s, { duration: t = 600 } = {}) {
|
|
|
1879
1883
|
}
|
|
1880
1884
|
const o = a.current, l = s - o;
|
|
1881
1885
|
if (l === 0) return;
|
|
1882
|
-
let
|
|
1886
|
+
let m = null;
|
|
1883
1887
|
const d = (u) => {
|
|
1884
|
-
|
|
1885
|
-
const p = Math.min((u -
|
|
1888
|
+
m || (m = u);
|
|
1889
|
+
const p = Math.min((u - m) / t, 1);
|
|
1886
1890
|
i(o + l * gs(p)), p < 1 ? r.current = requestAnimationFrame(d) : a.current = s;
|
|
1887
1891
|
};
|
|
1888
1892
|
return r.current = requestAnimationFrame(d), () => cancelAnimationFrame(r.current);
|
|
@@ -1904,8 +1908,8 @@ function Es({ threshold: s = 0.1, rootMargin: t = "0px", once: n = !1 } = {}) {
|
|
|
1904
1908
|
const o = i.current;
|
|
1905
1909
|
if (!o) return;
|
|
1906
1910
|
const l = new IntersectionObserver(
|
|
1907
|
-
([
|
|
1908
|
-
|
|
1911
|
+
([m]) => {
|
|
1912
|
+
m.isIntersecting ? (r(!0), n && l.disconnect()) : n || r(!1);
|
|
1909
1913
|
},
|
|
1910
1914
|
{ threshold: s, rootMargin: t }
|
|
1911
1915
|
);
|
|
@@ -1922,10 +1926,10 @@ function Tt({
|
|
|
1922
1926
|
onLeave: o,
|
|
1923
1927
|
...l
|
|
1924
1928
|
}) {
|
|
1925
|
-
const { ref:
|
|
1929
|
+
const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once: n }), u = E(!1);
|
|
1926
1930
|
return M(() => {
|
|
1927
1931
|
d && !u.current && (r == null || r()), !d && u.current && (o == null || o()), u.current = d;
|
|
1928
|
-
}, [d]), /* @__PURE__ */ e.jsx(t, { ref:
|
|
1932
|
+
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1929
1933
|
}
|
|
1930
1934
|
const Me = {
|
|
1931
1935
|
default: ke,
|
|
@@ -2010,7 +2014,7 @@ function Dt({
|
|
|
2010
2014
|
expanded: r,
|
|
2011
2015
|
onToggle: o,
|
|
2012
2016
|
children: l,
|
|
2013
|
-
className:
|
|
2017
|
+
className: m = "",
|
|
2014
2018
|
...d
|
|
2015
2019
|
}) {
|
|
2016
2020
|
const u = t === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
@@ -2022,7 +2026,7 @@ function Dt({
|
|
|
2022
2026
|
return l ? /* @__PURE__ */ e.jsx(
|
|
2023
2027
|
"div",
|
|
2024
2028
|
{
|
|
2025
|
-
className: ["ds-tool-card", u && "ds-tool-card--running",
|
|
2029
|
+
className: ["ds-tool-card", u && "ds-tool-card--running", m].filter(Boolean).join(" "),
|
|
2026
2030
|
...d,
|
|
2027
2031
|
children: /* @__PURE__ */ e.jsx(
|
|
2028
2032
|
Ee,
|
|
@@ -2039,7 +2043,7 @@ function Dt({
|
|
|
2039
2043
|
) : /* @__PURE__ */ e.jsx(
|
|
2040
2044
|
"div",
|
|
2041
2045
|
{
|
|
2042
|
-
className: ["ds-tool-card", "ds-tool-card--bubble",
|
|
2046
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", m].filter(Boolean).join(" "),
|
|
2043
2047
|
...d,
|
|
2044
2048
|
children: p
|
|
2045
2049
|
}
|
|
@@ -2052,8 +2056,8 @@ function Ds({
|
|
|
2052
2056
|
"aria-label": i = "Copy to clipboard",
|
|
2053
2057
|
...a
|
|
2054
2058
|
}) {
|
|
2055
|
-
const [r, o] = D(!1), l = (
|
|
2056
|
-
|
|
2059
|
+
const [r, o] = D(!1), l = (m) => {
|
|
2060
|
+
m.currentTarget.blur(), navigator.clipboard.writeText(s).then(() => {
|
|
2057
2061
|
o(!0), setTimeout(() => o(!1), n);
|
|
2058
2062
|
});
|
|
2059
2063
|
};
|
|
@@ -2103,8 +2107,8 @@ function It({
|
|
|
2103
2107
|
...l
|
|
2104
2108
|
}) {
|
|
2105
2109
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", r].filter(Boolean).join(" "), ...l, children: [
|
|
2106
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (
|
|
2107
|
-
const u = d === t, p = n.includes(d) && !u, h = i && (d <= t || n.includes(d)),
|
|
2110
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, d) => {
|
|
2111
|
+
const u = d === t, p = n.includes(d) && !u, h = i && (d <= t || n.includes(d)), f = [
|
|
2108
2112
|
"ds-step-indicator__dot",
|
|
2109
2113
|
u && "ds-step-indicator__dot--active",
|
|
2110
2114
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2113,7 +2117,7 @@ function It({
|
|
|
2113
2117
|
"button",
|
|
2114
2118
|
{
|
|
2115
2119
|
type: "button",
|
|
2116
|
-
className:
|
|
2120
|
+
className: f,
|
|
2117
2121
|
role: "tab",
|
|
2118
2122
|
"aria-selected": u,
|
|
2119
2123
|
"aria-label": `Step ${d + 1}`,
|
|
@@ -2157,17 +2161,17 @@ function Mt({
|
|
|
2157
2161
|
className: o = "",
|
|
2158
2162
|
...l
|
|
2159
2163
|
}) {
|
|
2160
|
-
const
|
|
2164
|
+
const m = [
|
|
2161
2165
|
"ds-chat-message",
|
|
2162
2166
|
`ds-chat-message--${s}`,
|
|
2163
2167
|
a && "ds-chat-message--streaming",
|
|
2164
2168
|
o
|
|
2165
2169
|
].filter(Boolean).join(" ");
|
|
2166
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2170
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: r }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2167
2171
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2168
2172
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: r }),
|
|
2169
2173
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2170
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2174
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2171
2175
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2172
2176
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2173
2177
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: r }),
|
|
@@ -2198,33 +2202,33 @@ function As({
|
|
|
2198
2202
|
betweenTime: r = 380,
|
|
2199
2203
|
manualPauseMs: o = 5e3
|
|
2200
2204
|
}) {
|
|
2201
|
-
const [l,
|
|
2205
|
+
const [l, m] = D(0), [d, u] = D(""), p = E("typing"), h = E(0), f = E(0), _ = E(null), j = E(0);
|
|
2202
2206
|
M(() => {
|
|
2203
|
-
|
|
2207
|
+
f.current = l;
|
|
2204
2208
|
}, [l]), M(() => {
|
|
2205
|
-
if (
|
|
2209
|
+
if (_.current && (clearTimeout(_.current), _.current = null), !t || s.length === 0) {
|
|
2206
2210
|
u(""), h.current = 0, p.current = "typing";
|
|
2207
2211
|
return;
|
|
2208
2212
|
}
|
|
2209
2213
|
const T = () => {
|
|
2210
2214
|
const z = Date.now();
|
|
2211
|
-
if (
|
|
2212
|
-
|
|
2215
|
+
if (j.current > z) {
|
|
2216
|
+
_.current = setTimeout(T, j.current - z);
|
|
2213
2217
|
return;
|
|
2214
2218
|
}
|
|
2215
|
-
const A = s[
|
|
2216
|
-
p.current === "typing" ? (h.current += 1, u(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding",
|
|
2219
|
+
const A = s[f.current % s.length] ?? "";
|
|
2220
|
+
p.current === "typing" ? (h.current += 1, u(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", _.current = setTimeout(T, a)) : _.current = setTimeout(T, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", _.current = setTimeout(T, i)) : (h.current = Math.max(0, h.current - 1), u(A.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", f.current = (f.current + 1) % s.length, m(f.current), _.current = setTimeout(T, r)) : _.current = setTimeout(T, i));
|
|
2217
2221
|
};
|
|
2218
|
-
return
|
|
2219
|
-
|
|
2222
|
+
return _.current = setTimeout(T, 260), () => {
|
|
2223
|
+
_.current && clearTimeout(_.current);
|
|
2220
2224
|
};
|
|
2221
2225
|
}, [t, s, n, i, a, r]);
|
|
2222
|
-
const
|
|
2226
|
+
const R = (T) => {
|
|
2223
2227
|
if (s.length === 0) return;
|
|
2224
2228
|
const z = (T % s.length + s.length) % s.length, A = s[z];
|
|
2225
|
-
|
|
2226
|
-
},
|
|
2227
|
-
return { displayed: d, currentPrompt: y, index: l, next:
|
|
2229
|
+
f.current = z, h.current = A.length, p.current = "holding", j.current = Date.now() + o, m(z), u(A);
|
|
2230
|
+
}, $ = () => R(f.current + 1), B = () => R(f.current - 1), y = s[l % s.length] ?? "";
|
|
2231
|
+
return { displayed: d, currentPrompt: y, index: l, next: $, prev: B };
|
|
2228
2232
|
}
|
|
2229
2233
|
let Is = 0;
|
|
2230
2234
|
function Lt({
|
|
@@ -2236,92 +2240,92 @@ function Lt({
|
|
|
2236
2240
|
loading: r = !1,
|
|
2237
2241
|
disabled: o = !1,
|
|
2238
2242
|
placeholder: l = "Let's get things done...",
|
|
2239
|
-
animatedPlaceholders:
|
|
2243
|
+
animatedPlaceholders: m,
|
|
2240
2244
|
attachments: d,
|
|
2241
2245
|
images: u,
|
|
2242
2246
|
onAttachFiles: p,
|
|
2243
2247
|
onAttachImages: h,
|
|
2244
|
-
onRemoveAttachment:
|
|
2245
|
-
onRemoveImage:
|
|
2246
|
-
acceptImage:
|
|
2247
|
-
acceptFile:
|
|
2248
|
-
maxImages:
|
|
2248
|
+
onRemoveAttachment: f,
|
|
2249
|
+
onRemoveImage: _,
|
|
2250
|
+
acceptImage: j,
|
|
2251
|
+
acceptFile: R,
|
|
2252
|
+
maxImages: $,
|
|
2249
2253
|
maxImageSize: B,
|
|
2250
2254
|
leftSlot: y,
|
|
2251
2255
|
rightSlot: T,
|
|
2252
2256
|
className: z = "",
|
|
2253
2257
|
...A
|
|
2254
2258
|
}) {
|
|
2255
|
-
const Y = E(null), H = E(null), F = E(0), [
|
|
2256
|
-
const
|
|
2257
|
-
U((V) => [...V, { id:
|
|
2258
|
-
}, N = (
|
|
2259
|
-
const
|
|
2260
|
-
let ee = 0, oe =
|
|
2261
|
-
for (const se of
|
|
2262
|
-
q(se) ? B && se.size > B ? J.push(se.name) : oe > 0 ? (
|
|
2263
|
-
return { imageFiles:
|
|
2264
|
-
}, c = (
|
|
2265
|
-
const { imageFiles:
|
|
2266
|
-
J.length &&
|
|
2267
|
-
const oe = V.concat(h ? [] :
|
|
2259
|
+
const Y = E(null), H = E(null), F = E(0), [v, C] = D(!1), [X, U] = D([]), x = (b) => {
|
|
2260
|
+
const S = ++Is;
|
|
2261
|
+
U((V) => [...V, { id: S, msg: b }]), setTimeout(() => U((V) => V.filter((J) => J.id !== S)), 6e3);
|
|
2262
|
+
}, N = (b) => U((S) => S.filter((V) => V.id !== b)), k = (b) => b.type.startsWith("image/"), P = () => !0, q = j ?? k, G = R ?? P, g = (b) => {
|
|
2263
|
+
const S = [], V = [], J = [], Z = [];
|
|
2264
|
+
let ee = 0, oe = $ != null ? $ - ((u == null ? void 0 : u.length) ?? 0) : 1 / 0;
|
|
2265
|
+
for (const se of b)
|
|
2266
|
+
q(se) ? B && se.size > B ? J.push(se.name) : oe > 0 ? (S.push(se), oe--) : ee++ : G(se) ? V.push(se) : Z.push(se.name);
|
|
2267
|
+
return { imageFiles: S, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2268
|
+
}, c = (b) => {
|
|
2269
|
+
const { imageFiles: S, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(b);
|
|
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 oe = V.concat(h ? [] : S);
|
|
2268
2272
|
p && oe.length && p(oe);
|
|
2269
2273
|
};
|
|
2270
2274
|
M(() => {
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2275
|
+
const b = H.current;
|
|
2276
|
+
b && (b.style.height = "auto", b.style.height = `${Math.min(b.scrollHeight, 200)}px`);
|
|
2273
2277
|
}, [s]), M(() => {
|
|
2274
|
-
const
|
|
2278
|
+
const b = (S) => {
|
|
2275
2279
|
var J, Z, ee;
|
|
2276
2280
|
if (r || o) return;
|
|
2277
|
-
const V = (J =
|
|
2278
|
-
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (Z =
|
|
2281
|
+
const V = (J = S.target) == null ? void 0 : J.tagName;
|
|
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();
|
|
2279
2283
|
};
|
|
2280
|
-
return document.addEventListener("keydown",
|
|
2284
|
+
return document.addEventListener("keydown", b), () => document.removeEventListener("keydown", b);
|
|
2281
2285
|
}, [r, o]);
|
|
2282
|
-
const w = (
|
|
2283
|
-
|
|
2284
|
-
}, L = (
|
|
2285
|
-
|
|
2286
|
-
}, O = (
|
|
2287
|
-
|
|
2288
|
-
const
|
|
2289
|
-
|
|
2290
|
-
}, ae = (
|
|
2291
|
-
const
|
|
2292
|
-
Y.current && (Y.current.value = ""),
|
|
2293
|
-
}, W = (
|
|
2286
|
+
const w = (b) => {
|
|
2287
|
+
b.preventDefault(), F.current++, b.dataTransfer.types.includes("Files") && C(!0);
|
|
2288
|
+
}, L = (b) => {
|
|
2289
|
+
b.preventDefault(), F.current--, F.current === 0 && C(!1);
|
|
2290
|
+
}, O = (b) => b.preventDefault(), te = (b) => {
|
|
2291
|
+
b.preventDefault(), F.current = 0, C(!1);
|
|
2292
|
+
const S = Array.from(b.dataTransfer.files);
|
|
2293
|
+
S.length && c(S);
|
|
2294
|
+
}, ae = (b) => {
|
|
2295
|
+
const S = Array.from(b.target.files || []);
|
|
2296
|
+
Y.current && (Y.current.value = ""), S.length && c(S);
|
|
2297
|
+
}, W = (b) => {
|
|
2294
2298
|
var se;
|
|
2295
2299
|
if (!h) return;
|
|
2296
|
-
const
|
|
2297
|
-
if (!
|
|
2300
|
+
const S = (se = b.clipboardData) == null ? void 0 : se.items;
|
|
2301
|
+
if (!S) return;
|
|
2298
2302
|
const V = [];
|
|
2299
|
-
for (const Ue of
|
|
2303
|
+
for (const Ue of S) {
|
|
2300
2304
|
const Te = Ue.getAsFile();
|
|
2301
2305
|
Te && V.push(Te);
|
|
2302
2306
|
}
|
|
2303
2307
|
if (V.length === 0) return;
|
|
2304
2308
|
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: oe } = g(V);
|
|
2305
|
-
Z.length &&
|
|
2306
|
-
}, Q = !r && !o && !!(
|
|
2307
|
-
prompts:
|
|
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(", ")}`), oe && x(`Max ${$} images per message`), J.length && (b.preventDefault(), h(J));
|
|
2310
|
+
}, Q = !r && !o && !!(m != null && m.length) && s.length === 0, ie = As({
|
|
2311
|
+
prompts: m ?? [],
|
|
2308
2312
|
enabled: Q
|
|
2309
|
-
}), xe = (
|
|
2313
|
+
}), xe = (b) => {
|
|
2310
2314
|
if (Q) {
|
|
2311
|
-
if (
|
|
2312
|
-
|
|
2315
|
+
if (b.key === "ArrowDown" || b.key === "ArrowRight") {
|
|
2316
|
+
b.preventDefault(), ie.next();
|
|
2313
2317
|
return;
|
|
2314
2318
|
}
|
|
2315
|
-
if (
|
|
2316
|
-
|
|
2319
|
+
if (b.key === "ArrowUp" || b.key === "ArrowLeft") {
|
|
2320
|
+
b.preventDefault(), ie.prev();
|
|
2317
2321
|
return;
|
|
2318
2322
|
}
|
|
2319
|
-
if (
|
|
2320
|
-
|
|
2323
|
+
if (b.key === "Tab" && !b.shiftKey) {
|
|
2324
|
+
b.preventDefault(), t == null || t(ie.currentPrompt);
|
|
2321
2325
|
return;
|
|
2322
2326
|
}
|
|
2323
2327
|
}
|
|
2324
|
-
a == null || a(
|
|
2328
|
+
a == null || a(b);
|
|
2325
2329
|
}, Ce = (s.trim() || (u == null ? void 0 : u.length) > 0 || (d == null ? void 0 : d.length) > 0) && !o, $e = p || h;
|
|
2326
2330
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", z].filter(Boolean).join(" "), ...A, children: [
|
|
2327
2331
|
$e && /* @__PURE__ */ e.jsx(
|
|
@@ -2338,19 +2342,19 @@ function Lt({
|
|
|
2338
2342
|
/* @__PURE__ */ e.jsxs(
|
|
2339
2343
|
"div",
|
|
2340
2344
|
{
|
|
2341
|
-
className: ["ds-prompt-input__box",
|
|
2345
|
+
className: ["ds-prompt-input__box", v && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2342
2346
|
onDragEnter: w,
|
|
2343
2347
|
onDragLeave: L,
|
|
2344
2348
|
onDragOver: O,
|
|
2345
2349
|
onDrop: te,
|
|
2346
2350
|
children: [
|
|
2347
|
-
|
|
2351
|
+
v && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2348
2352
|
/* @__PURE__ */ e.jsx(
|
|
2349
2353
|
"textarea",
|
|
2350
2354
|
{
|
|
2351
2355
|
ref: H,
|
|
2352
2356
|
value: s,
|
|
2353
|
-
onChange: (
|
|
2357
|
+
onChange: (b) => t == null ? void 0 : t(b.target.value),
|
|
2354
2358
|
onKeyDown: xe,
|
|
2355
2359
|
onPaste: W,
|
|
2356
2360
|
placeholder: Q ? "" : l,
|
|
@@ -2363,45 +2367,45 @@ function Lt({
|
|
|
2363
2367
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
|
|
2364
2368
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2365
2369
|
] }),
|
|
2366
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((
|
|
2367
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2370
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: u.map((b, S) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2371
|
+
/* @__PURE__ */ e.jsx("img", { src: b.preview, alt: "" }),
|
|
2368
2372
|
/* @__PURE__ */ e.jsx(
|
|
2369
2373
|
"button",
|
|
2370
2374
|
{
|
|
2371
2375
|
className: "ds-prompt-input__image-remove",
|
|
2372
|
-
onClick: () =>
|
|
2376
|
+
onClick: () => _ == null ? void 0 : _(S),
|
|
2373
2377
|
"aria-label": "Remove image",
|
|
2374
2378
|
type: "button",
|
|
2375
2379
|
children: /* @__PURE__ */ e.jsx(re, { size: 12, strokeWidth: 2 })
|
|
2376
2380
|
}
|
|
2377
2381
|
)
|
|
2378
|
-
] },
|
|
2379
|
-
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((
|
|
2380
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2382
|
+
] }, S)) }),
|
|
2383
|
+
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((b) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2384
|
+
/* @__PURE__ */ e.jsx("span", { children: b.msg }),
|
|
2381
2385
|
/* @__PURE__ */ e.jsx(
|
|
2382
2386
|
"button",
|
|
2383
2387
|
{
|
|
2384
2388
|
type: "button",
|
|
2385
2389
|
className: "ds-prompt-input__warning-close",
|
|
2386
|
-
onClick: () => N(
|
|
2390
|
+
onClick: () => N(b.id),
|
|
2387
2391
|
"aria-label": "Dismiss",
|
|
2388
2392
|
children: /* @__PURE__ */ e.jsx(re, { size: I[1], strokeWidth: 1.5 })
|
|
2389
2393
|
}
|
|
2390
2394
|
)
|
|
2391
|
-
] },
|
|
2392
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2395
|
+
] }, b.id)) }),
|
|
2396
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((b, S) => /* @__PURE__ */ e.jsx(ce, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2397
|
+
b.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: I[1], strokeWidth: 1.5 }),
|
|
2398
|
+
b.filename,
|
|
2399
|
+
b.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2396
2400
|
"button",
|
|
2397
2401
|
{
|
|
2398
2402
|
type: "button",
|
|
2399
2403
|
className: "ds-prompt-input__remove-btn",
|
|
2400
|
-
onClick: () =>
|
|
2404
|
+
onClick: () => f == null ? void 0 : f(S),
|
|
2401
2405
|
children: /* @__PURE__ */ e.jsx(re, { size: I[1], strokeWidth: 1.5 })
|
|
2402
2406
|
}
|
|
2403
2407
|
)
|
|
2404
|
-
] }) },
|
|
2408
|
+
] }) }, S)) }),
|
|
2405
2409
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2406
2410
|
$e && /* @__PURE__ */ e.jsx(
|
|
2407
2411
|
me,
|
|
@@ -2411,8 +2415,8 @@ function Lt({
|
|
|
2411
2415
|
icon: /* @__PURE__ */ e.jsx(Re, { size: I[2], strokeWidth: 1.5 }),
|
|
2412
2416
|
"aria-label": "Attach files",
|
|
2413
2417
|
onClick: () => {
|
|
2414
|
-
var
|
|
2415
|
-
return (
|
|
2418
|
+
var b;
|
|
2419
|
+
return (b = Y.current) == null ? void 0 : b.click();
|
|
2416
2420
|
}
|
|
2417
2421
|
}
|
|
2418
2422
|
),
|
|
@@ -2455,60 +2459,60 @@ function zt({
|
|
|
2455
2459
|
showAutoOption: r = !1,
|
|
2456
2460
|
groupByTier: o = !0,
|
|
2457
2461
|
className: l = "",
|
|
2458
|
-
...
|
|
2462
|
+
...m
|
|
2459
2463
|
}) {
|
|
2460
|
-
const [d, u] = D(!1), p = E(null), h = E(null),
|
|
2464
|
+
const [d, u] = D(!1), p = E(null), h = E(null), f = E(null), [_, 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;
|
|
2461
2465
|
M(() => {
|
|
2462
2466
|
if (!d) return;
|
|
2463
|
-
const
|
|
2467
|
+
const v = 320, C = () => {
|
|
2464
2468
|
var P;
|
|
2465
|
-
const
|
|
2466
|
-
if (!
|
|
2467
|
-
const N = window.innerHeight -
|
|
2468
|
-
|
|
2469
|
+
const x = (P = h.current) == null ? void 0 : P.getBoundingClientRect();
|
|
2470
|
+
if (!x) return;
|
|
2471
|
+
const N = window.innerHeight - x.bottom, k = N < v + 8 && x.top > N;
|
|
2472
|
+
j({
|
|
2469
2473
|
position: "fixed",
|
|
2470
2474
|
zIndex: "var(--z-dropdown, 500)",
|
|
2471
|
-
left:
|
|
2472
|
-
...k ? { bottom: window.innerHeight -
|
|
2475
|
+
left: x.left,
|
|
2476
|
+
...k ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
|
|
2473
2477
|
});
|
|
2474
2478
|
};
|
|
2475
2479
|
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
2476
|
-
const X = (
|
|
2480
|
+
const X = (x) => {
|
|
2477
2481
|
var N, k;
|
|
2478
|
-
!((N = p.current) != null && N.contains(
|
|
2479
|
-
}, U = (
|
|
2480
|
-
|
|
2482
|
+
!((N = p.current) != null && N.contains(x.target)) && !((k = f.current) != null && k.contains(x.target)) && u(!1);
|
|
2483
|
+
}, U = (x) => {
|
|
2484
|
+
x.key === "Escape" && u(!1);
|
|
2481
2485
|
};
|
|
2482
2486
|
return document.addEventListener("mousedown", X), document.addEventListener("keydown", U), () => {
|
|
2483
2487
|
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", X), document.removeEventListener("keydown", U);
|
|
2484
2488
|
};
|
|
2485
2489
|
}, [d]);
|
|
2486
|
-
const A = (
|
|
2487
|
-
n == null || n(
|
|
2488
|
-
}, Y = (
|
|
2490
|
+
const A = (v) => {
|
|
2491
|
+
n == null || n(v), u(!1);
|
|
2492
|
+
}, Y = (v) => /* @__PURE__ */ e.jsxs(
|
|
2489
2493
|
"button",
|
|
2490
2494
|
{
|
|
2491
2495
|
type: "button",
|
|
2492
2496
|
className: [
|
|
2493
2497
|
"ds-model-picker__item",
|
|
2494
|
-
|
|
2498
|
+
v.name === t && "ds-model-picker__item--active"
|
|
2495
2499
|
].filter(Boolean).join(" "),
|
|
2496
|
-
onClick: () => A(
|
|
2500
|
+
onClick: () => A(v.name),
|
|
2497
2501
|
children: [
|
|
2498
|
-
|
|
2499
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
2500
|
-
z &&
|
|
2502
|
+
v.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: v.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2503
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: v.displayName || v.name }),
|
|
2504
|
+
z && v.tier && /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: Le[v.tier] || "default", children: v.tier })
|
|
2501
2505
|
]
|
|
2502
2506
|
},
|
|
2503
|
-
|
|
2504
|
-
), H = () => !o || !z ? B.map(Y) : ["fast", "standard", "premium"].flatMap((
|
|
2505
|
-
const C = B.filter((X) => X.tier ===
|
|
2507
|
+
v.name
|
|
2508
|
+
), H = () => !o || !z ? B.map(Y) : ["fast", "standard", "premium"].flatMap((v) => {
|
|
2509
|
+
const C = B.filter((X) => X.tier === v);
|
|
2506
2510
|
return C.length ? [
|
|
2507
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
2511
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": v, children: v.charAt(0).toUpperCase() + v.slice(1) }, `lbl-${v}`),
|
|
2508
2512
|
...C.map(Y)
|
|
2509
2513
|
] : [];
|
|
2510
|
-
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref:
|
|
2511
|
-
r &&
|
|
2514
|
+
}), F = d && /* @__PURE__ */ e.jsxs("div", { ref: f, className: "ds-model-picker__menu", style: _, children: [
|
|
2515
|
+
r && $ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2512
2516
|
/* @__PURE__ */ e.jsxs(
|
|
2513
2517
|
"button",
|
|
2514
2518
|
{
|
|
@@ -2534,7 +2538,7 @@ function zt({
|
|
|
2534
2538
|
{
|
|
2535
2539
|
ref: p,
|
|
2536
2540
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2537
|
-
...
|
|
2541
|
+
...m,
|
|
2538
2542
|
children: [
|
|
2539
2543
|
/* @__PURE__ */ e.jsxs(
|
|
2540
2544
|
"button",
|
|
@@ -2542,7 +2546,7 @@ function zt({
|
|
|
2542
2546
|
ref: h,
|
|
2543
2547
|
type: "button",
|
|
2544
2548
|
className: "ds-model-picker__trigger",
|
|
2545
|
-
onClick: () => u((
|
|
2549
|
+
onClick: () => u((v) => !v),
|
|
2546
2550
|
"aria-haspopup": "listbox",
|
|
2547
2551
|
"aria-expanded": d,
|
|
2548
2552
|
children: [
|
|
@@ -2577,25 +2581,25 @@ function Ot({
|
|
|
2577
2581
|
maxVisible: i = 5,
|
|
2578
2582
|
onSourceClick: a
|
|
2579
2583
|
}) {
|
|
2580
|
-
const [r, o] = D(!1), l = Ms(s),
|
|
2584
|
+
const [r, o] = D(!1), l = Ms(s), m = l.length > i, d = r ? l : l.slice(0, i), u = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2581
2585
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2582
2586
|
d.map((h) => {
|
|
2583
|
-
const
|
|
2587
|
+
const f = h.items.map((j) => j.page).filter(Boolean), _ = !!a;
|
|
2584
2588
|
return /* @__PURE__ */ e.jsxs(
|
|
2585
2589
|
"div",
|
|
2586
2590
|
{
|
|
2587
|
-
className: `ds-sources-panel__compact-row${
|
|
2588
|
-
onClick:
|
|
2591
|
+
className: `ds-sources-panel__compact-row${_ ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2592
|
+
onClick: _ ? () => a(h.items[0]) : void 0,
|
|
2589
2593
|
children: [
|
|
2590
2594
|
/* @__PURE__ */ e.jsx(ns, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2591
2595
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2592
|
-
|
|
2596
|
+
f.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(f) })
|
|
2593
2597
|
]
|
|
2594
2598
|
},
|
|
2595
2599
|
h.filename
|
|
2596
2600
|
);
|
|
2597
2601
|
}),
|
|
2598
|
-
|
|
2602
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2599
2603
|
"+",
|
|
2600
2604
|
l.length - i,
|
|
2601
2605
|
" more sources"
|
|
@@ -2603,37 +2607,37 @@ function Ot({
|
|
|
2603
2607
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2604
2608
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2605
2609
|
d.map((h) => {
|
|
2606
|
-
const
|
|
2610
|
+
const f = h.items.map((j) => j.page).filter(Boolean), _ = !!a;
|
|
2607
2611
|
return u ? /* @__PURE__ */ e.jsx(
|
|
2608
2612
|
Ee,
|
|
2609
2613
|
{
|
|
2610
|
-
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages:
|
|
2614
|
+
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: f }),
|
|
2611
2615
|
padding: "s",
|
|
2612
|
-
children: h.items.map((
|
|
2616
|
+
children: h.items.map((j, R) => /* @__PURE__ */ e.jsx(
|
|
2613
2617
|
"div",
|
|
2614
2618
|
{
|
|
2615
|
-
className: `ds-sources-panel__snippet${
|
|
2616
|
-
onClick:
|
|
2617
|
-
children:
|
|
2619
|
+
className: `ds-sources-panel__snippet${_ ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2620
|
+
onClick: _ ? () => a(j) : void 0,
|
|
2621
|
+
children: j.snippet ?? `p. ${j.page}`
|
|
2618
2622
|
},
|
|
2619
|
-
|
|
2623
|
+
R
|
|
2620
2624
|
))
|
|
2621
2625
|
},
|
|
2622
2626
|
h.filename
|
|
2623
2627
|
) : /* @__PURE__ */ e.jsxs(
|
|
2624
2628
|
"div",
|
|
2625
2629
|
{
|
|
2626
|
-
className: `ds-sources-panel__row${
|
|
2627
|
-
onClick:
|
|
2630
|
+
className: `ds-sources-panel__row${_ ? " ds-sources-panel__row--clickable" : ""}`,
|
|
2631
|
+
onClick: _ ? () => a(h.items[0]) : void 0,
|
|
2628
2632
|
children: [
|
|
2629
2633
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2630
|
-
|
|
2634
|
+
f.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(f) })
|
|
2631
2635
|
]
|
|
2632
2636
|
},
|
|
2633
2637
|
h.filename
|
|
2634
2638
|
);
|
|
2635
2639
|
}),
|
|
2636
|
-
|
|
2640
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2637
2641
|
"+",
|
|
2638
2642
|
l.length - i,
|
|
2639
2643
|
" more sources"
|
|
@@ -2652,7 +2656,7 @@ function Ft({
|
|
|
2652
2656
|
warningThreshold: r = 0.8,
|
|
2653
2657
|
errorThreshold: o = 1
|
|
2654
2658
|
}) {
|
|
2655
|
-
const l = t > 0 ? s / t : 0,
|
|
2659
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >= r ? "warning" : "normal";
|
|
2656
2660
|
return /* @__PURE__ */ e.jsxs(
|
|
2657
2661
|
"div",
|
|
2658
2662
|
{
|
|
@@ -2665,7 +2669,7 @@ function Ft({
|
|
|
2665
2669
|
"div",
|
|
2666
2670
|
{
|
|
2667
2671
|
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2668
|
-
style: { width: `${
|
|
2672
|
+
style: { width: `${m}%` }
|
|
2669
2673
|
}
|
|
2670
2674
|
) }),
|
|
2671
2675
|
(i || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
@@ -2701,12 +2705,12 @@ function Wt({
|
|
|
2701
2705
|
`ds-confidence-bar--${o}`,
|
|
2702
2706
|
i === "block" && "ds-confidence-bar--block"
|
|
2703
2707
|
].filter(Boolean).join(" "), children: [
|
|
2704
|
-
/* @__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, m) => /* @__PURE__ */ e.jsx(
|
|
2705
2709
|
"div",
|
|
2706
2710
|
{
|
|
2707
|
-
className: `ds-confidence-bar__seg${
|
|
2711
|
+
className: `ds-confidence-bar__seg${m < r ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2708
2712
|
},
|
|
2709
|
-
|
|
2713
|
+
m
|
|
2710
2714
|
)) }),
|
|
2711
2715
|
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
|
|
2712
2716
|
] });
|
|
@@ -2733,18 +2737,18 @@ function Ct({
|
|
|
2733
2737
|
n && "ds-diff-view--wrap"
|
|
2734
2738
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2735
2739
|
if (t === "split") {
|
|
2736
|
-
const
|
|
2740
|
+
const m = s.filter((u) => u.type === "remove" || u.type === "context"), d = s.filter((u) => u.type === "add" || u.type === "context");
|
|
2737
2741
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2738
2742
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2739
2743
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2740
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children:
|
|
2744
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((u, p) => /* @__PURE__ */ e.jsx(_e, { line: u, lineNumbers: i }, p)) }),
|
|
2741
2745
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((u, p) => /* @__PURE__ */ e.jsx(_e, { line: u, lineNumbers: i }, p)) })
|
|
2742
2746
|
] })
|
|
2743
2747
|
] });
|
|
2744
2748
|
}
|
|
2745
2749
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2746
2750
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2747
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((
|
|
2751
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(_e, { line: m, lineNumbers: i }, d)) })
|
|
2748
2752
|
] });
|
|
2749
2753
|
}
|
|
2750
2754
|
function zs({
|
|
@@ -2830,15 +2834,15 @@ function Ut({
|
|
|
2830
2834
|
className: o = "",
|
|
2831
2835
|
...l
|
|
2832
2836
|
}) {
|
|
2833
|
-
const
|
|
2834
|
-
return !
|
|
2837
|
+
const m = s === "assistant" && (a || r), d = !!t, u = n ? Os(n) : null;
|
|
2838
|
+
return !m && !d && !u ? null : /* @__PURE__ */ e.jsxs(
|
|
2835
2839
|
"div",
|
|
2836
2840
|
{
|
|
2837
2841
|
className: ["ds-message-footer", `ds-message-footer--${s}`, o].filter(Boolean).join(" "),
|
|
2838
2842
|
...l,
|
|
2839
2843
|
children: [
|
|
2840
2844
|
s === "user" && u && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: u }),
|
|
2841
|
-
|
|
2845
|
+
m && /* @__PURE__ */ e.jsx(zs, { className: "ds-message-action", value: i, onLike: a, onDislike: r }),
|
|
2842
2846
|
d && /* @__PURE__ */ e.jsx(Ds, { className: "ds-message-action", text: t }),
|
|
2843
2847
|
s === "assistant" && u && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: u })
|
|
2844
2848
|
]
|