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