@donkit-ai/design-system 1.4.1 → 1.4.2
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 +36 -1
- package/dist/index.es.js +995 -862
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Check as he, X as ne, ChevronDown as xe, Minus as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import K, { useState as A, useRef as E, useEffect as M, useLayoutEffect as Ve } from "react";
|
|
2
|
+
import { Check as he, X as ne, ChevronDown as xe, Minus as Ye, Plus as He, XCircle as we, AlertTriangle as ge, CheckCircle as ye, Info as ke, ChevronUp as qe, ChevronsUpDown as Ke, ChevronLeft as Ge, ChevronRight as Xe, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Re, Square as es, ArrowUp as ss, Zap as ts, Cpu as Se, FileText as rs, ThumbsUp as ns, ThumbsDown as as } from "lucide-react";
|
|
3
|
+
import pe from "react-dom";
|
|
4
|
+
const D = {
|
|
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 je = { exports: {} }, ue = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -18,10 +18,10 @@ var ve = { 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 Ae;
|
|
22
|
+
function is() {
|
|
23
|
+
if (Ae) return ue;
|
|
24
|
+
Ae = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
26
26
|
function r(i, a, n) {
|
|
27
27
|
var o = null;
|
|
@@ -38,9 +38,9 @@ function ns() {
|
|
|
38
38
|
props: n
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return ue.Fragment = t, ue.jsx = r, ue.jsxs = r, ue;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var fe = {};
|
|
44
44
|
/**
|
|
45
45
|
* @license React
|
|
46
46
|
* react-jsx-runtime.development.js
|
|
@@ -50,47 +50,47 @@ 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 De;
|
|
54
|
+
function os() {
|
|
55
|
+
return De || (De = 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")
|
|
59
|
-
return c.$$typeof ===
|
|
59
|
+
return c.$$typeof === C ? null : c.displayName || c.name || null;
|
|
60
60
|
if (typeof c == "string") return c;
|
|
61
61
|
switch (c) {
|
|
62
|
-
case
|
|
62
|
+
case S:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case B:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case R:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case I:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case v:
|
|
71
|
-
return "SuspenseList";
|
|
72
70
|
case Y:
|
|
71
|
+
return "SuspenseList";
|
|
72
|
+
case N:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof c == "object")
|
|
76
76
|
switch (typeof c.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), c.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case j:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case
|
|
81
|
+
case $:
|
|
82
82
|
return c.displayName || "Context";
|
|
83
|
-
case
|
|
83
|
+
case y:
|
|
84
84
|
return (c._context.displayName || "Context") + ".Consumer";
|
|
85
85
|
case O:
|
|
86
|
-
var
|
|
87
|
-
return c = c.displayName, c || (c =
|
|
88
|
-
case
|
|
89
|
-
return
|
|
90
|
-
case
|
|
91
|
-
|
|
86
|
+
var w = c.render;
|
|
87
|
+
return c = c.displayName, c || (c = w.displayName || w.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
|
|
88
|
+
case q:
|
|
89
|
+
return w = c.displayName || null, w !== null ? w : s(c.type) || "Memo";
|
|
90
|
+
case P:
|
|
91
|
+
w = c._payload, c = c._init;
|
|
92
92
|
try {
|
|
93
|
-
return s(c(
|
|
93
|
+
return s(c(w));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -102,33 +102,33 @@ function as() {
|
|
|
102
102
|
function r(c) {
|
|
103
103
|
try {
|
|
104
104
|
t(c);
|
|
105
|
-
var
|
|
105
|
+
var w = !1;
|
|
106
106
|
} catch {
|
|
107
|
-
|
|
107
|
+
w = !0;
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
return
|
|
113
|
-
|
|
109
|
+
if (w) {
|
|
110
|
+
w = console;
|
|
111
|
+
var z = w.error, F = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
|
|
112
|
+
return z.call(
|
|
113
|
+
w,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
115
|
F
|
|
116
116
|
), t(c);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function i(c) {
|
|
120
|
-
if (c ===
|
|
121
|
-
if (typeof c == "object" && c !== null && c.$$typeof ===
|
|
120
|
+
if (c === S) return "<>";
|
|
121
|
+
if (typeof c == "object" && c !== null && c.$$typeof === P)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
124
|
+
var w = s(c);
|
|
125
|
+
return w ? "<" + w + ">" : "<...>";
|
|
126
126
|
} catch {
|
|
127
127
|
return "<...>";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function a() {
|
|
131
|
-
var c =
|
|
131
|
+
var c = G.A;
|
|
132
132
|
return c === null ? null : c.getOwner();
|
|
133
133
|
}
|
|
134
134
|
function n() {
|
|
@@ -136,36 +136,36 @@ function as() {
|
|
|
136
136
|
}
|
|
137
137
|
function o(c) {
|
|
138
138
|
if (U.call(c, "key")) {
|
|
139
|
-
var
|
|
140
|
-
if (
|
|
139
|
+
var w = Object.getOwnPropertyDescriptor(c, "key").get;
|
|
140
|
+
if (w && w.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return c.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function l(c,
|
|
145
|
-
function
|
|
146
|
-
|
|
144
|
+
function l(c, w) {
|
|
145
|
+
function z() {
|
|
146
|
+
k || (k = !0, console.error(
|
|
147
147
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
148
|
-
|
|
148
|
+
w
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
get:
|
|
151
|
+
z.isReactWarning = !0, Object.defineProperty(c, "key", {
|
|
152
|
+
get: z,
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
function m() {
|
|
157
157
|
var c = s(this.type);
|
|
158
|
-
return
|
|
158
|
+
return L[c] || (L[c] = !0, console.error(
|
|
159
159
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
160
160
|
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
var W =
|
|
162
|
+
function d(c, w, z, F, te, ie) {
|
|
163
|
+
var W = z.ref;
|
|
164
164
|
return c = {
|
|
165
|
-
$$typeof:
|
|
165
|
+
$$typeof: b,
|
|
166
166
|
type: c,
|
|
167
|
-
key:
|
|
168
|
-
props:
|
|
167
|
+
key: w,
|
|
168
|
+
props: z,
|
|
169
169
|
_owner: F
|
|
170
170
|
}, (W !== void 0 ? W : null) !== null ? Object.defineProperty(c, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
@@ -189,14 +189,14 @@ function as() {
|
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
191
191
|
writable: !0,
|
|
192
|
-
value:
|
|
192
|
+
value: ie
|
|
193
193
|
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
194
194
|
}
|
|
195
|
-
function f(c,
|
|
196
|
-
var W =
|
|
195
|
+
function f(c, w, z, F, te, ie) {
|
|
196
|
+
var W = w.children;
|
|
197
197
|
if (W !== void 0)
|
|
198
198
|
if (F)
|
|
199
|
-
if (
|
|
199
|
+
if (x(W)) {
|
|
200
200
|
for (F = 0; F < W.length; F++)
|
|
201
201
|
p(W[F]);
|
|
202
202
|
Object.freeze && Object.freeze(W);
|
|
@@ -205,12 +205,12 @@ function as() {
|
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
207
|
else p(W);
|
|
208
|
-
if (U.call(
|
|
208
|
+
if (U.call(w, "key")) {
|
|
209
209
|
W = s(c);
|
|
210
|
-
var Q = Object.keys(
|
|
211
|
-
return
|
|
210
|
+
var Q = Object.keys(w).filter(function(be) {
|
|
211
|
+
return be !== "key";
|
|
212
212
|
});
|
|
213
|
-
F = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
213
|
+
F = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", g[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} />
|
|
@@ -221,69 +221,69 @@ React keys must be passed directly to JSX without using spread:
|
|
|
221
221
|
W,
|
|
222
222
|
Q,
|
|
223
223
|
W
|
|
224
|
-
),
|
|
224
|
+
), g[W + F] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (W = null,
|
|
227
|
-
|
|
228
|
-
for (var
|
|
229
|
-
|
|
230
|
-
} else
|
|
226
|
+
if (W = null, z !== void 0 && (r(z), W = "" + z), o(w) && (r(w.key), W = "" + w.key), "key" in w) {
|
|
227
|
+
z = {};
|
|
228
|
+
for (var oe in w)
|
|
229
|
+
oe !== "key" && (z[oe] = w[oe]);
|
|
230
|
+
} else z = w;
|
|
231
231
|
return W && l(
|
|
232
|
-
|
|
232
|
+
z,
|
|
233
233
|
typeof c == "function" ? c.displayName || c.name || "Unknown" : c
|
|
234
|
-
),
|
|
234
|
+
), d(
|
|
235
235
|
c,
|
|
236
236
|
W,
|
|
237
|
-
|
|
237
|
+
z,
|
|
238
238
|
a(),
|
|
239
239
|
te,
|
|
240
|
-
|
|
240
|
+
ie
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(c) {
|
|
244
|
-
h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof ===
|
|
244
|
+
h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === P && (c._payload.status === "fulfilled" ? h(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(c) {
|
|
247
|
-
return typeof c == "object" && c !== null && c.$$typeof ===
|
|
247
|
+
return typeof c == "object" && c !== null && c.$$typeof === b;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var u = K, b = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), G = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, x = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
u = {
|
|
253
253
|
react_stack_bottom_frame: function(c) {
|
|
254
254
|
return c();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
258
|
-
|
|
257
|
+
var k, L = {}, H = u.react_stack_bottom_frame.bind(
|
|
258
|
+
u,
|
|
259
259
|
n
|
|
260
|
-
)(),
|
|
261
|
-
|
|
262
|
-
var F = 1e4 >
|
|
260
|
+
)(), X = v(i(n)), g = {};
|
|
261
|
+
fe.Fragment = S, fe.jsx = function(c, w, z) {
|
|
262
|
+
var F = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return f(
|
|
264
264
|
c,
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
w,
|
|
266
|
+
z,
|
|
267
267
|
!1,
|
|
268
|
-
F ? Error("react-stack-top-frame") :
|
|
269
|
-
F ?
|
|
268
|
+
F ? Error("react-stack-top-frame") : H,
|
|
269
|
+
F ? v(i(c)) : X
|
|
270
270
|
);
|
|
271
|
-
},
|
|
272
|
-
var F = 1e4 >
|
|
271
|
+
}, fe.jsxs = function(c, w, z) {
|
|
272
|
+
var F = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return f(
|
|
274
274
|
c,
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
w,
|
|
276
|
+
z,
|
|
277
277
|
!0,
|
|
278
|
-
F ? Error("react-stack-top-frame") :
|
|
279
|
-
F ?
|
|
278
|
+
F ? Error("react-stack-top-frame") : H,
|
|
279
|
+
F ? v(i(c)) : X
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
|
-
}()),
|
|
282
|
+
}()), fe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
286
|
-
function
|
|
284
|
+
process.env.NODE_ENV === "production" ? je.exports = is() : je.exports = os();
|
|
285
|
+
var e = je.exports;
|
|
286
|
+
function ls({ size: s = "m", color: t = "default", className: r = "", ...i }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
@@ -294,8 +294,8 @@ function is({ size: s = "m", color: t = "default", className: r = "", ...i }) {
|
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
|
-
const
|
|
298
|
-
function
|
|
297
|
+
const cs = { xs: 12, s: 14, m: 16, l: 20 };
|
|
298
|
+
function me({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
301
301
|
size: r = "m",
|
|
@@ -305,40 +305,42 @@ function fe({
|
|
|
305
305
|
state: o = "idle",
|
|
306
306
|
onClick: l,
|
|
307
307
|
type: m = "button",
|
|
308
|
-
href:
|
|
308
|
+
href: d,
|
|
309
309
|
"aria-label": f,
|
|
310
|
-
|
|
310
|
+
className: p = "",
|
|
311
|
+
...h
|
|
311
312
|
}) {
|
|
312
|
-
const
|
|
313
|
+
const u = a && !s, b = o === "loading", j = o === "success", S = o === "error", R = b || j || S, B = r === "xs" ? "s" : "m", y = cs[r] ?? 16, $ = b ? /* @__PURE__ */ e.jsx(ls, { size: B }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(he, { size: y, strokeWidth: 2.5 }) }) : S ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ne, { size: y, strokeWidth: 2.5 }) }) : null, O = [
|
|
313
314
|
"ds-button",
|
|
314
315
|
`ds-button--${t}`,
|
|
315
316
|
`ds-button--${r}`,
|
|
316
317
|
i && "ds-button--full",
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
u && "ds-button--icon-only",
|
|
319
|
+
p
|
|
320
|
+
].filter(Boolean).join(" "), I = o !== "idle" ? o : void 0, Y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
|
+
R ? $ : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
320
322
|
s
|
|
321
323
|
] });
|
|
322
|
-
if (
|
|
323
|
-
const
|
|
324
|
-
if (n ||
|
|
325
|
-
|
|
324
|
+
if (d) {
|
|
325
|
+
const q = (P) => {
|
|
326
|
+
if (n || b) {
|
|
327
|
+
P.preventDefault();
|
|
326
328
|
return;
|
|
327
329
|
}
|
|
328
|
-
|
|
330
|
+
P.metaKey || P.ctrlKey || P.button === 1 || (P.preventDefault(), l == null || l(P));
|
|
329
331
|
};
|
|
330
332
|
return /* @__PURE__ */ e.jsx(
|
|
331
333
|
"a",
|
|
332
334
|
{
|
|
333
|
-
className:
|
|
334
|
-
href: n ||
|
|
335
|
-
onClick:
|
|
335
|
+
className: O,
|
|
336
|
+
href: n || b ? void 0 : d,
|
|
337
|
+
onClick: q,
|
|
336
338
|
"aria-label": f,
|
|
337
|
-
"aria-disabled": n ||
|
|
338
|
-
"aria-busy":
|
|
339
|
-
"data-state":
|
|
340
|
-
...
|
|
341
|
-
children:
|
|
339
|
+
"aria-disabled": n || b ? "true" : void 0,
|
|
340
|
+
"aria-busy": b ? "true" : void 0,
|
|
341
|
+
"data-state": I,
|
|
342
|
+
...h,
|
|
343
|
+
children: Y
|
|
342
344
|
}
|
|
343
345
|
);
|
|
344
346
|
}
|
|
@@ -346,18 +348,18 @@ function fe({
|
|
|
346
348
|
"button",
|
|
347
349
|
{
|
|
348
350
|
type: m,
|
|
349
|
-
className:
|
|
351
|
+
className: O,
|
|
350
352
|
disabled: n,
|
|
351
|
-
onClick:
|
|
353
|
+
onClick: b ? void 0 : l,
|
|
352
354
|
"aria-label": f,
|
|
353
|
-
"aria-busy":
|
|
354
|
-
"data-state":
|
|
355
|
-
...
|
|
356
|
-
children:
|
|
355
|
+
"aria-busy": b ? "true" : void 0,
|
|
356
|
+
"data-state": I,
|
|
357
|
+
...h,
|
|
358
|
+
children: Y
|
|
357
359
|
}
|
|
358
360
|
);
|
|
359
361
|
}
|
|
360
|
-
function
|
|
362
|
+
function Vs({
|
|
361
363
|
label: s,
|
|
362
364
|
error: t,
|
|
363
365
|
hint: r,
|
|
@@ -367,10 +369,10 @@ function Os({
|
|
|
367
369
|
onIconRightClick: o,
|
|
368
370
|
size: l = "m",
|
|
369
371
|
disabled: m,
|
|
370
|
-
id:
|
|
372
|
+
id: d,
|
|
371
373
|
...f
|
|
372
374
|
}) {
|
|
373
|
-
const p =
|
|
375
|
+
const p = d || `input-${K.useId()}`, h = r ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, b = u || h;
|
|
374
376
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
375
377
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
376
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -382,7 +384,7 @@ function Os({
|
|
|
382
384
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
383
385
|
disabled: m,
|
|
384
386
|
"aria-invalid": t ? "true" : "false",
|
|
385
|
-
"aria-describedby":
|
|
387
|
+
"aria-describedby": b,
|
|
386
388
|
...f
|
|
387
389
|
}
|
|
388
390
|
),
|
|
@@ -399,10 +401,10 @@ function Os({
|
|
|
399
401
|
)
|
|
400
402
|
] }),
|
|
401
403
|
r && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: r }),
|
|
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:
|
|
404
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: u, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
403
405
|
] });
|
|
404
406
|
}
|
|
405
|
-
function
|
|
407
|
+
function Ys({
|
|
406
408
|
label: s,
|
|
407
409
|
error: t,
|
|
408
410
|
hint: r,
|
|
@@ -412,9 +414,9 @@ function zs({
|
|
|
412
414
|
id: o,
|
|
413
415
|
resize: l = !0,
|
|
414
416
|
rows: m = 3,
|
|
415
|
-
...
|
|
417
|
+
...d
|
|
416
418
|
}) {
|
|
417
|
-
const f = o || `textarea-${
|
|
419
|
+
const f = o || `textarea-${K.useId()}`, p = r ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, u = h || p;
|
|
418
420
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${n ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
419
421
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
|
|
420
422
|
/* @__PURE__ */ e.jsx(
|
|
@@ -424,16 +426,16 @@ function zs({
|
|
|
424
426
|
className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
425
427
|
disabled: n,
|
|
426
428
|
"aria-invalid": t ? "true" : "false",
|
|
427
|
-
"aria-describedby":
|
|
429
|
+
"aria-describedby": u,
|
|
428
430
|
rows: m,
|
|
429
|
-
...
|
|
431
|
+
...d
|
|
430
432
|
}
|
|
431
433
|
),
|
|
432
434
|
r && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: r }),
|
|
433
435
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
434
436
|
] });
|
|
435
437
|
}
|
|
436
|
-
function
|
|
438
|
+
function Hs({
|
|
437
439
|
label: s,
|
|
438
440
|
value: t,
|
|
439
441
|
onChange: r,
|
|
@@ -443,147 +445,147 @@ function Fs({
|
|
|
443
445
|
fullWidth: o = !0,
|
|
444
446
|
size: l = "m",
|
|
445
447
|
disabled: m = !1,
|
|
446
|
-
id:
|
|
448
|
+
id: d,
|
|
447
449
|
...f
|
|
448
450
|
}) {
|
|
449
|
-
const [p, h] =
|
|
450
|
-
|
|
451
|
+
const [p, h] = A(!1), [u, b] = A(!1), [j, S] = A({}), [R, B] = A("down"), [y, $] = A(-1), O = E(null), I = E(null), Y = E(null), q = E(null), P = d || `select-${K.useId()}`, N = `${P}-label`, C = n ? `${P}-error` : void 0, G = 150, U = (g = !1) => {
|
|
452
|
+
u || (b(!0), $(-1), q.current = setTimeout(() => {
|
|
451
453
|
var c;
|
|
452
|
-
h(!1),
|
|
453
|
-
},
|
|
454
|
-
},
|
|
455
|
-
clearTimeout(
|
|
456
|
-
const c =
|
|
457
|
-
|
|
454
|
+
h(!1), b(!1), g && ((c = Y.current) == null || c.focus());
|
|
455
|
+
}, G));
|
|
456
|
+
}, x = (g) => {
|
|
457
|
+
clearTimeout(q.current), b(!1);
|
|
458
|
+
const c = g !== void 0 ? g : Math.max(i.findIndex((w) => w.value === t), 0);
|
|
459
|
+
$(c), h(!0);
|
|
458
460
|
};
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
var
|
|
462
|
-
const
|
|
463
|
-
if (!
|
|
464
|
-
const c = window.innerHeight,
|
|
465
|
-
|
|
466
|
-
te ? { bottom: c -
|
|
461
|
+
M(() => () => clearTimeout(q.current), []);
|
|
462
|
+
const v = () => {
|
|
463
|
+
var ie;
|
|
464
|
+
const g = (ie = O.current) == null ? void 0 : ie.getBoundingClientRect();
|
|
465
|
+
if (!g) return;
|
|
466
|
+
const c = window.innerHeight, w = c - g.bottom, z = g.top, te = w < 300 && z > w;
|
|
467
|
+
B(te ? "up" : "down"), S(
|
|
468
|
+
te ? { bottom: c - g.top + 4, left: g.left, width: g.width } : { top: g.bottom + 4, left: g.left, width: g.width }
|
|
467
469
|
);
|
|
468
470
|
};
|
|
469
|
-
|
|
471
|
+
M(() => {
|
|
470
472
|
if (p)
|
|
471
|
-
return
|
|
472
|
-
window.removeEventListener("scroll",
|
|
473
|
+
return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
|
|
474
|
+
window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
|
|
473
475
|
};
|
|
474
|
-
}, [p]),
|
|
475
|
-
const
|
|
476
|
-
O.current && !O.current.contains(c.target) &&
|
|
476
|
+
}, [p]), M(() => {
|
|
477
|
+
const g = (c) => {
|
|
478
|
+
O.current && !O.current.contains(c.target) && I.current && !I.current.contains(c.target) && U();
|
|
477
479
|
};
|
|
478
|
-
return document.addEventListener("mousedown",
|
|
479
|
-
}, [
|
|
480
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
481
|
+
}, [u]), M(() => {
|
|
480
482
|
var c;
|
|
481
|
-
if (!p ||
|
|
482
|
-
(c =
|
|
483
|
-
}, [
|
|
484
|
-
const
|
|
485
|
-
switch (
|
|
483
|
+
if (!p || y < 0 || !I.current) return;
|
|
484
|
+
(c = I.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
|
|
485
|
+
}, [y, p]);
|
|
486
|
+
const k = (g) => {
|
|
487
|
+
switch (g.key) {
|
|
486
488
|
case "ArrowDown":
|
|
487
|
-
|
|
489
|
+
g.preventDefault(), p ? $((c) => Math.min(c + 1, i.length - 1)) : x();
|
|
488
490
|
break;
|
|
489
491
|
case "ArrowUp":
|
|
490
|
-
|
|
492
|
+
g.preventDefault(), p ? $((c) => Math.max(c - 1, 0)) : x(i.length - 1);
|
|
491
493
|
break;
|
|
492
494
|
case "Home":
|
|
493
|
-
p && (
|
|
495
|
+
p && (g.preventDefault(), $(0));
|
|
494
496
|
break;
|
|
495
497
|
case "End":
|
|
496
|
-
p && (
|
|
498
|
+
p && (g.preventDefault(), $(i.length - 1));
|
|
497
499
|
break;
|
|
498
500
|
case "Enter":
|
|
499
501
|
case " ":
|
|
500
|
-
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (r == null || r(i[y].value), U(!0)) : x();
|
|
501
503
|
break;
|
|
502
504
|
case "Escape":
|
|
503
|
-
p && (
|
|
505
|
+
p && (g.preventDefault(), U(!0));
|
|
504
506
|
break;
|
|
505
507
|
case "Tab":
|
|
506
508
|
p && U(!1);
|
|
507
509
|
break;
|
|
508
510
|
}
|
|
509
|
-
},
|
|
511
|
+
}, L = i.find((g) => g.value === t), H = l === "xs" ? D[1] : l === "small" ? D[2] : D[3], X = p && /* @__PURE__ */ e.jsx(
|
|
510
512
|
"div",
|
|
511
513
|
{
|
|
512
|
-
ref:
|
|
514
|
+
ref: I,
|
|
513
515
|
role: "listbox",
|
|
514
|
-
"aria-labelledby": s ?
|
|
516
|
+
"aria-labelledby": s ? N : void 0,
|
|
515
517
|
tabIndex: -1,
|
|
516
518
|
className: [
|
|
517
519
|
"ds-select-dropdown",
|
|
518
520
|
`ds-select-dropdown--${l}`,
|
|
519
|
-
`ds-select-dropdown--${
|
|
520
|
-
|
|
521
|
+
`ds-select-dropdown--${R}`,
|
|
522
|
+
u && "ds-select-dropdown--closing"
|
|
521
523
|
].filter(Boolean).join(" "),
|
|
522
|
-
style:
|
|
523
|
-
children: i.map((
|
|
524
|
+
style: j,
|
|
525
|
+
children: i.map((g, c) => /* @__PURE__ */ e.jsx(
|
|
524
526
|
"button",
|
|
525
527
|
{
|
|
526
|
-
id: `${
|
|
528
|
+
id: `${P}-opt-${c}`,
|
|
527
529
|
type: "button",
|
|
528
530
|
role: "option",
|
|
529
531
|
tabIndex: -1,
|
|
530
|
-
"aria-selected": t ===
|
|
532
|
+
"aria-selected": t === g.value,
|
|
531
533
|
className: [
|
|
532
534
|
"ds-select-option",
|
|
533
535
|
`ds-select-option--${l}`,
|
|
534
|
-
t ===
|
|
535
|
-
c ===
|
|
536
|
+
t === g.value && "ds-select-option--selected",
|
|
537
|
+
c === y && "ds-select-option--active"
|
|
536
538
|
].filter(Boolean).join(" "),
|
|
537
539
|
onClick: () => {
|
|
538
|
-
r == null || r(
|
|
540
|
+
r == null || r(g.value), U(!0);
|
|
539
541
|
},
|
|
540
|
-
children:
|
|
542
|
+
children: g.label
|
|
541
543
|
},
|
|
542
|
-
|
|
544
|
+
g.value
|
|
543
545
|
))
|
|
544
546
|
}
|
|
545
547
|
);
|
|
546
548
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
547
|
-
s && /* @__PURE__ */ e.jsx("label", { id:
|
|
549
|
+
s && /* @__PURE__ */ e.jsx("label", { id: N, className: "ds-select-label", children: s }),
|
|
548
550
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: O, children: /* @__PURE__ */ e.jsxs(
|
|
549
551
|
"button",
|
|
550
552
|
{
|
|
551
|
-
ref:
|
|
553
|
+
ref: Y,
|
|
552
554
|
type: "button",
|
|
553
|
-
id:
|
|
555
|
+
id: P,
|
|
554
556
|
role: "combobox",
|
|
555
557
|
"aria-haspopup": "listbox",
|
|
556
558
|
"aria-expanded": p,
|
|
557
|
-
"aria-activedescendant": p &&
|
|
558
|
-
"aria-labelledby": s ?
|
|
559
|
+
"aria-activedescendant": p && y >= 0 ? `${P}-opt-${y}` : void 0,
|
|
560
|
+
"aria-labelledby": s ? N : void 0,
|
|
559
561
|
"aria-invalid": n ? "true" : "false",
|
|
560
|
-
"aria-describedby":
|
|
562
|
+
"aria-describedby": C,
|
|
561
563
|
className: `ds-select-trigger ds-select-trigger--${l} ${n ? "ds-select-trigger--error" : ""}`,
|
|
562
564
|
onClick: () => {
|
|
563
|
-
m || (p ? U() :
|
|
565
|
+
m || (p ? U() : x());
|
|
564
566
|
},
|
|
565
|
-
onKeyDown:
|
|
567
|
+
onKeyDown: k,
|
|
566
568
|
disabled: m,
|
|
567
569
|
...f,
|
|
568
570
|
children: [
|
|
569
|
-
/* @__PURE__ */ e.jsx("span", { className:
|
|
571
|
+
/* @__PURE__ */ e.jsx("span", { className: L ? "" : "ds-select-placeholder", children: (L == null ? void 0 : L.label) || a }),
|
|
570
572
|
/* @__PURE__ */ e.jsx(
|
|
571
573
|
xe,
|
|
572
574
|
{
|
|
573
|
-
size:
|
|
575
|
+
size: H,
|
|
574
576
|
strokeWidth: 1.5,
|
|
575
|
-
className: `ds-select-icon ${p &&
|
|
577
|
+
className: `ds-select-icon ${p && R === "down" ? "ds-select-icon--open" : ""} ${p && R === "up" ? "ds-select-icon--up" : ""}`,
|
|
576
578
|
"aria-hidden": "true"
|
|
577
579
|
}
|
|
578
580
|
)
|
|
579
581
|
]
|
|
580
582
|
}
|
|
581
583
|
) }),
|
|
582
|
-
n && /* @__PURE__ */ e.jsx("span", { id:
|
|
583
|
-
typeof document < "u" &&
|
|
584
|
+
n && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: n }),
|
|
585
|
+
typeof document < "u" && pe.createPortal(X, document.body)
|
|
584
586
|
] });
|
|
585
587
|
}
|
|
586
|
-
function
|
|
588
|
+
function qs({
|
|
587
589
|
label: s,
|
|
588
590
|
value: t = 0,
|
|
589
591
|
onChange: r,
|
|
@@ -593,41 +595,41 @@ function Ws({
|
|
|
593
595
|
size: o = "m",
|
|
594
596
|
disabled: l = !1,
|
|
595
597
|
hint: m,
|
|
596
|
-
error:
|
|
598
|
+
error: d,
|
|
597
599
|
...f
|
|
598
600
|
}) {
|
|
599
601
|
const p = () => {
|
|
600
602
|
if (l) return;
|
|
601
|
-
const
|
|
602
|
-
r == null || r(
|
|
603
|
+
const R = Math.min(Number(t) + n, a);
|
|
604
|
+
r == null || r(R);
|
|
603
605
|
}, h = () => {
|
|
604
606
|
if (l) return;
|
|
605
|
-
const
|
|
606
|
-
r == null || r(
|
|
607
|
-
},
|
|
607
|
+
const R = Math.max(Number(t) - n, i);
|
|
608
|
+
r == null || r(R);
|
|
609
|
+
}, u = (R) => {
|
|
608
610
|
if (l) return;
|
|
609
|
-
const
|
|
610
|
-
if (
|
|
611
|
+
const B = R.target.value;
|
|
612
|
+
if (B === "") {
|
|
611
613
|
r == null || r(i);
|
|
612
614
|
return;
|
|
613
615
|
}
|
|
614
|
-
const
|
|
615
|
-
if (!isNaN(
|
|
616
|
-
const
|
|
617
|
-
r == null || r(
|
|
616
|
+
const y = Number(B);
|
|
617
|
+
if (!isNaN(y)) {
|
|
618
|
+
const $ = Math.min(Math.max(y, i), a);
|
|
619
|
+
r == null || r($);
|
|
618
620
|
}
|
|
619
|
-
},
|
|
621
|
+
}, b = [
|
|
620
622
|
"ds-stepper-wrapper",
|
|
621
623
|
l && "ds-stepper-wrapper--disabled",
|
|
622
|
-
|
|
623
|
-
].filter(Boolean).join(" "),
|
|
624
|
+
d && "ds-stepper-wrapper--error"
|
|
625
|
+
].filter(Boolean).join(" "), j = [
|
|
624
626
|
"ds-stepper",
|
|
625
627
|
`ds-stepper--${o}`,
|
|
626
628
|
l && "ds-stepper--disabled"
|
|
627
|
-
].filter(Boolean).join(" "),
|
|
628
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
629
|
+
].filter(Boolean).join(" "), S = o === "xs" ? D[1] : o === "small" ? D[2] : D[3];
|
|
630
|
+
return /* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
629
631
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
630
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
632
|
+
/* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
631
633
|
/* @__PURE__ */ e.jsx(
|
|
632
634
|
"button",
|
|
633
635
|
{
|
|
@@ -636,7 +638,7 @@ function Ws({
|
|
|
636
638
|
onClick: h,
|
|
637
639
|
disabled: l || t <= i,
|
|
638
640
|
"aria-label": "Decrease",
|
|
639
|
-
children: /* @__PURE__ */ e.jsx(
|
|
641
|
+
children: /* @__PURE__ */ e.jsx(Ye, { size: S, strokeWidth: 1.5 })
|
|
640
642
|
}
|
|
641
643
|
),
|
|
642
644
|
/* @__PURE__ */ e.jsx(
|
|
@@ -645,7 +647,7 @@ function Ws({
|
|
|
645
647
|
type: "number",
|
|
646
648
|
className: "ds-stepper-input",
|
|
647
649
|
value: t,
|
|
648
|
-
onChange:
|
|
650
|
+
onChange: u,
|
|
649
651
|
min: i,
|
|
650
652
|
max: a,
|
|
651
653
|
step: n,
|
|
@@ -661,15 +663,15 @@ function Ws({
|
|
|
661
663
|
onClick: p,
|
|
662
664
|
disabled: l || t >= a,
|
|
663
665
|
"aria-label": "Increase",
|
|
664
|
-
children: /* @__PURE__ */ e.jsx(He, { size:
|
|
666
|
+
children: /* @__PURE__ */ e.jsx(He, { size: S, strokeWidth: 1.5 })
|
|
665
667
|
}
|
|
666
668
|
)
|
|
667
669
|
] }),
|
|
668
|
-
m && !
|
|
669
|
-
|
|
670
|
+
m && !d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: m }),
|
|
671
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
670
672
|
] });
|
|
671
673
|
}
|
|
672
|
-
function
|
|
674
|
+
function Ks({
|
|
673
675
|
children: s,
|
|
674
676
|
padding: t = "m",
|
|
675
677
|
variant: r = "info",
|
|
@@ -680,32 +682,32 @@ function ls({
|
|
|
680
682
|
disabled: o = !1,
|
|
681
683
|
...l
|
|
682
684
|
}) {
|
|
683
|
-
const
|
|
685
|
+
const d = (i ? "interactive" : r) === "interactive" || a || n, f = [
|
|
684
686
|
"ds-card",
|
|
685
687
|
`ds-card--${t}`,
|
|
686
|
-
|
|
688
|
+
d && "ds-card--interactive"
|
|
687
689
|
].filter(Boolean).join(" ");
|
|
688
690
|
if (n) {
|
|
689
|
-
const
|
|
691
|
+
const u = (b) => {
|
|
690
692
|
if (o) {
|
|
691
|
-
|
|
693
|
+
b.preventDefault();
|
|
692
694
|
return;
|
|
693
695
|
}
|
|
694
|
-
|
|
696
|
+
b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(), a == null || a(b));
|
|
695
697
|
};
|
|
696
698
|
return /* @__PURE__ */ e.jsx(
|
|
697
699
|
"a",
|
|
698
700
|
{
|
|
699
701
|
className: f,
|
|
700
702
|
href: o ? void 0 : n,
|
|
701
|
-
onClick:
|
|
703
|
+
onClick: u,
|
|
702
704
|
"aria-disabled": o ? "true" : void 0,
|
|
703
705
|
...l,
|
|
704
706
|
children: s
|
|
705
707
|
}
|
|
706
708
|
);
|
|
707
709
|
}
|
|
708
|
-
const p =
|
|
710
|
+
const p = d && a ? "button" : "div", h = d && a ? {
|
|
709
711
|
type: "button",
|
|
710
712
|
onClick: a,
|
|
711
713
|
disabled: o
|
|
@@ -714,35 +716,35 @@ function ls({
|
|
|
714
716
|
p,
|
|
715
717
|
{
|
|
716
718
|
className: f,
|
|
717
|
-
role:
|
|
719
|
+
role: d && !a ? "article" : void 0,
|
|
718
720
|
...h,
|
|
719
721
|
...l,
|
|
720
722
|
children: s
|
|
721
723
|
}
|
|
722
724
|
);
|
|
723
725
|
}
|
|
724
|
-
function
|
|
726
|
+
function Gs({ children: s, ...t }) {
|
|
725
727
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...t, children: s });
|
|
726
728
|
}
|
|
727
|
-
function
|
|
729
|
+
function Xs({ children: s, ...t }) {
|
|
728
730
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...t, children: s });
|
|
729
731
|
}
|
|
730
|
-
function
|
|
732
|
+
function Js({ children: s, ...t }) {
|
|
731
733
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...t, children: s });
|
|
732
734
|
}
|
|
733
|
-
function
|
|
735
|
+
function Zs({ children: s, ...t }) {
|
|
734
736
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
735
737
|
}
|
|
736
|
-
function
|
|
738
|
+
function Qs({ children: s, secondary: t = !1, ...r }) {
|
|
737
739
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...r, children: s });
|
|
738
740
|
}
|
|
739
|
-
function
|
|
741
|
+
function ds({ children: s, secondary: t = !1, ...r }) {
|
|
740
742
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...r, children: s });
|
|
741
743
|
}
|
|
742
|
-
function
|
|
744
|
+
function Fe({ children: s, secondary: t = !1, ...r }) {
|
|
743
745
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...r, children: s });
|
|
744
746
|
}
|
|
745
|
-
function
|
|
747
|
+
function ae({
|
|
746
748
|
children: s,
|
|
747
749
|
variant: t = "default",
|
|
748
750
|
size: r = "m",
|
|
@@ -756,13 +758,13 @@ function pe({
|
|
|
756
758
|
].filter(Boolean).join(" "), o = i || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
757
759
|
return /* @__PURE__ */ e.jsx("span", { className: n, role: o, ...a, children: s });
|
|
758
760
|
}
|
|
759
|
-
const
|
|
761
|
+
const us = {
|
|
760
762
|
info: ke,
|
|
761
|
-
success:
|
|
762
|
-
warning:
|
|
763
|
+
success: ye,
|
|
764
|
+
warning: ge,
|
|
763
765
|
error: we
|
|
764
766
|
};
|
|
765
|
-
function
|
|
767
|
+
function et({
|
|
766
768
|
children: s,
|
|
767
769
|
variant: t = "info",
|
|
768
770
|
title: r,
|
|
@@ -770,9 +772,9 @@ function Hs({
|
|
|
770
772
|
role: a,
|
|
771
773
|
...n
|
|
772
774
|
}) {
|
|
773
|
-
const o =
|
|
775
|
+
const o = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
774
776
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${r ? "" : "ds-alert--no-title"}`, role: l, ...n, children: [
|
|
775
|
-
o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size:
|
|
777
|
+
o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size: D[3], strokeWidth: 1.5 }) }),
|
|
776
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
777
779
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
778
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
@@ -784,35 +786,35 @@ function Hs({
|
|
|
784
786
|
className: "ds-alert__close",
|
|
785
787
|
onClick: i,
|
|
786
788
|
"aria-label": "Close alert",
|
|
787
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[3], strokeWidth: 1.5 })
|
|
788
790
|
}
|
|
789
791
|
)
|
|
790
792
|
] });
|
|
791
793
|
}
|
|
792
|
-
const
|
|
793
|
-
function
|
|
794
|
+
const fs = 200;
|
|
795
|
+
function st({
|
|
794
796
|
children: s,
|
|
795
797
|
title: t,
|
|
796
798
|
onClose: r,
|
|
797
799
|
size: i = "m",
|
|
798
800
|
...a
|
|
799
801
|
}) {
|
|
800
|
-
const n =
|
|
802
|
+
const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
|
|
801
803
|
!r || l || (m(!0), setTimeout(() => {
|
|
802
804
|
m(!1), r();
|
|
803
|
-
},
|
|
805
|
+
}, fs));
|
|
804
806
|
};
|
|
805
|
-
|
|
806
|
-
const
|
|
807
|
-
|
|
808
|
-
},
|
|
809
|
-
n.current && !n.current.contains(
|
|
807
|
+
M(() => {
|
|
808
|
+
const u = (j) => {
|
|
809
|
+
j.key === "Escape" && d();
|
|
810
|
+
}, b = (j) => {
|
|
811
|
+
n.current && !n.current.contains(j.target) && d();
|
|
810
812
|
};
|
|
811
|
-
return document.addEventListener("keydown",
|
|
812
|
-
document.removeEventListener("keydown",
|
|
813
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
814
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
813
815
|
};
|
|
814
816
|
}, [r, l]);
|
|
815
|
-
const f =
|
|
817
|
+
const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Ie), h = f.filter((u) => (u == null ? void 0 : u.type) !== Ie);
|
|
816
818
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", l && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...a, children: /* @__PURE__ */ e.jsxs(
|
|
817
819
|
"div",
|
|
818
820
|
{
|
|
@@ -825,12 +827,12 @@ function Ks({
|
|
|
825
827
|
(t || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
826
828
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-modal__title", children: t }),
|
|
827
829
|
r && /* @__PURE__ */ e.jsx(
|
|
828
|
-
|
|
830
|
+
me,
|
|
829
831
|
{
|
|
830
832
|
variant: "ghost",
|
|
831
833
|
size: "small",
|
|
832
|
-
icon: /* @__PURE__ */ e.jsx(ne, { size:
|
|
833
|
-
onClick:
|
|
834
|
+
icon: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 }),
|
|
835
|
+
onClick: d,
|
|
834
836
|
"aria-label": "Close modal"
|
|
835
837
|
}
|
|
836
838
|
)
|
|
@@ -844,7 +846,7 @@ function Ks({
|
|
|
844
846
|
function Ie({ children: s }) {
|
|
845
847
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: s });
|
|
846
848
|
}
|
|
847
|
-
function
|
|
849
|
+
function ms({
|
|
848
850
|
children: s,
|
|
849
851
|
title: t = "Code",
|
|
850
852
|
defaultExpanded: r = !1,
|
|
@@ -854,15 +856,15 @@ function fs({
|
|
|
854
856
|
className: o = "",
|
|
855
857
|
...l
|
|
856
858
|
}) {
|
|
857
|
-
const [m,
|
|
858
|
-
f ? a == null || a(!i) :
|
|
859
|
-
},
|
|
859
|
+
const [m, d] = A(r), f = i !== void 0, p = f ? i : m, h = () => {
|
|
860
|
+
f ? a == null || a(!i) : d((b) => !b);
|
|
861
|
+
}, u = [
|
|
860
862
|
"ds-code-accordion",
|
|
861
863
|
`ds-code-accordion--${n}`,
|
|
862
864
|
p && "ds-code-accordion--expanded",
|
|
863
865
|
o
|
|
864
866
|
].filter(Boolean).join(" ");
|
|
865
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
867
|
+
return /* @__PURE__ */ e.jsxs("div", { className: u, ...l, children: [
|
|
866
868
|
/* @__PURE__ */ e.jsxs(
|
|
867
869
|
"button",
|
|
868
870
|
{
|
|
@@ -875,7 +877,7 @@ function fs({
|
|
|
875
877
|
/* @__PURE__ */ e.jsx(
|
|
876
878
|
xe,
|
|
877
879
|
{
|
|
878
|
-
size:
|
|
880
|
+
size: D[2],
|
|
879
881
|
strokeWidth: 1.5,
|
|
880
882
|
className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
|
|
881
883
|
}
|
|
@@ -886,10 +888,10 @@ function fs({
|
|
|
886
888
|
/* @__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
889
|
] });
|
|
888
890
|
}
|
|
889
|
-
function
|
|
890
|
-
return t ? r ? /* @__PURE__ */ e.jsx(
|
|
891
|
+
function tt({ children: s, block: t = !1, collapsible: r = !1, title: i = "Code", defaultExpanded: a = !1, ...n }) {
|
|
892
|
+
return t ? r ? /* @__PURE__ */ e.jsx(ms, { 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
893
|
}
|
|
892
|
-
function
|
|
894
|
+
function rt({ href: s, children: t, onClick: r, target: i, rel: a, ...n }) {
|
|
893
895
|
const l = i === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
894
896
|
return /* @__PURE__ */ e.jsx(
|
|
895
897
|
"a",
|
|
@@ -904,27 +906,27 @@ function Xs({ href: s, children: t, onClick: r, target: i, rel: a, ...n }) {
|
|
|
904
906
|
}
|
|
905
907
|
);
|
|
906
908
|
}
|
|
907
|
-
function
|
|
908
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children:
|
|
909
|
+
function nt({ children: s, size: t = "m", variant: r = "ghost", ...i }) {
|
|
910
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant: r }) : a) });
|
|
909
911
|
}
|
|
910
|
-
function
|
|
911
|
-
const
|
|
912
|
+
function at({ children: s, selected: t = !1, onClick: r, size: i = "m", variant: a = "ghost", disabled: n = !1, icon: o, href: l, ...m }) {
|
|
913
|
+
const d = o && !s, f = [
|
|
912
914
|
"ds-tab",
|
|
913
915
|
`ds-tab--${i}`,
|
|
914
916
|
`ds-tab--${a}`,
|
|
915
917
|
t && "ds-tab--selected",
|
|
916
|
-
|
|
918
|
+
d && "ds-tab--icon-only"
|
|
917
919
|
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
918
920
|
o && /* @__PURE__ */ e.jsx("span", { className: "ds-tab-icon", children: o }),
|
|
919
921
|
s
|
|
920
922
|
] });
|
|
921
923
|
if (l) {
|
|
922
|
-
const h = (
|
|
924
|
+
const h = (u) => {
|
|
923
925
|
if (n) {
|
|
924
|
-
|
|
926
|
+
u.preventDefault();
|
|
925
927
|
return;
|
|
926
928
|
}
|
|
927
|
-
|
|
929
|
+
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), r == null || r(u));
|
|
928
930
|
};
|
|
929
931
|
return /* @__PURE__ */ e.jsx(
|
|
930
932
|
"a",
|
|
@@ -953,29 +955,29 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
953
955
|
}
|
|
954
956
|
);
|
|
955
957
|
}
|
|
956
|
-
function
|
|
957
|
-
const n =
|
|
958
|
+
function it({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1 }) {
|
|
959
|
+
const n = E(null), o = E(null), [l, m] = A(!1), d = E(!1), f = E(null), p = E(null), h = () => {
|
|
958
960
|
if (!n.current) return;
|
|
959
|
-
const
|
|
960
|
-
if (!
|
|
961
|
-
const
|
|
962
|
-
o.current ? (o.current.style.transition =
|
|
961
|
+
const u = n.current.querySelector(`[data-value="${t}"]`);
|
|
962
|
+
if (!u) return;
|
|
963
|
+
const b = n.current.getBoundingClientRect(), j = u.getBoundingClientRect(), S = j.left - b.left, R = j.width;
|
|
964
|
+
o.current ? (o.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = S + "px", o.current.style.width = R + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
963
965
|
if (!o.current || !n.current) return;
|
|
964
|
-
const
|
|
965
|
-
if (!
|
|
966
|
-
const
|
|
967
|
-
o.current.style.transition = "none", o.current.style.left =
|
|
966
|
+
const B = n.current.querySelector(`[data-value="${t}"]`);
|
|
967
|
+
if (!B) return;
|
|
968
|
+
const y = n.current.getBoundingClientRect(), $ = B.getBoundingClientRect();
|
|
969
|
+
o.current.style.transition = "none", o.current.style.left = $.left - y.left + "px", o.current.style.width = $.width + "px";
|
|
968
970
|
}));
|
|
969
971
|
};
|
|
970
972
|
return p.current = h, Ve(() => {
|
|
971
|
-
const
|
|
972
|
-
f.current = t,
|
|
973
|
-
}),
|
|
973
|
+
const u = f.current !== t;
|
|
974
|
+
f.current = t, d.current = l && u, h();
|
|
975
|
+
}), M(() => {
|
|
974
976
|
if (!n.current) return;
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
+
const u = new ResizeObserver(() => {
|
|
978
|
+
d.current = !1, p.current();
|
|
977
979
|
});
|
|
978
|
-
return
|
|
980
|
+
return u.observe(n.current), () => u.disconnect();
|
|
979
981
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
980
982
|
"div",
|
|
981
983
|
{
|
|
@@ -995,27 +997,27 @@ function Qs({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
995
997
|
"aria-hidden": "true"
|
|
996
998
|
}
|
|
997
999
|
),
|
|
998
|
-
s.map((
|
|
1000
|
+
s.map((u) => /* @__PURE__ */ e.jsxs(
|
|
999
1001
|
"button",
|
|
1000
1002
|
{
|
|
1001
1003
|
type: "button",
|
|
1002
|
-
"data-value":
|
|
1003
|
-
className: ["ds-seg__btn", t ===
|
|
1004
|
-
onClick: () => !a && r(
|
|
1005
|
-
"aria-pressed": t ===
|
|
1004
|
+
"data-value": u.value,
|
|
1005
|
+
className: ["ds-seg__btn", t === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1006
|
+
onClick: () => !a && r(u.value),
|
|
1007
|
+
"aria-pressed": t === u.value,
|
|
1006
1008
|
disabled: a,
|
|
1007
1009
|
children: [
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
+
u.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: u.icon }),
|
|
1011
|
+
u.label
|
|
1010
1012
|
]
|
|
1011
1013
|
},
|
|
1012
|
-
|
|
1014
|
+
u.value
|
|
1013
1015
|
))
|
|
1014
1016
|
]
|
|
1015
1017
|
}
|
|
1016
1018
|
);
|
|
1017
1019
|
}
|
|
1018
|
-
function
|
|
1020
|
+
function Ee({
|
|
1019
1021
|
children: s,
|
|
1020
1022
|
title: t,
|
|
1021
1023
|
defaultExpanded: r = !1,
|
|
@@ -1024,8 +1026,8 @@ function Fe({
|
|
|
1024
1026
|
padding: n = "m",
|
|
1025
1027
|
...o
|
|
1026
1028
|
}) {
|
|
1027
|
-
const [l, m] =
|
|
1028
|
-
|
|
1029
|
+
const [l, m] = A(r), d = i !== void 0, f = d ? i : l, p = () => {
|
|
1030
|
+
d ? a == null || a(!i) : m((u) => !u);
|
|
1029
1031
|
}, h = [
|
|
1030
1032
|
"ds-accordion",
|
|
1031
1033
|
`ds-accordion--${n}`,
|
|
@@ -1044,7 +1046,7 @@ function Fe({
|
|
|
1044
1046
|
/* @__PURE__ */ e.jsx(
|
|
1045
1047
|
xe,
|
|
1046
1048
|
{
|
|
1047
|
-
size:
|
|
1049
|
+
size: D[2],
|
|
1048
1050
|
strokeWidth: 1.5,
|
|
1049
1051
|
className: `ds-accordion__icon ${f ? "ds-accordion__icon--expanded" : ""}`
|
|
1050
1052
|
}
|
|
@@ -1055,8 +1057,8 @@ function Fe({
|
|
|
1055
1057
|
/* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-inner", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-body", children: s }) }) })
|
|
1056
1058
|
] });
|
|
1057
1059
|
}
|
|
1058
|
-
const re = 8,
|
|
1059
|
-
function
|
|
1060
|
+
const re = 8, ce = 8;
|
|
1061
|
+
function ps(s, t, r) {
|
|
1060
1062
|
const i = window.innerWidth;
|
|
1061
1063
|
let a, n;
|
|
1062
1064
|
switch (s) {
|
|
@@ -1075,45 +1077,45 @@ function ms(s, t, r) {
|
|
|
1075
1077
|
default:
|
|
1076
1078
|
a = t.bottom + re, n = t.left;
|
|
1077
1079
|
}
|
|
1078
|
-
const o = Math.max(
|
|
1080
|
+
const o = Math.max(ce, Math.min(i - r.width - ce, n)), l = n - o;
|
|
1079
1081
|
return { top: a, left: o, arrowOffset: l };
|
|
1080
1082
|
}
|
|
1081
|
-
function
|
|
1083
|
+
function hs(s, t, r) {
|
|
1082
1084
|
const i = window.innerWidth, a = window.innerHeight;
|
|
1083
|
-
if (s.top >= t + re +
|
|
1084
|
-
if (a - s.bottom >= t + re +
|
|
1085
|
-
if (i - s.right >= r + re +
|
|
1086
|
-
if (s.left >= r + re +
|
|
1085
|
+
if (s.top >= t + re + ce) return "top";
|
|
1086
|
+
if (a - s.bottom >= t + re + ce) return "bottom";
|
|
1087
|
+
if (i - s.right >= r + re + ce) return "right";
|
|
1088
|
+
if (s.left >= r + re + ce) return "left";
|
|
1087
1089
|
const n = Math.max(s.top, a - s.bottom, s.left, i - s.right);
|
|
1088
1090
|
return n === s.top ? "top" : n === a - s.bottom ? "bottom" : n === i - s.right ? "right" : "left";
|
|
1089
1091
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const [a, n] =
|
|
1092
|
+
function ot({ children: s, content: t, position: r, ...i }) {
|
|
1093
|
+
const [a, n] = A(!1), [o, l] = A({ visibility: "hidden" }), [m, d] = A(r || "top"), f = E(null), p = E(null), h = E(!1), u = () => {
|
|
1092
1094
|
if (!f.current || !p.current) return;
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
+
const j = f.current.getBoundingClientRect(), S = p.current.getBoundingClientRect(), R = r || hs(j, S.height, S.width), { top: B, left: y, arrowOffset: $ } = ps(R, j, S);
|
|
1096
|
+
d(R), l({
|
|
1095
1097
|
position: "fixed",
|
|
1096
|
-
top:
|
|
1097
|
-
left:
|
|
1098
|
+
top: B,
|
|
1099
|
+
left: y,
|
|
1098
1100
|
visibility: "visible",
|
|
1099
|
-
"--arrow-offset": `${
|
|
1101
|
+
"--arrow-offset": `${$}px`
|
|
1100
1102
|
});
|
|
1101
1103
|
};
|
|
1102
|
-
if (
|
|
1104
|
+
if (M(() => {
|
|
1103
1105
|
if (!a) return;
|
|
1104
1106
|
l({ position: "fixed", visibility: "hidden" });
|
|
1105
|
-
const
|
|
1106
|
-
return window.addEventListener("scroll",
|
|
1107
|
-
cancelAnimationFrame(
|
|
1107
|
+
const j = requestAnimationFrame(u);
|
|
1108
|
+
return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1109
|
+
cancelAnimationFrame(j), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1108
1110
|
};
|
|
1109
|
-
}, [a, r]),
|
|
1111
|
+
}, [a, r]), M(() => {
|
|
1110
1112
|
if (!a) return;
|
|
1111
|
-
const
|
|
1112
|
-
f.current && !f.current.contains(
|
|
1113
|
+
const j = (S) => {
|
|
1114
|
+
f.current && !f.current.contains(S.target) && n(!1);
|
|
1113
1115
|
};
|
|
1114
|
-
return document.addEventListener("touchstart",
|
|
1116
|
+
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1115
1117
|
}, [a]), !t) return s;
|
|
1116
|
-
const
|
|
1118
|
+
const b = a && /* @__PURE__ */ e.jsx(
|
|
1117
1119
|
"div",
|
|
1118
1120
|
{
|
|
1119
1121
|
ref: p,
|
|
@@ -1135,17 +1137,17 @@ function et({ children: s, content: t, position: r, ...i }) {
|
|
|
1135
1137
|
h.current || n(!1);
|
|
1136
1138
|
},
|
|
1137
1139
|
onTouchStart: () => {
|
|
1138
|
-
h.current = !0, n((
|
|
1140
|
+
h.current = !0, n((j) => !j);
|
|
1139
1141
|
},
|
|
1140
1142
|
...i,
|
|
1141
1143
|
children: [
|
|
1142
1144
|
s,
|
|
1143
|
-
typeof document < "u" &&
|
|
1145
|
+
typeof document < "u" && pe.createPortal(b, document.body)
|
|
1144
1146
|
]
|
|
1145
1147
|
}
|
|
1146
1148
|
);
|
|
1147
1149
|
}
|
|
1148
|
-
function
|
|
1150
|
+
function lt({
|
|
1149
1151
|
checked: s = !1,
|
|
1150
1152
|
onChange: t,
|
|
1151
1153
|
size: r = "m",
|
|
@@ -1154,7 +1156,7 @@ function st({
|
|
|
1154
1156
|
id: n,
|
|
1155
1157
|
...o
|
|
1156
1158
|
}) {
|
|
1157
|
-
const l = n || `toggle-${
|
|
1159
|
+
const l = n || `toggle-${K.useId()}`, m = [
|
|
1158
1160
|
"ds-toggle",
|
|
1159
1161
|
`ds-toggle--${r}`,
|
|
1160
1162
|
i && "ds-toggle--disabled"
|
|
@@ -1167,7 +1169,7 @@ function st({
|
|
|
1167
1169
|
id: l,
|
|
1168
1170
|
className: "ds-toggle__input",
|
|
1169
1171
|
checked: s,
|
|
1170
|
-
onChange: (
|
|
1172
|
+
onChange: (d) => t == null ? void 0 : t(d.target.checked),
|
|
1171
1173
|
disabled: i,
|
|
1172
1174
|
...o
|
|
1173
1175
|
}
|
|
@@ -1176,7 +1178,7 @@ function st({
|
|
|
1176
1178
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
|
|
1177
1179
|
] });
|
|
1178
1180
|
}
|
|
1179
|
-
function
|
|
1181
|
+
function ct({
|
|
1180
1182
|
checked: s = !1,
|
|
1181
1183
|
onChange: t,
|
|
1182
1184
|
size: r = "m",
|
|
@@ -1185,11 +1187,11 @@ function tt({
|
|
|
1185
1187
|
id: n,
|
|
1186
1188
|
...o
|
|
1187
1189
|
}) {
|
|
1188
|
-
const l = n || `checkbox-${
|
|
1190
|
+
const l = n || `checkbox-${K.useId()}`, m = [
|
|
1189
1191
|
"ds-checkbox",
|
|
1190
1192
|
`ds-checkbox--${r}`,
|
|
1191
1193
|
i && "ds-checkbox--disabled"
|
|
1192
|
-
].filter(Boolean).join(" "),
|
|
1194
|
+
].filter(Boolean).join(" "), d = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1193
1195
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1194
1196
|
/* @__PURE__ */ e.jsx(
|
|
1195
1197
|
"input",
|
|
@@ -1206,7 +1208,7 @@ function tt({
|
|
|
1206
1208
|
/* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ e.jsx(
|
|
1207
1209
|
he,
|
|
1208
1210
|
{
|
|
1209
|
-
size:
|
|
1211
|
+
size: d,
|
|
1210
1212
|
strokeWidth: 2.5,
|
|
1211
1213
|
className: "ds-checkbox__icon"
|
|
1212
1214
|
}
|
|
@@ -1214,7 +1216,7 @@ function tt({
|
|
|
1214
1216
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
|
|
1215
1217
|
] });
|
|
1216
1218
|
}
|
|
1217
|
-
function
|
|
1219
|
+
function dt({
|
|
1218
1220
|
checked: s = !1,
|
|
1219
1221
|
onChange: t,
|
|
1220
1222
|
size: r = "m",
|
|
@@ -1225,17 +1227,17 @@ function rt({
|
|
|
1225
1227
|
id: l,
|
|
1226
1228
|
...m
|
|
1227
1229
|
}) {
|
|
1228
|
-
const
|
|
1230
|
+
const d = l || `radio-${K.useId()}`, f = [
|
|
1229
1231
|
"ds-radio",
|
|
1230
1232
|
`ds-radio--${r}`,
|
|
1231
1233
|
i && "ds-radio--disabled"
|
|
1232
1234
|
].filter(Boolean).join(" ");
|
|
1233
|
-
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor:
|
|
1235
|
+
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: d, children: [
|
|
1234
1236
|
/* @__PURE__ */ e.jsx(
|
|
1235
1237
|
"input",
|
|
1236
1238
|
{
|
|
1237
1239
|
type: "radio",
|
|
1238
|
-
id:
|
|
1240
|
+
id: d,
|
|
1239
1241
|
className: "ds-radio__input",
|
|
1240
1242
|
checked: s,
|
|
1241
1243
|
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
@@ -1249,7 +1251,7 @@ function rt({
|
|
|
1249
1251
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1250
1252
|
] });
|
|
1251
1253
|
}
|
|
1252
|
-
function
|
|
1254
|
+
function xs({ width: s, height: t, shape: r = "rect", aspectRatio: i, className: a = "", style: n = {}, ...o }) {
|
|
1253
1255
|
return /* @__PURE__ */ e.jsx(
|
|
1254
1256
|
"span",
|
|
1255
1257
|
{
|
|
@@ -1260,7 +1262,7 @@ function hs({ width: s, height: t, shape: r = "rect", aspectRatio: i, className:
|
|
|
1260
1262
|
}
|
|
1261
1263
|
);
|
|
1262
1264
|
}
|
|
1263
|
-
function
|
|
1265
|
+
function bs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "", style: a = {}, ...n }) {
|
|
1264
1266
|
return /* @__PURE__ */ e.jsx(
|
|
1265
1267
|
"span",
|
|
1266
1268
|
{
|
|
@@ -1279,7 +1281,7 @@ function xs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "",
|
|
|
1279
1281
|
}
|
|
1280
1282
|
);
|
|
1281
1283
|
}
|
|
1282
|
-
|
|
1284
|
+
xs.Text = bs;
|
|
1283
1285
|
function _s(s) {
|
|
1284
1286
|
let t = 2166136261;
|
|
1285
1287
|
for (let r = 0; r < s.length; r++)
|
|
@@ -1291,8 +1293,8 @@ function js(s) {
|
|
|
1291
1293
|
const t = s.trim().split(/\s+/);
|
|
1292
1294
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1293
1295
|
}
|
|
1294
|
-
function
|
|
1295
|
-
const l = _s(s ?? ""), [m,
|
|
1296
|
+
function ut({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style: n = {}, ...o }) {
|
|
1297
|
+
const l = _s(s ?? ""), [m, d] = A(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: js(s) });
|
|
1296
1298
|
return /* @__PURE__ */ e.jsx(
|
|
1297
1299
|
"div",
|
|
1298
1300
|
{
|
|
@@ -1300,11 +1302,11 @@ function nt({ seed: s, icon: t, src: r, size: i = 32, className: a = "", style:
|
|
|
1300
1302
|
style: { width: i, height: i, "--ds-avatar-h": l, ...n },
|
|
1301
1303
|
"aria-hidden": "true",
|
|
1302
1304
|
...o,
|
|
1303
|
-
children: r && !m ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () =>
|
|
1305
|
+
children: r && !m ? /* @__PURE__ */ e.jsx("img", { src: r, alt: "", onError: () => d(!0) }) : f
|
|
1304
1306
|
}
|
|
1305
1307
|
);
|
|
1306
1308
|
}
|
|
1307
|
-
function
|
|
1309
|
+
function ft({
|
|
1308
1310
|
children: s,
|
|
1309
1311
|
size: t = "compact",
|
|
1310
1312
|
stickyTop: r,
|
|
@@ -1334,13 +1336,13 @@ function at({
|
|
|
1334
1336
|
}
|
|
1335
1337
|
);
|
|
1336
1338
|
}
|
|
1337
|
-
function
|
|
1339
|
+
function mt({ children: s, ...t }) {
|
|
1338
1340
|
return /* @__PURE__ */ e.jsx("thead", { ...t, children: s });
|
|
1339
1341
|
}
|
|
1340
|
-
function
|
|
1342
|
+
function pt({ children: s, ...t }) {
|
|
1341
1343
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1342
1344
|
}
|
|
1343
|
-
function
|
|
1345
|
+
function ht({ children: s, interactive: t, selected: r, subheader: i, exiting: a, updated: n, className: o = "", onClick: l, ...m }) {
|
|
1344
1346
|
return /* @__PURE__ */ e.jsx(
|
|
1345
1347
|
"tr",
|
|
1346
1348
|
{
|
|
@@ -1359,11 +1361,11 @@ function lt({ children: s, interactive: t, selected: r, subheader: i, exiting: a
|
|
|
1359
1361
|
}
|
|
1360
1362
|
);
|
|
1361
1363
|
}
|
|
1362
|
-
function
|
|
1364
|
+
function xt({ children: s, colSpan: t = 999, ...r }) {
|
|
1363
1365
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1364
1366
|
}
|
|
1365
|
-
function
|
|
1366
|
-
const m = !!i || r !== void 0,
|
|
1367
|
+
function bt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, className: n = "", style: o = {}, ...l }) {
|
|
1368
|
+
const m = !!i || r !== void 0, d = r === "asc" ? qe : r === "desc" ? xe : Ke;
|
|
1367
1369
|
return /* @__PURE__ */ e.jsx(
|
|
1368
1370
|
"th",
|
|
1369
1371
|
{
|
|
@@ -1379,12 +1381,12 @@ function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
|
|
|
1379
1381
|
...l,
|
|
1380
1382
|
children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1381
1383
|
s,
|
|
1382
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(
|
|
1384
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(d, { size: 11, strokeWidth: 2.5 }) })
|
|
1383
1385
|
] }) : s
|
|
1384
1386
|
}
|
|
1385
1387
|
);
|
|
1386
1388
|
}
|
|
1387
|
-
function
|
|
1389
|
+
function _t({ children: s, align: t = "left", secondary: r, muted: i, truncate: a, nowrap: n, className: o = "", ...l }) {
|
|
1388
1390
|
return /* @__PURE__ */ e.jsx(
|
|
1389
1391
|
"td",
|
|
1390
1392
|
{
|
|
@@ -1402,7 +1404,7 @@ function ut({ children: s, align: t = "left", secondary: r, muted: i, truncate:
|
|
|
1402
1404
|
}
|
|
1403
1405
|
);
|
|
1404
1406
|
}
|
|
1405
|
-
function
|
|
1407
|
+
function jt({
|
|
1406
1408
|
icon: s,
|
|
1407
1409
|
title: t,
|
|
1408
1410
|
description: r,
|
|
@@ -1425,7 +1427,7 @@ function ft({
|
|
|
1425
1427
|
}
|
|
1426
1428
|
);
|
|
1427
1429
|
}
|
|
1428
|
-
function
|
|
1430
|
+
function vt({
|
|
1429
1431
|
label: s,
|
|
1430
1432
|
hint: t,
|
|
1431
1433
|
error: r,
|
|
@@ -1435,9 +1437,9 @@ function mt({
|
|
|
1435
1437
|
children: o,
|
|
1436
1438
|
className: l = "",
|
|
1437
1439
|
style: m,
|
|
1438
|
-
...
|
|
1440
|
+
...d
|
|
1439
1441
|
}) {
|
|
1440
|
-
const f =
|
|
1442
|
+
const f = K.useId(), p = n ?? f, h = `${p}-hint`, u = `${p}-error`;
|
|
1441
1443
|
return /* @__PURE__ */ e.jsxs(
|
|
1442
1444
|
"div",
|
|
1443
1445
|
{
|
|
@@ -1446,17 +1448,17 @@ function mt({
|
|
|
1446
1448
|
"data-required": i ? "" : void 0,
|
|
1447
1449
|
"data-disabled": a ? "" : void 0,
|
|
1448
1450
|
style: m,
|
|
1449
|
-
...
|
|
1451
|
+
...d,
|
|
1450
1452
|
children: [
|
|
1451
1453
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1452
1454
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
|
|
1453
1455
|
t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1454
|
-
r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id:
|
|
1456
|
+
r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: r })
|
|
1455
1457
|
]
|
|
1456
1458
|
}
|
|
1457
1459
|
);
|
|
1458
1460
|
}
|
|
1459
|
-
function
|
|
1461
|
+
function Nt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
|
|
1460
1462
|
const m = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
|
|
1461
1463
|
return /* @__PURE__ */ e.jsxs(
|
|
1462
1464
|
"div",
|
|
@@ -1477,7 +1479,7 @@ function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
|
|
|
1477
1479
|
}
|
|
1478
1480
|
);
|
|
1479
1481
|
}
|
|
1480
|
-
function
|
|
1482
|
+
function wt({
|
|
1481
1483
|
children: s,
|
|
1482
1484
|
separator: t = "/",
|
|
1483
1485
|
"aria-label": r = "Breadcrumb",
|
|
@@ -1485,7 +1487,7 @@ function ht({
|
|
|
1485
1487
|
style: a,
|
|
1486
1488
|
...n
|
|
1487
1489
|
}) {
|
|
1488
|
-
const o =
|
|
1490
|
+
const o = K.Children.toArray(s).filter(Boolean);
|
|
1489
1491
|
return /* @__PURE__ */ e.jsx(
|
|
1490
1492
|
"nav",
|
|
1491
1493
|
{
|
|
@@ -1500,7 +1502,7 @@ function ht({
|
|
|
1500
1502
|
}
|
|
1501
1503
|
);
|
|
1502
1504
|
}
|
|
1503
|
-
function
|
|
1505
|
+
function gt({
|
|
1504
1506
|
page: s,
|
|
1505
1507
|
total: t,
|
|
1506
1508
|
onChange: r,
|
|
@@ -1510,7 +1512,7 @@ function xt({
|
|
|
1510
1512
|
style: o,
|
|
1511
1513
|
...l
|
|
1512
1514
|
}) {
|
|
1513
|
-
const m =
|
|
1515
|
+
const m = vs(s, t, i);
|
|
1514
1516
|
return /* @__PURE__ */ e.jsxs(
|
|
1515
1517
|
"nav",
|
|
1516
1518
|
{
|
|
@@ -1526,20 +1528,20 @@ function xt({
|
|
|
1526
1528
|
onClick: () => r == null ? void 0 : r(s - 1),
|
|
1527
1529
|
disabled: s <= 1,
|
|
1528
1530
|
"aria-label": "Previous page",
|
|
1529
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1531
|
+
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
1530
1532
|
}
|
|
1531
1533
|
),
|
|
1532
1534
|
m.map(
|
|
1533
|
-
(
|
|
1535
|
+
(d, f) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
|
|
1534
1536
|
"button",
|
|
1535
1537
|
{
|
|
1536
|
-
className: `ds-pagination-page${
|
|
1537
|
-
onClick: () =>
|
|
1538
|
-
"aria-current":
|
|
1539
|
-
"aria-label": `Page ${
|
|
1540
|
-
children:
|
|
1538
|
+
className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
|
|
1539
|
+
onClick: () => d !== s && (r == null ? void 0 : r(d)),
|
|
1540
|
+
"aria-current": d === s ? "page" : void 0,
|
|
1541
|
+
"aria-label": `Page ${d}`,
|
|
1542
|
+
children: d
|
|
1541
1543
|
},
|
|
1542
|
-
|
|
1544
|
+
d
|
|
1543
1545
|
)
|
|
1544
1546
|
),
|
|
1545
1547
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1549,44 +1551,44 @@ function xt({
|
|
|
1549
1551
|
onClick: () => r == null ? void 0 : r(s + 1),
|
|
1550
1552
|
disabled: s >= t,
|
|
1551
1553
|
"aria-label": "Next page",
|
|
1552
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1554
|
+
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1553
1555
|
}
|
|
1554
1556
|
)
|
|
1555
1557
|
]
|
|
1556
1558
|
}
|
|
1557
1559
|
);
|
|
1558
1560
|
}
|
|
1559
|
-
function
|
|
1561
|
+
function vs(s, t, r) {
|
|
1560
1562
|
if (t <= 7) return Array.from({ length: t }, (o, l) => l + 1);
|
|
1561
1563
|
const i = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
|
|
1562
1564
|
i > 2 && n.push("…");
|
|
1563
1565
|
for (let o = i; o <= a; o++) n.push(o);
|
|
1564
1566
|
return a < t - 1 && n.push("…"), n.push(t), n;
|
|
1565
1567
|
}
|
|
1566
|
-
const
|
|
1567
|
-
function
|
|
1568
|
+
const Ns = 200;
|
|
1569
|
+
function yt({
|
|
1568
1570
|
children: s,
|
|
1569
1571
|
title: t,
|
|
1570
1572
|
onClose: r,
|
|
1571
1573
|
side: i = "right",
|
|
1572
1574
|
...a
|
|
1573
1575
|
}) {
|
|
1574
|
-
const n =
|
|
1576
|
+
const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
|
|
1575
1577
|
!r || l || (m(!0), setTimeout(() => {
|
|
1576
1578
|
m(!1), r();
|
|
1577
|
-
},
|
|
1579
|
+
}, Ns));
|
|
1578
1580
|
};
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
|
|
1582
|
-
},
|
|
1583
|
-
n.current && !n.current.contains(
|
|
1581
|
+
M(() => {
|
|
1582
|
+
const u = (j) => {
|
|
1583
|
+
j.key === "Escape" && d();
|
|
1584
|
+
}, b = (j) => {
|
|
1585
|
+
n.current && !n.current.contains(j.target) && d();
|
|
1584
1586
|
};
|
|
1585
|
-
return document.addEventListener("keydown",
|
|
1586
|
-
document.removeEventListener("keydown",
|
|
1587
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
1588
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
1587
1589
|
};
|
|
1588
1590
|
}, [r, l]);
|
|
1589
|
-
const f =
|
|
1591
|
+
const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Be), h = f.filter((u) => (u == null ? void 0 : u.type) !== Be);
|
|
1590
1592
|
return /* @__PURE__ */ e.jsx(
|
|
1591
1593
|
"div",
|
|
1592
1594
|
{
|
|
@@ -1604,7 +1606,7 @@ function _t({
|
|
|
1604
1606
|
children: [
|
|
1605
1607
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1606
1608
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
|
|
1607
|
-
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick:
|
|
1609
|
+
r && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 }) })
|
|
1608
1610
|
] }),
|
|
1609
1611
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1610
1612
|
p
|
|
@@ -1614,16 +1616,16 @@ function _t({
|
|
|
1614
1616
|
}
|
|
1615
1617
|
);
|
|
1616
1618
|
}
|
|
1617
|
-
function
|
|
1619
|
+
function Be({ children: s }) {
|
|
1618
1620
|
return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: s });
|
|
1619
1621
|
}
|
|
1620
|
-
const
|
|
1622
|
+
const ws = {
|
|
1621
1623
|
info: ke,
|
|
1622
|
-
success:
|
|
1623
|
-
warning:
|
|
1624
|
+
success: ye,
|
|
1625
|
+
warning: ge,
|
|
1624
1626
|
error: we
|
|
1625
1627
|
};
|
|
1626
|
-
function
|
|
1628
|
+
function kt({
|
|
1627
1629
|
children: s,
|
|
1628
1630
|
variant: t = "info",
|
|
1629
1631
|
action: r,
|
|
@@ -1632,7 +1634,7 @@ function jt({
|
|
|
1632
1634
|
role: n,
|
|
1633
1635
|
...o
|
|
1634
1636
|
}) {
|
|
1635
|
-
const l =
|
|
1637
|
+
const l = ws[t], m = n || (t === "error" ? "alert" : "status");
|
|
1636
1638
|
return /* @__PURE__ */ e.jsxs(
|
|
1637
1639
|
"div",
|
|
1638
1640
|
{
|
|
@@ -1640,7 +1642,7 @@ function jt({
|
|
|
1640
1642
|
role: m,
|
|
1641
1643
|
...o,
|
|
1642
1644
|
children: [
|
|
1643
|
-
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size:
|
|
1645
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: D[2], strokeWidth: 1.5 }) }),
|
|
1644
1646
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1645
1647
|
r && /* @__PURE__ */ e.jsx(
|
|
1646
1648
|
"button",
|
|
@@ -1658,14 +1660,14 @@ function jt({
|
|
|
1658
1660
|
className: "ds-banner-dismiss",
|
|
1659
1661
|
onClick: a,
|
|
1660
1662
|
"aria-label": "Dismiss",
|
|
1661
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1663
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 })
|
|
1662
1664
|
}
|
|
1663
1665
|
)
|
|
1664
1666
|
]
|
|
1665
1667
|
}
|
|
1666
1668
|
);
|
|
1667
1669
|
}
|
|
1668
|
-
function
|
|
1670
|
+
function Et({
|
|
1669
1671
|
trigger: s,
|
|
1670
1672
|
items: t = [],
|
|
1671
1673
|
open: r,
|
|
@@ -1675,131 +1677,133 @@ function bt({
|
|
|
1675
1677
|
style: o,
|
|
1676
1678
|
...l
|
|
1677
1679
|
}) {
|
|
1678
|
-
const [m,
|
|
1680
|
+
const [m, d] = A(!1), [f, p] = A(!1), h = r !== void 0, u = h ? r : m, b = E(null), j = E(null), S = E(null), R = E(null), [B, y] = A({}), $ = E(null), O = 150, I = () => {
|
|
1679
1681
|
if (h)
|
|
1680
1682
|
i == null || i(!1);
|
|
1681
1683
|
else {
|
|
1682
1684
|
if (f) return;
|
|
1683
|
-
p(!0),
|
|
1684
|
-
|
|
1685
|
+
p(!0), $.current = setTimeout(() => {
|
|
1686
|
+
d(!1), p(!1);
|
|
1685
1687
|
}, O);
|
|
1686
1688
|
}
|
|
1687
|
-
},
|
|
1688
|
-
const
|
|
1689
|
-
h ? i == null || i(
|
|
1690
|
-
},
|
|
1691
|
-
|
|
1689
|
+
}, Y = () => {
|
|
1690
|
+
const x = !u;
|
|
1691
|
+
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) : I();
|
|
1692
|
+
}, q = () => {
|
|
1693
|
+
u || (h ? i == null || i(!0) : (clearTimeout($.current), p(!1), d(!0)));
|
|
1692
1694
|
};
|
|
1693
|
-
|
|
1694
|
-
if (!
|
|
1695
|
-
const
|
|
1696
|
-
var
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
|
|
1695
|
+
M(() => () => clearTimeout($.current), []), M(() => {
|
|
1696
|
+
if (!u) return;
|
|
1697
|
+
const x = 300, v = () => {
|
|
1698
|
+
var X;
|
|
1699
|
+
const k = (X = b.current) == null ? void 0 : X.getBoundingClientRect();
|
|
1700
|
+
if (!k) return;
|
|
1701
|
+
const L = window.innerHeight - k.bottom, H = L < x + 8 && k.top > L;
|
|
1702
|
+
y(
|
|
1703
|
+
a === "right" ? H ? { bottom: window.innerHeight - k.top + 4, top: "auto", right: window.innerWidth - k.right } : { top: k.bottom + 4, bottom: "auto", right: window.innerWidth - k.right } : H ? { bottom: window.innerHeight - k.top + 4, top: "auto", left: k.left } : { top: k.bottom + 4, bottom: "auto", left: k.left }
|
|
1700
1704
|
);
|
|
1701
1705
|
};
|
|
1702
|
-
return
|
|
1703
|
-
window.removeEventListener("scroll",
|
|
1706
|
+
return v(), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v), () => {
|
|
1707
|
+
window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
|
|
1704
1708
|
};
|
|
1705
|
-
}, [
|
|
1706
|
-
const
|
|
1707
|
-
var
|
|
1708
|
-
const
|
|
1709
|
+
}, [u, a]);
|
|
1710
|
+
const P = () => {
|
|
1711
|
+
var v;
|
|
1712
|
+
const x = (v = S.current) == null ? void 0 : v.querySelector(
|
|
1709
1713
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
1710
1714
|
);
|
|
1711
|
-
|
|
1715
|
+
x == null || x.focus();
|
|
1712
1716
|
};
|
|
1713
|
-
|
|
1714
|
-
if (!
|
|
1715
|
-
const
|
|
1716
|
-
var
|
|
1717
|
-
!((
|
|
1718
|
-
},
|
|
1719
|
-
|
|
1717
|
+
M(() => {
|
|
1718
|
+
if (!u) return;
|
|
1719
|
+
const x = (k) => {
|
|
1720
|
+
var L, H;
|
|
1721
|
+
!((L = b.current) != null && L.contains(k.target)) && !((H = j.current) != null && H.contains(k.target)) && I();
|
|
1722
|
+
}, v = (k) => {
|
|
1723
|
+
k.key === "Escape" && (I(), P());
|
|
1720
1724
|
};
|
|
1721
|
-
return document.addEventListener("mousedown",
|
|
1722
|
-
document.removeEventListener("mousedown",
|
|
1725
|
+
return document.addEventListener("mousedown", x), document.addEventListener("keydown", v), () => {
|
|
1726
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", v);
|
|
1723
1727
|
};
|
|
1724
|
-
}, [
|
|
1725
|
-
if (!
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1728
|
-
}, [
|
|
1729
|
-
const
|
|
1728
|
+
}, [u]), M(() => {
|
|
1729
|
+
if (!u || !R.current || !j.current) return;
|
|
1730
|
+
const x = N(), v = R.current === "last" ? x[x.length - 1] : x[0];
|
|
1731
|
+
v == null || v.focus(), R.current = null;
|
|
1732
|
+
}, [u]);
|
|
1733
|
+
const N = () => j.current ? [...j.current.querySelectorAll(
|
|
1730
1734
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1731
|
-
)] : [],
|
|
1732
|
-
var
|
|
1733
|
-
if (
|
|
1734
|
-
|
|
1735
|
-
else if (
|
|
1736
|
-
if (
|
|
1737
|
-
|
|
1735
|
+
)] : [], C = (x) => {
|
|
1736
|
+
var v, k;
|
|
1737
|
+
if (x.key === "ArrowDown")
|
|
1738
|
+
x.preventDefault(), u ? (v = N()[0]) == null || v.focus() : (R.current = "first", q());
|
|
1739
|
+
else if (x.key === "ArrowUp")
|
|
1740
|
+
if (x.preventDefault(), !u)
|
|
1741
|
+
R.current = "last", q();
|
|
1738
1742
|
else {
|
|
1739
|
-
const
|
|
1740
|
-
(
|
|
1743
|
+
const L = N();
|
|
1744
|
+
(k = L[L.length - 1]) == null || k.focus();
|
|
1741
1745
|
}
|
|
1742
|
-
},
|
|
1743
|
-
var
|
|
1744
|
-
const
|
|
1745
|
-
switch (
|
|
1746
|
+
}, G = (x) => {
|
|
1747
|
+
var L, H, X, g;
|
|
1748
|
+
const v = N(), k = v.findIndex((c) => c === document.activeElement);
|
|
1749
|
+
switch (x.key) {
|
|
1746
1750
|
case "ArrowDown":
|
|
1747
|
-
|
|
1751
|
+
x.preventDefault(), (L = v[Math.min(k + 1, v.length - 1)]) == null || L.focus();
|
|
1748
1752
|
break;
|
|
1749
1753
|
case "ArrowUp":
|
|
1750
|
-
|
|
1754
|
+
x.preventDefault(), k <= 0 ? P() : (H = v[k - 1]) == null || H.focus();
|
|
1751
1755
|
break;
|
|
1752
1756
|
case "Home":
|
|
1753
|
-
|
|
1757
|
+
x.preventDefault(), (X = v[0]) == null || X.focus();
|
|
1754
1758
|
break;
|
|
1755
1759
|
case "End":
|
|
1756
|
-
|
|
1760
|
+
x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
|
|
1757
1761
|
break;
|
|
1758
1762
|
case "Tab":
|
|
1759
|
-
|
|
1763
|
+
I();
|
|
1760
1764
|
break;
|
|
1761
1765
|
}
|
|
1762
|
-
}, U =
|
|
1766
|
+
}, U = u && /* @__PURE__ */ e.jsx(
|
|
1763
1767
|
"div",
|
|
1764
1768
|
{
|
|
1765
|
-
ref:
|
|
1769
|
+
ref: j,
|
|
1766
1770
|
role: "menu",
|
|
1767
1771
|
className: [
|
|
1768
1772
|
"ds-dropdown__menu",
|
|
1769
1773
|
`ds-dropdown__menu--${a}`,
|
|
1770
1774
|
f && "ds-dropdown__menu--closing"
|
|
1771
1775
|
].filter(Boolean).join(" "),
|
|
1772
|
-
style:
|
|
1773
|
-
onKeyDown:
|
|
1774
|
-
children: t.map((
|
|
1775
|
-
if (
|
|
1776
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" },
|
|
1777
|
-
if (
|
|
1776
|
+
style: B,
|
|
1777
|
+
onKeyDown: G,
|
|
1778
|
+
children: t.map((x, v) => {
|
|
1779
|
+
if (x.separator)
|
|
1780
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, v);
|
|
1781
|
+
if (x.type === "section")
|
|
1778
1782
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
1779
|
-
|
|
1780
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
1781
|
-
] },
|
|
1782
|
-
const
|
|
1783
|
+
x.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
|
|
1784
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
|
|
1785
|
+
] }, v);
|
|
1786
|
+
const k = !!x.href, L = k ? "a" : "button", H = k ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
|
|
1783
1787
|
return /* @__PURE__ */ e.jsxs(
|
|
1784
|
-
|
|
1788
|
+
L,
|
|
1785
1789
|
{
|
|
1786
1790
|
role: "menuitem",
|
|
1787
1791
|
className: [
|
|
1788
1792
|
"ds-dropdown__item",
|
|
1789
|
-
|
|
1793
|
+
x.danger && "ds-dropdown__item--danger"
|
|
1790
1794
|
].filter(Boolean).join(" "),
|
|
1791
|
-
...
|
|
1795
|
+
...H,
|
|
1792
1796
|
onClick: () => {
|
|
1793
|
-
var
|
|
1794
|
-
(
|
|
1797
|
+
var X;
|
|
1798
|
+
(X = x.onClick) == null || X.call(x), I();
|
|
1795
1799
|
},
|
|
1796
1800
|
children: [
|
|
1797
|
-
|
|
1798
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
1799
|
-
|
|
1801
|
+
x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
1802
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: x.label }),
|
|
1803
|
+
x.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: x.shortcut })
|
|
1800
1804
|
]
|
|
1801
1805
|
},
|
|
1802
|
-
|
|
1806
|
+
v
|
|
1803
1807
|
);
|
|
1804
1808
|
})
|
|
1805
1809
|
}
|
|
@@ -1807,7 +1811,7 @@ function bt({
|
|
|
1807
1811
|
return /* @__PURE__ */ e.jsxs(
|
|
1808
1812
|
"div",
|
|
1809
1813
|
{
|
|
1810
|
-
ref:
|
|
1814
|
+
ref: b,
|
|
1811
1815
|
className: ["ds-dropdown", n].filter(Boolean).join(" "),
|
|
1812
1816
|
style: o,
|
|
1813
1817
|
...l,
|
|
@@ -1815,19 +1819,19 @@ function bt({
|
|
|
1815
1819
|
/* @__PURE__ */ e.jsx(
|
|
1816
1820
|
"div",
|
|
1817
1821
|
{
|
|
1818
|
-
ref:
|
|
1822
|
+
ref: S,
|
|
1819
1823
|
className: "ds-dropdown__trigger",
|
|
1820
|
-
onClick:
|
|
1821
|
-
onKeyDown:
|
|
1824
|
+
onClick: Y,
|
|
1825
|
+
onKeyDown: C,
|
|
1822
1826
|
children: s
|
|
1823
1827
|
}
|
|
1824
1828
|
),
|
|
1825
|
-
typeof document < "u" &&
|
|
1829
|
+
typeof document < "u" && pe.createPortal(U, document.body)
|
|
1826
1830
|
]
|
|
1827
1831
|
}
|
|
1828
1832
|
);
|
|
1829
1833
|
}
|
|
1830
|
-
function
|
|
1834
|
+
function $t({
|
|
1831
1835
|
value: s = 0,
|
|
1832
1836
|
size: t = "m",
|
|
1833
1837
|
variant: r = "default",
|
|
@@ -1864,10 +1868,10 @@ function vt({
|
|
|
1864
1868
|
}
|
|
1865
1869
|
);
|
|
1866
1870
|
}
|
|
1867
|
-
const
|
|
1868
|
-
function
|
|
1869
|
-
const [r, i] =
|
|
1870
|
-
return
|
|
1871
|
+
const gs = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1872
|
+
function ks(s, { duration: t = 600 } = {}) {
|
|
1873
|
+
const [r, i] = A(s), a = E(s), n = E(null);
|
|
1874
|
+
return M(() => {
|
|
1871
1875
|
if (ys()) {
|
|
1872
1876
|
i(s), a.current = s;
|
|
1873
1877
|
return;
|
|
@@ -1875,27 +1879,27 @@ function gs(s, { duration: t = 600 } = {}) {
|
|
|
1875
1879
|
const o = a.current, l = s - o;
|
|
1876
1880
|
if (l === 0) return;
|
|
1877
1881
|
let m = null;
|
|
1878
|
-
const
|
|
1882
|
+
const d = (f) => {
|
|
1879
1883
|
m || (m = f);
|
|
1880
1884
|
const p = Math.min((f - m) / t, 1);
|
|
1881
|
-
i(o + l *
|
|
1885
|
+
i(o + l * gs(p)), p < 1 ? n.current = requestAnimationFrame(d) : a.current = s;
|
|
1882
1886
|
};
|
|
1883
|
-
return n.current = requestAnimationFrame(
|
|
1887
|
+
return n.current = requestAnimationFrame(d), () => cancelAnimationFrame(n.current);
|
|
1884
1888
|
}, [s, t]), r;
|
|
1885
1889
|
}
|
|
1886
|
-
function
|
|
1890
|
+
function Tt({
|
|
1887
1891
|
value: s,
|
|
1888
1892
|
duration: t = 600,
|
|
1889
1893
|
decimals: r = 0,
|
|
1890
1894
|
prefix: i = "",
|
|
1891
1895
|
suffix: a = ""
|
|
1892
1896
|
}) {
|
|
1893
|
-
const o =
|
|
1897
|
+
const o = ks(s, { duration: t }).toFixed(r);
|
|
1894
1898
|
return `${i}${o}${a}`;
|
|
1895
1899
|
}
|
|
1896
|
-
function
|
|
1897
|
-
const i =
|
|
1898
|
-
return
|
|
1900
|
+
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
1901
|
+
const i = E(null), [a, n] = A(!1);
|
|
1902
|
+
return M(() => {
|
|
1899
1903
|
const o = i.current;
|
|
1900
1904
|
if (!o) return;
|
|
1901
1905
|
const l = new IntersectionObserver(
|
|
@@ -1907,7 +1911,7 @@ function ks({ threshold: s = 0.1, rootMargin: t = "0px", once: r = !1 } = {}) {
|
|
|
1907
1911
|
return l.observe(o), () => l.disconnect();
|
|
1908
1912
|
}, [s, t, r]), { ref: i, inView: a };
|
|
1909
1913
|
}
|
|
1910
|
-
function
|
|
1914
|
+
function Rt({
|
|
1911
1915
|
children: s,
|
|
1912
1916
|
as: t = "div",
|
|
1913
1917
|
once: r = !1,
|
|
@@ -1917,31 +1921,31 @@ function wt({
|
|
|
1917
1921
|
onLeave: o,
|
|
1918
1922
|
...l
|
|
1919
1923
|
}) {
|
|
1920
|
-
const { ref: m, inView:
|
|
1921
|
-
return
|
|
1922
|
-
|
|
1923
|
-
}, [
|
|
1924
|
+
const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once: r }), f = E(!1);
|
|
1925
|
+
return M(() => {
|
|
1926
|
+
d && !f.current && (n == null || n()), !d && f.current && (o == null || o()), f.current = d;
|
|
1927
|
+
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1924
1928
|
}
|
|
1925
|
-
const
|
|
1929
|
+
const Me = {
|
|
1926
1930
|
default: ke,
|
|
1927
|
-
success:
|
|
1928
|
-
warning:
|
|
1931
|
+
success: ye,
|
|
1932
|
+
warning: ge,
|
|
1929
1933
|
error: we
|
|
1930
1934
|
};
|
|
1931
|
-
let
|
|
1932
|
-
const
|
|
1935
|
+
let de = [];
|
|
1936
|
+
const ve = /* @__PURE__ */ new Set();
|
|
1933
1937
|
function We() {
|
|
1934
|
-
|
|
1935
|
-
}
|
|
1936
|
-
function Es(s) {
|
|
1937
|
-
ce = [...ce, s], We();
|
|
1938
|
+
ve.forEach((s) => s([...de]));
|
|
1938
1939
|
}
|
|
1939
1940
|
function $s(s) {
|
|
1940
|
-
|
|
1941
|
+
de = [...de, s], We();
|
|
1941
1942
|
}
|
|
1942
|
-
function
|
|
1943
|
+
function Ts(s) {
|
|
1944
|
+
de = de.filter((t) => t.id !== s), We();
|
|
1945
|
+
}
|
|
1946
|
+
function St() {
|
|
1943
1947
|
const s = (t, r = {}) => {
|
|
1944
|
-
|
|
1948
|
+
$s({
|
|
1945
1949
|
id: `${Date.now()}-${Math.random()}`,
|
|
1946
1950
|
message: t,
|
|
1947
1951
|
type: "default",
|
|
@@ -1951,13 +1955,13 @@ function yt() {
|
|
|
1951
1955
|
};
|
|
1952
1956
|
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 };
|
|
1953
1957
|
}
|
|
1954
|
-
function
|
|
1955
|
-
const [r, i] =
|
|
1956
|
-
|
|
1958
|
+
function Rs({ data: s, onDismiss: t }) {
|
|
1959
|
+
const [r, i] = A(!1), a = E(null);
|
|
1960
|
+
M(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() => n(), s.duration)), () => clearTimeout(a.current)), []);
|
|
1957
1961
|
function n() {
|
|
1958
1962
|
i(!1), setTimeout(() => t(s.id), 250);
|
|
1959
1963
|
}
|
|
1960
|
-
const o =
|
|
1964
|
+
const o = Me[s.type] ?? Me.default;
|
|
1961
1965
|
return /* @__PURE__ */ e.jsxs(
|
|
1962
1966
|
"div",
|
|
1963
1967
|
{
|
|
@@ -1969,7 +1973,7 @@ function Ts({ data: s, onDismiss: t }) {
|
|
|
1969
1973
|
role: s.type === "error" ? "alert" : "status",
|
|
1970
1974
|
"aria-live": "polite",
|
|
1971
1975
|
children: [
|
|
1972
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(o, { size:
|
|
1976
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(o, { size: D[3], strokeWidth: 1.5 }) }),
|
|
1973
1977
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: s.message }),
|
|
1974
1978
|
/* @__PURE__ */ e.jsx(
|
|
1975
1979
|
"button",
|
|
@@ -1977,26 +1981,26 @@ function Ts({ data: s, onDismiss: t }) {
|
|
|
1977
1981
|
className: "ds-toast__close",
|
|
1978
1982
|
onClick: n,
|
|
1979
1983
|
"aria-label": "Закрыть",
|
|
1980
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1984
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[3], strokeWidth: 1.5 })
|
|
1981
1985
|
}
|
|
1982
1986
|
)
|
|
1983
1987
|
]
|
|
1984
1988
|
}
|
|
1985
1989
|
);
|
|
1986
1990
|
}
|
|
1987
|
-
function
|
|
1988
|
-
const [t, r] =
|
|
1989
|
-
return
|
|
1990
|
-
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(
|
|
1991
|
+
function At({ position: s = "bottom-right" }) {
|
|
1992
|
+
const [t, r] = A(() => [...de]);
|
|
1993
|
+
return M(() => (ve.add(r), () => ve.delete(r)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
1994
|
+
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(Rs, { data: i, onDismiss: Ts }, i.id)) }),
|
|
1991
1995
|
document.body
|
|
1992
1996
|
);
|
|
1993
1997
|
}
|
|
1994
|
-
const
|
|
1995
|
-
running: /* @__PURE__ */ e.jsx(
|
|
1996
|
-
success: /* @__PURE__ */ e.jsx(
|
|
1997
|
-
error: /* @__PURE__ */ e.jsx(
|
|
1998
|
+
const Ss = {
|
|
1999
|
+
running: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "info", children: "Running..." }),
|
|
2000
|
+
success: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "success", children: "Done" }),
|
|
2001
|
+
error: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "error", children: "Error" })
|
|
1998
2002
|
};
|
|
1999
|
-
function
|
|
2003
|
+
function Dt({
|
|
2000
2004
|
label: s,
|
|
2001
2005
|
status: t = "idle",
|
|
2002
2006
|
icon: r,
|
|
@@ -2004,88 +2008,82 @@ function kt({
|
|
|
2004
2008
|
defaultExpanded: a = !1,
|
|
2005
2009
|
expanded: n,
|
|
2006
2010
|
onToggle: o,
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
...
|
|
2011
|
+
children: l,
|
|
2012
|
+
className: m = "",
|
|
2013
|
+
...d
|
|
2010
2014
|
}) {
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
"button",
|
|
2017
|
-
{
|
|
2018
|
-
type: "button",
|
|
2019
|
-
className: "ds-tool-card__header",
|
|
2020
|
-
onClick: R,
|
|
2021
|
-
"aria-expanded": b,
|
|
2022
|
-
"aria-controls": p,
|
|
2023
|
-
children: [
|
|
2024
|
-
/* @__PURE__ */ e.jsx(
|
|
2025
|
-
Oe,
|
|
2026
|
-
{
|
|
2027
|
-
size: I[1],
|
|
2028
|
-
strokeWidth: 1.5,
|
|
2029
|
-
className: `ds-tool-card__chevron${b ? " ds-tool-card__chevron--expanded" : ""}`
|
|
2030
|
-
}
|
|
2031
|
-
),
|
|
2032
|
-
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
|
|
2033
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2034
|
-
Rs[t],
|
|
2035
|
-
i
|
|
2036
|
-
]
|
|
2037
|
-
}
|
|
2038
|
-
),
|
|
2039
|
-
b && /* @__PURE__ */ e.jsx("div", { id: p, className: "ds-tool-card__body", children: m })
|
|
2015
|
+
const f = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2016
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
|
|
2017
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2018
|
+
Ss[t],
|
|
2019
|
+
i
|
|
2040
2020
|
] });
|
|
2021
|
+
return /* @__PURE__ */ e.jsx(
|
|
2022
|
+
"div",
|
|
2023
|
+
{
|
|
2024
|
+
className: ["ds-tool-card", m].filter(Boolean).join(" "),
|
|
2025
|
+
...d,
|
|
2026
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2027
|
+
Ee,
|
|
2028
|
+
{
|
|
2029
|
+
title: f,
|
|
2030
|
+
padding: "s",
|
|
2031
|
+
defaultExpanded: a,
|
|
2032
|
+
expanded: n,
|
|
2033
|
+
onToggle: o,
|
|
2034
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2035
|
+
}
|
|
2036
|
+
)
|
|
2037
|
+
}
|
|
2038
|
+
);
|
|
2041
2039
|
}
|
|
2042
|
-
function
|
|
2040
|
+
function As({
|
|
2043
2041
|
text: s,
|
|
2044
2042
|
size: t = "xs",
|
|
2045
2043
|
timeout: r = 2e3,
|
|
2046
2044
|
"aria-label": i = "Copy to clipboard",
|
|
2047
2045
|
...a
|
|
2048
2046
|
}) {
|
|
2049
|
-
const [n, o] =
|
|
2047
|
+
const [n, o] = A(!1), l = () => {
|
|
2050
2048
|
navigator.clipboard.writeText(s).then(() => {
|
|
2051
2049
|
o(!0), setTimeout(() => o(!1), r);
|
|
2052
2050
|
});
|
|
2053
2051
|
};
|
|
2054
2052
|
return /* @__PURE__ */ e.jsx(
|
|
2055
|
-
|
|
2053
|
+
me,
|
|
2056
2054
|
{
|
|
2057
2055
|
variant: "ghost",
|
|
2058
2056
|
size: t,
|
|
2059
|
-
icon: n ? /* @__PURE__ */ e.jsx(he, { size:
|
|
2057
|
+
icon: n ? /* @__PURE__ */ e.jsx(he, { size: D[1], strokeWidth: 1.5 }) : /* @__PURE__ */ e.jsx(Je, { size: D[1], strokeWidth: 1.5 }),
|
|
2060
2058
|
"aria-label": i,
|
|
2061
2059
|
onClick: l,
|
|
2062
2060
|
...a
|
|
2063
2061
|
}
|
|
2064
2062
|
);
|
|
2065
2063
|
}
|
|
2066
|
-
function
|
|
2067
|
-
const [i, a] =
|
|
2068
|
-
return
|
|
2064
|
+
function It({ content: s, streaming: t = !1, ...r }) {
|
|
2065
|
+
const [i, a] = A(t);
|
|
2066
|
+
return M(() => {
|
|
2069
2067
|
a(!!t);
|
|
2070
2068
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
2071
|
-
|
|
2069
|
+
Ee,
|
|
2072
2070
|
{
|
|
2073
2071
|
expanded: i,
|
|
2074
2072
|
onToggle: a,
|
|
2075
2073
|
padding: "s",
|
|
2076
2074
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2077
|
-
/* @__PURE__ */ e.jsx(Ze, { size:
|
|
2078
|
-
/* @__PURE__ */ e.jsx(
|
|
2075
|
+
/* @__PURE__ */ e.jsx(Ze, { size: D[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2076
|
+
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2079
2077
|
] }),
|
|
2080
2078
|
...r,
|
|
2081
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2079
|
+
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2082
2080
|
s,
|
|
2083
2081
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
2084
2082
|
] })
|
|
2085
2083
|
}
|
|
2086
2084
|
);
|
|
2087
2085
|
}
|
|
2088
|
-
function
|
|
2086
|
+
function Bt({
|
|
2089
2087
|
count: s,
|
|
2090
2088
|
current: t = 0,
|
|
2091
2089
|
done: r = [],
|
|
@@ -2096,8 +2094,8 @@ function Tt({
|
|
|
2096
2094
|
...l
|
|
2097
2095
|
}) {
|
|
2098
2096
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
|
|
2099
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m,
|
|
2100
|
-
const f =
|
|
2097
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, d) => {
|
|
2098
|
+
const f = d === t, p = r.includes(d) && !f, h = i && (d <= t || r.includes(d)), u = [
|
|
2101
2099
|
"ds-step-indicator__dot",
|
|
2102
2100
|
f && "ds-step-indicator__dot--active",
|
|
2103
2101
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2106,25 +2104,25 @@ function Tt({
|
|
|
2106
2104
|
"button",
|
|
2107
2105
|
{
|
|
2108
2106
|
type: "button",
|
|
2109
|
-
className:
|
|
2107
|
+
className: u,
|
|
2110
2108
|
role: "tab",
|
|
2111
2109
|
"aria-selected": f,
|
|
2112
|
-
"aria-label": `Step ${
|
|
2113
|
-
disabled: !h ||
|
|
2114
|
-
onClick: () => i == null ? void 0 : i(
|
|
2110
|
+
"aria-label": `Step ${d + 1}`,
|
|
2111
|
+
disabled: !h || d === t,
|
|
2112
|
+
onClick: () => i == null ? void 0 : i(d),
|
|
2115
2113
|
children: p ? /* @__PURE__ */ e.jsx(he, { size: 8, strokeWidth: 3 }) : null
|
|
2116
2114
|
},
|
|
2117
|
-
|
|
2115
|
+
d
|
|
2118
2116
|
);
|
|
2119
2117
|
}) }),
|
|
2120
|
-
a && /* @__PURE__ */ e.jsxs(
|
|
2118
|
+
a && /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, className: "ds-step-indicator__counter", children: [
|
|
2121
2119
|
t + 1,
|
|
2122
2120
|
" / ",
|
|
2123
2121
|
s
|
|
2124
2122
|
] })
|
|
2125
2123
|
] });
|
|
2126
2124
|
}
|
|
2127
|
-
function
|
|
2125
|
+
function Mt({
|
|
2128
2126
|
content: s,
|
|
2129
2127
|
isStreaming: t = !1,
|
|
2130
2128
|
cursor: r = "line",
|
|
@@ -2132,15 +2130,15 @@ function Rt({
|
|
|
2132
2130
|
className: a = "",
|
|
2133
2131
|
...n
|
|
2134
2132
|
}) {
|
|
2135
|
-
const o =
|
|
2136
|
-
return
|
|
2133
|
+
const o = E(s);
|
|
2134
|
+
return M(() => {
|
|
2137
2135
|
s !== o.current && (i == null || i(s), o.current = s);
|
|
2138
2136
|
}, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...n, children: [
|
|
2139
2137
|
s,
|
|
2140
2138
|
t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
|
|
2141
2139
|
] });
|
|
2142
2140
|
}
|
|
2143
|
-
function
|
|
2141
|
+
function Pt({
|
|
2144
2142
|
role: s = "assistant",
|
|
2145
2143
|
header: t,
|
|
2146
2144
|
footer: r,
|
|
@@ -2167,9 +2165,9 @@ function St({
|
|
|
2167
2165
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2168
2166
|
] });
|
|
2169
2167
|
}
|
|
2170
|
-
function
|
|
2171
|
-
const i =
|
|
2172
|
-
|
|
2168
|
+
function Lt(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
2169
|
+
const i = E(!1), a = E(0);
|
|
2170
|
+
M(() => {
|
|
2173
2171
|
const n = t == null ? void 0 : t.current;
|
|
2174
2172
|
if (!n) return;
|
|
2175
2173
|
const o = () => {
|
|
@@ -2177,12 +2175,12 @@ function At(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
|
2177
2175
|
!l && n.scrollTop < a.current && (i.current = !0), l && (i.current = !1), a.current = n.scrollTop;
|
|
2178
2176
|
};
|
|
2179
2177
|
return n.addEventListener("scroll", o, { passive: !0 }), () => n.removeEventListener("scroll", o);
|
|
2180
|
-
}, [t]),
|
|
2178
|
+
}, [t]), M(() => {
|
|
2181
2179
|
const n = t == null ? void 0 : t.current;
|
|
2182
2180
|
n && (r && i.current || (n.scrollTop = n.scrollHeight));
|
|
2183
2181
|
}, s);
|
|
2184
2182
|
}
|
|
2185
|
-
function
|
|
2183
|
+
function Ds({
|
|
2186
2184
|
prompts: s,
|
|
2187
2185
|
enabled: t,
|
|
2188
2186
|
typingSpeed: r = 38,
|
|
@@ -2191,36 +2189,36 @@ function Ss({
|
|
|
2191
2189
|
betweenTime: n = 380,
|
|
2192
2190
|
manualPauseMs: o = 5e3
|
|
2193
2191
|
}) {
|
|
2194
|
-
const [l, m] =
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
}, [l]),
|
|
2198
|
-
if (
|
|
2192
|
+
const [l, m] = A(0), [d, f] = A(""), p = E("typing"), h = E(0), u = E(0), b = E(null), j = E(0);
|
|
2193
|
+
M(() => {
|
|
2194
|
+
u.current = l;
|
|
2195
|
+
}, [l]), M(() => {
|
|
2196
|
+
if (b.current && (clearTimeout(b.current), b.current = null), !t || s.length === 0) {
|
|
2199
2197
|
f(""), h.current = 0, p.current = "typing";
|
|
2200
2198
|
return;
|
|
2201
2199
|
}
|
|
2202
|
-
const
|
|
2200
|
+
const $ = () => {
|
|
2203
2201
|
const O = Date.now();
|
|
2204
|
-
if (
|
|
2205
|
-
|
|
2202
|
+
if (j.current > O) {
|
|
2203
|
+
b.current = setTimeout($, j.current - O);
|
|
2206
2204
|
return;
|
|
2207
2205
|
}
|
|
2208
|
-
const
|
|
2209
|
-
p.current === "typing" ? (h.current += 1, f(
|
|
2206
|
+
const I = s[u.current % s.length] ?? "";
|
|
2207
|
+
p.current === "typing" ? (h.current += 1, f(I.slice(0, h.current)), h.current >= I.length ? (p.current = "holding", b.current = setTimeout($, a)) : b.current = setTimeout($, r + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", b.current = setTimeout($, i)) : (h.current = Math.max(0, h.current - 1), f(I.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % s.length, m(u.current), b.current = setTimeout($, n)) : b.current = setTimeout($, i));
|
|
2210
2208
|
};
|
|
2211
|
-
return
|
|
2212
|
-
|
|
2209
|
+
return b.current = setTimeout($, 260), () => {
|
|
2210
|
+
b.current && clearTimeout(b.current);
|
|
2213
2211
|
};
|
|
2214
2212
|
}, [t, s, r, i, a, n]);
|
|
2215
|
-
const
|
|
2213
|
+
const S = ($) => {
|
|
2216
2214
|
if (s.length === 0) return;
|
|
2217
|
-
const O = (
|
|
2218
|
-
|
|
2219
|
-
},
|
|
2220
|
-
return { displayed:
|
|
2215
|
+
const O = ($ % s.length + s.length) % s.length, I = s[O];
|
|
2216
|
+
u.current = O, h.current = I.length, p.current = "holding", j.current = Date.now() + o, m(O), f(I);
|
|
2217
|
+
}, R = () => S(u.current + 1), B = () => S(u.current - 1), y = s[l % s.length] ?? "";
|
|
2218
|
+
return { displayed: d, currentPrompt: y, index: l, next: R, prev: B };
|
|
2221
2219
|
}
|
|
2222
|
-
let
|
|
2223
|
-
function
|
|
2220
|
+
let Is = 0;
|
|
2221
|
+
function zt({
|
|
2224
2222
|
value: s = "",
|
|
2225
2223
|
onChange: t,
|
|
2226
2224
|
onSubmit: r,
|
|
@@ -2230,121 +2228,121 @@ function It({
|
|
|
2230
2228
|
disabled: o = !1,
|
|
2231
2229
|
placeholder: l = "Let's get things done...",
|
|
2232
2230
|
animatedPlaceholders: m,
|
|
2233
|
-
attachments:
|
|
2231
|
+
attachments: d,
|
|
2234
2232
|
images: f,
|
|
2235
2233
|
onAttachFiles: p,
|
|
2236
2234
|
onAttachImages: h,
|
|
2237
|
-
onRemoveAttachment:
|
|
2238
|
-
onRemoveImage:
|
|
2239
|
-
acceptImage:
|
|
2240
|
-
acceptFile:
|
|
2241
|
-
maxImages:
|
|
2242
|
-
maxImageSize:
|
|
2243
|
-
leftSlot:
|
|
2244
|
-
rightSlot:
|
|
2235
|
+
onRemoveAttachment: u,
|
|
2236
|
+
onRemoveImage: b,
|
|
2237
|
+
acceptImage: j,
|
|
2238
|
+
acceptFile: S,
|
|
2239
|
+
maxImages: R,
|
|
2240
|
+
maxImageSize: B,
|
|
2241
|
+
leftSlot: y,
|
|
2242
|
+
rightSlot: $,
|
|
2245
2243
|
className: O = "",
|
|
2246
|
-
...
|
|
2244
|
+
...I
|
|
2247
2245
|
}) {
|
|
2248
|
-
const
|
|
2249
|
-
const T = ++
|
|
2250
|
-
U((V) => [...V, { id: T, msg:
|
|
2251
|
-
},
|
|
2252
|
-
const T = [], V = [],
|
|
2253
|
-
let ee = 0,
|
|
2254
|
-
for (const se of
|
|
2255
|
-
|
|
2256
|
-
return { imageFiles: T, docFiles: V, tooLarge:
|
|
2257
|
-
}, c = (
|
|
2258
|
-
const { imageFiles: T, docFiles: V, tooLarge:
|
|
2259
|
-
|
|
2260
|
-
const
|
|
2261
|
-
p &&
|
|
2246
|
+
const Y = E(null), q = E(null), P = E(0), [N, C] = A(!1), [G, U] = A([]), x = (_) => {
|
|
2247
|
+
const T = ++Is;
|
|
2248
|
+
U((V) => [...V, { id: T, msg: _ }]), setTimeout(() => U((V) => V.filter((J) => J.id !== T)), 6e3);
|
|
2249
|
+
}, v = (_) => U((T) => T.filter((V) => V.id !== _)), k = (_) => _.type.startsWith("image/"), L = () => !0, H = j ?? k, X = S ?? L, g = (_) => {
|
|
2250
|
+
const T = [], V = [], J = [], Z = [];
|
|
2251
|
+
let ee = 0, le = R != null ? R - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
|
|
2252
|
+
for (const se of _)
|
|
2253
|
+
H(se) ? B && se.size > B ? J.push(se.name) : le > 0 ? (T.push(se), le--) : ee++ : X(se) ? V.push(se) : Z.push(se.name);
|
|
2254
|
+
return { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2255
|
+
}, c = (_) => {
|
|
2256
|
+
const { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(_);
|
|
2257
|
+
J.length && x(`File${J.length > 1 ? "s" : ""} too large${B ? ` (max ${B / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${R} images per message`), h && T.length && h(T);
|
|
2258
|
+
const le = V.concat(h ? [] : T);
|
|
2259
|
+
p && le.length && p(le);
|
|
2262
2260
|
};
|
|
2263
|
-
|
|
2264
|
-
const
|
|
2265
|
-
|
|
2266
|
-
}, [s]),
|
|
2267
|
-
const
|
|
2268
|
-
var
|
|
2261
|
+
M(() => {
|
|
2262
|
+
const _ = q.current;
|
|
2263
|
+
_ && (_.style.height = "auto", _.style.height = `${Math.min(_.scrollHeight, 200)}px`);
|
|
2264
|
+
}, [s]), M(() => {
|
|
2265
|
+
const _ = (T) => {
|
|
2266
|
+
var J, Z, ee;
|
|
2269
2267
|
if (n || o) return;
|
|
2270
|
-
const V = (
|
|
2271
|
-
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (
|
|
2268
|
+
const V = (J = T.target) == null ? void 0 : J.tagName;
|
|
2269
|
+
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (Z = T.target) != null && Z.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (ee = q.current) == null || ee.focus();
|
|
2272
2270
|
};
|
|
2273
|
-
return document.addEventListener("keydown",
|
|
2271
|
+
return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
|
|
2274
2272
|
}, [n, o]);
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
},
|
|
2278
|
-
|
|
2279
|
-
}, F = (
|
|
2280
|
-
|
|
2281
|
-
const T = Array.from(
|
|
2273
|
+
const w = (_) => {
|
|
2274
|
+
_.preventDefault(), P.current++, _.dataTransfer.types.includes("Files") && C(!0);
|
|
2275
|
+
}, z = (_) => {
|
|
2276
|
+
_.preventDefault(), P.current--, P.current === 0 && C(!1);
|
|
2277
|
+
}, F = (_) => _.preventDefault(), te = (_) => {
|
|
2278
|
+
_.preventDefault(), P.current = 0, C(!1);
|
|
2279
|
+
const T = Array.from(_.dataTransfer.files);
|
|
2282
2280
|
T.length && c(T);
|
|
2283
|
-
},
|
|
2284
|
-
const T = Array.from(
|
|
2285
|
-
|
|
2286
|
-
}, W = (
|
|
2281
|
+
}, ie = (_) => {
|
|
2282
|
+
const T = Array.from(_.target.files || []);
|
|
2283
|
+
Y.current && (Y.current.value = ""), T.length && c(T);
|
|
2284
|
+
}, W = (_) => {
|
|
2287
2285
|
var se;
|
|
2288
2286
|
if (!h) return;
|
|
2289
|
-
const T = (se =
|
|
2287
|
+
const T = (se = _.clipboardData) == null ? void 0 : se.items;
|
|
2290
2288
|
if (!T) return;
|
|
2291
2289
|
const V = [];
|
|
2292
2290
|
for (const Ue of T) {
|
|
2293
|
-
const
|
|
2294
|
-
|
|
2291
|
+
const Te = Ue.getAsFile();
|
|
2292
|
+
Te && V.push(Te);
|
|
2295
2293
|
}
|
|
2296
2294
|
if (V.length === 0) return;
|
|
2297
|
-
const { imageFiles:
|
|
2298
|
-
|
|
2299
|
-
}, Q = !n && !o && !!(m != null && m.length) && s.length === 0,
|
|
2295
|
+
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: le } = g(V);
|
|
2296
|
+
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), le && x(`Max ${R} images per message`), J.length && (_.preventDefault(), h(J));
|
|
2297
|
+
}, Q = !n && !o && !!(m != null && m.length) && s.length === 0, oe = Ds({
|
|
2300
2298
|
prompts: m ?? [],
|
|
2301
2299
|
enabled: Q
|
|
2302
|
-
}),
|
|
2300
|
+
}), be = (_) => {
|
|
2303
2301
|
if (Q) {
|
|
2304
|
-
if (
|
|
2305
|
-
|
|
2302
|
+
if (_.key === "ArrowDown" || _.key === "ArrowRight") {
|
|
2303
|
+
_.preventDefault(), oe.next();
|
|
2306
2304
|
return;
|
|
2307
2305
|
}
|
|
2308
|
-
if (
|
|
2309
|
-
|
|
2306
|
+
if (_.key === "ArrowUp" || _.key === "ArrowLeft") {
|
|
2307
|
+
_.preventDefault(), oe.prev();
|
|
2310
2308
|
return;
|
|
2311
2309
|
}
|
|
2312
|
-
if (
|
|
2313
|
-
|
|
2310
|
+
if (_.key === "Tab" && !_.shiftKey) {
|
|
2311
|
+
_.preventDefault(), t == null || t(oe.currentPrompt);
|
|
2314
2312
|
return;
|
|
2315
2313
|
}
|
|
2316
2314
|
}
|
|
2317
|
-
a == null || a(
|
|
2318
|
-
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (
|
|
2319
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...
|
|
2320
|
-
|
|
2315
|
+
a == null || a(_);
|
|
2316
|
+
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (d == null ? void 0 : d.length) > 0) && !o, $e = p || h;
|
|
2317
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...I, children: [
|
|
2318
|
+
$e && /* @__PURE__ */ e.jsx(
|
|
2321
2319
|
"input",
|
|
2322
2320
|
{
|
|
2323
|
-
ref:
|
|
2321
|
+
ref: Y,
|
|
2324
2322
|
type: "file",
|
|
2325
2323
|
multiple: !0,
|
|
2326
2324
|
accept: "*/*",
|
|
2327
2325
|
className: "ds-prompt-input__file-input",
|
|
2328
|
-
onChange:
|
|
2326
|
+
onChange: ie
|
|
2329
2327
|
}
|
|
2330
2328
|
),
|
|
2331
2329
|
/* @__PURE__ */ e.jsxs(
|
|
2332
2330
|
"div",
|
|
2333
2331
|
{
|
|
2334
|
-
className: ["ds-prompt-input__box",
|
|
2335
|
-
onDragEnter:
|
|
2336
|
-
onDragLeave:
|
|
2332
|
+
className: ["ds-prompt-input__box", N && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2333
|
+
onDragEnter: w,
|
|
2334
|
+
onDragLeave: z,
|
|
2337
2335
|
onDragOver: F,
|
|
2338
2336
|
onDrop: te,
|
|
2339
2337
|
children: [
|
|
2340
|
-
|
|
2338
|
+
N && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2341
2339
|
/* @__PURE__ */ e.jsx(
|
|
2342
2340
|
"textarea",
|
|
2343
2341
|
{
|
|
2344
|
-
ref:
|
|
2342
|
+
ref: q,
|
|
2345
2343
|
value: s,
|
|
2346
|
-
onChange: (
|
|
2347
|
-
onKeyDown:
|
|
2344
|
+
onChange: (_) => t == null ? void 0 : t(_.target.value),
|
|
2345
|
+
onKeyDown: be,
|
|
2348
2346
|
onPaste: W,
|
|
2349
2347
|
placeholder: Q ? "" : l,
|
|
2350
2348
|
disabled: n || o,
|
|
@@ -2353,80 +2351,80 @@ function It({
|
|
|
2353
2351
|
}
|
|
2354
2352
|
),
|
|
2355
2353
|
Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
|
|
2356
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children:
|
|
2354
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: oe.displayed }),
|
|
2357
2355
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2358
2356
|
] }),
|
|
2359
|
-
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((
|
|
2360
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2357
|
+
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((_, T) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2358
|
+
/* @__PURE__ */ e.jsx("img", { src: _.preview, alt: "" }),
|
|
2361
2359
|
/* @__PURE__ */ e.jsx(
|
|
2362
2360
|
"button",
|
|
2363
2361
|
{
|
|
2364
2362
|
className: "ds-prompt-input__image-remove",
|
|
2365
|
-
onClick: () =>
|
|
2363
|
+
onClick: () => b == null ? void 0 : b(T),
|
|
2366
2364
|
"aria-label": "Remove image",
|
|
2367
2365
|
type: "button",
|
|
2368
2366
|
children: /* @__PURE__ */ e.jsx(ne, { size: 12, strokeWidth: 2 })
|
|
2369
2367
|
}
|
|
2370
2368
|
)
|
|
2371
2369
|
] }, T)) }),
|
|
2372
|
-
|
|
2373
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2370
|
+
G.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: G.map((_) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2371
|
+
/* @__PURE__ */ e.jsx("span", { children: _.msg }),
|
|
2374
2372
|
/* @__PURE__ */ e.jsx(
|
|
2375
2373
|
"button",
|
|
2376
2374
|
{
|
|
2377
2375
|
type: "button",
|
|
2378
2376
|
className: "ds-prompt-input__warning-close",
|
|
2379
|
-
onClick: () =>
|
|
2377
|
+
onClick: () => v(_.id),
|
|
2380
2378
|
"aria-label": "Dismiss",
|
|
2381
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
2379
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[1], strokeWidth: 1.5 })
|
|
2382
2380
|
}
|
|
2383
2381
|
)
|
|
2384
|
-
] },
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2382
|
+
] }, _.id)) }),
|
|
2383
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((_, T) => /* @__PURE__ */ e.jsx(ae, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2384
|
+
_.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: D[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: D[1], strokeWidth: 1.5 }),
|
|
2385
|
+
_.filename,
|
|
2386
|
+
_.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2389
2387
|
"button",
|
|
2390
2388
|
{
|
|
2391
2389
|
type: "button",
|
|
2392
2390
|
className: "ds-prompt-input__remove-btn",
|
|
2393
|
-
onClick: () =>
|
|
2394
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
2391
|
+
onClick: () => u == null ? void 0 : u(T),
|
|
2392
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[1], strokeWidth: 1.5 })
|
|
2395
2393
|
}
|
|
2396
2394
|
)
|
|
2397
2395
|
] }) }, T)) }),
|
|
2398
2396
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2399
|
-
|
|
2400
|
-
|
|
2397
|
+
$e && /* @__PURE__ */ e.jsx(
|
|
2398
|
+
me,
|
|
2401
2399
|
{
|
|
2402
2400
|
variant: "ghost",
|
|
2403
2401
|
size: "xs",
|
|
2404
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2402
|
+
icon: /* @__PURE__ */ e.jsx(Re, { size: D[2], strokeWidth: 1.5 }),
|
|
2405
2403
|
"aria-label": "Attach files",
|
|
2406
2404
|
onClick: () => {
|
|
2407
|
-
var
|
|
2408
|
-
return (
|
|
2405
|
+
var _;
|
|
2406
|
+
return (_ = Y.current) == null ? void 0 : _.click();
|
|
2409
2407
|
}
|
|
2410
2408
|
}
|
|
2411
2409
|
),
|
|
2412
|
-
|
|
2413
|
-
|
|
2410
|
+
y,
|
|
2411
|
+
$,
|
|
2414
2412
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2415
2413
|
n ? /* @__PURE__ */ e.jsx(
|
|
2416
|
-
|
|
2414
|
+
me,
|
|
2417
2415
|
{
|
|
2418
2416
|
variant: "primary",
|
|
2419
2417
|
size: "xs",
|
|
2420
|
-
icon: /* @__PURE__ */ e.jsx(es, { size:
|
|
2418
|
+
icon: /* @__PURE__ */ e.jsx(es, { size: D[2], strokeWidth: 1.5 }),
|
|
2421
2419
|
onClick: i,
|
|
2422
2420
|
"aria-label": "Stop"
|
|
2423
2421
|
}
|
|
2424
2422
|
) : /* @__PURE__ */ e.jsx(
|
|
2425
|
-
|
|
2423
|
+
me,
|
|
2426
2424
|
{
|
|
2427
2425
|
variant: "primary",
|
|
2428
2426
|
size: "xs",
|
|
2429
|
-
icon: /* @__PURE__ */ e.jsx(ss, { size:
|
|
2427
|
+
icon: /* @__PURE__ */ e.jsx(ss, { size: D[2], strokeWidth: 1.5 }),
|
|
2430
2428
|
onClick: r,
|
|
2431
2429
|
disabled: !Ce,
|
|
2432
2430
|
"aria-label": "Send"
|
|
@@ -2438,8 +2436,8 @@ function It({
|
|
|
2438
2436
|
)
|
|
2439
2437
|
] });
|
|
2440
2438
|
}
|
|
2441
|
-
const Pe = { fast: 0, standard: 1, premium: 2 };
|
|
2442
|
-
function
|
|
2439
|
+
const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
2440
|
+
function Ot({
|
|
2443
2441
|
models: s = [],
|
|
2444
2442
|
value: t,
|
|
2445
2443
|
onChange: r,
|
|
@@ -2450,52 +2448,57 @@ function Dt({
|
|
|
2450
2448
|
className: l = "",
|
|
2451
2449
|
...m
|
|
2452
2450
|
}) {
|
|
2453
|
-
const [
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
}, z = (H) => {
|
|
2468
|
-
H.key === "Escape" && f(!1);
|
|
2451
|
+
const [d, f] = A(!1), p = E(null), h = E(null), u = E(null), [b, j] = A({}), S = s.filter((N) => !a || N.name === "auto" ? !0 : (Pe[N.tier] ?? 1) >= (Pe[a] ?? 1)), R = S.find((N) => N.name === "auto"), B = S.filter((N) => N.name !== "auto"), y = s.find((N) => N.name === t), O = new Set(B.map((N) => N.tier).filter(Boolean)).size > 1;
|
|
2452
|
+
M(() => {
|
|
2453
|
+
if (!d) return;
|
|
2454
|
+
const N = 320, C = () => {
|
|
2455
|
+
var L;
|
|
2456
|
+
const x = (L = h.current) == null ? void 0 : L.getBoundingClientRect();
|
|
2457
|
+
if (!x) return;
|
|
2458
|
+
const v = window.innerHeight - x.bottom, k = v < N + 8 && x.top > v;
|
|
2459
|
+
j({
|
|
2460
|
+
position: "fixed",
|
|
2461
|
+
zIndex: "var(--z-dropdown, 500)",
|
|
2462
|
+
right: window.innerWidth - x.right,
|
|
2463
|
+
...k ? { bottom: window.innerHeight - x.top + 4, top: "auto" } : { top: x.bottom + 4, bottom: "auto" }
|
|
2464
|
+
});
|
|
2469
2465
|
};
|
|
2470
|
-
|
|
2471
|
-
|
|
2466
|
+
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
2467
|
+
const G = (x) => {
|
|
2468
|
+
var v, k;
|
|
2469
|
+
!((v = p.current) != null && v.contains(x.target)) && !((k = u.current) != null && k.contains(x.target)) && f(!1);
|
|
2470
|
+
}, U = (x) => {
|
|
2471
|
+
x.key === "Escape" && f(!1);
|
|
2472
2472
|
};
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
},
|
|
2473
|
+
return document.addEventListener("mousedown", G), document.addEventListener("keydown", U), () => {
|
|
2474
|
+
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", G), document.removeEventListener("keydown", U);
|
|
2475
|
+
};
|
|
2476
|
+
}, [d]);
|
|
2477
|
+
const I = (N) => {
|
|
2478
|
+
r == null || r(N), f(!1);
|
|
2479
|
+
}, Y = (N) => /* @__PURE__ */ e.jsxs(
|
|
2477
2480
|
"button",
|
|
2478
2481
|
{
|
|
2479
2482
|
type: "button",
|
|
2480
2483
|
className: [
|
|
2481
2484
|
"ds-model-picker__item",
|
|
2482
|
-
|
|
2485
|
+
N.name === t && "ds-model-picker__item--active"
|
|
2483
2486
|
].filter(Boolean).join(" "),
|
|
2484
|
-
onClick: () =>
|
|
2487
|
+
onClick: () => I(N.name),
|
|
2485
2488
|
children: [
|
|
2486
|
-
|
|
2487
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
2488
|
-
|
|
2489
|
+
N.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: N.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2490
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: N.displayName || N.name }),
|
|
2491
|
+
O && N.tier && /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: Le[N.tier] || "default", children: N.tier })
|
|
2489
2492
|
]
|
|
2490
2493
|
},
|
|
2491
|
-
|
|
2492
|
-
),
|
|
2493
|
-
const
|
|
2494
|
-
return
|
|
2495
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
2496
|
-
...
|
|
2494
|
+
N.name
|
|
2495
|
+
), q = () => !o || !O ? B.map(Y) : ["fast", "standard", "premium"].flatMap((N) => {
|
|
2496
|
+
const C = B.filter((G) => G.tier === N);
|
|
2497
|
+
return C.length ? [
|
|
2498
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": N, children: N.charAt(0).toUpperCase() + N.slice(1) }, `lbl-${N}`),
|
|
2499
|
+
...C.map(Y)
|
|
2497
2500
|
] : [];
|
|
2498
|
-
})
|
|
2501
|
+
}), P = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu", style: b, children: [
|
|
2499
2502
|
n && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2500
2503
|
/* @__PURE__ */ e.jsxs(
|
|
2501
2504
|
"button",
|
|
@@ -2506,16 +2509,16 @@ function Dt({
|
|
|
2506
2509
|
"ds-model-picker__item--auto",
|
|
2507
2510
|
t === "auto" && "ds-model-picker__item--active"
|
|
2508
2511
|
].filter(Boolean).join(" "),
|
|
2509
|
-
onClick: () =>
|
|
2512
|
+
onClick: () => I("auto"),
|
|
2510
2513
|
children: [
|
|
2511
2514
|
/* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2512
2515
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
2513
2516
|
]
|
|
2514
2517
|
}
|
|
2515
2518
|
),
|
|
2516
|
-
|
|
2519
|
+
B.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
2517
2520
|
] }),
|
|
2518
|
-
|
|
2521
|
+
q()
|
|
2519
2522
|
] });
|
|
2520
2523
|
return /* @__PURE__ */ e.jsxs(
|
|
2521
2524
|
"div",
|
|
@@ -2527,52 +2530,57 @@ function Dt({
|
|
|
2527
2530
|
/* @__PURE__ */ e.jsxs(
|
|
2528
2531
|
"button",
|
|
2529
2532
|
{
|
|
2533
|
+
ref: h,
|
|
2530
2534
|
type: "button",
|
|
2531
2535
|
className: "ds-model-picker__trigger",
|
|
2532
|
-
onClick: () => f((
|
|
2536
|
+
onClick: () => f((N) => !N),
|
|
2533
2537
|
"aria-haspopup": "listbox",
|
|
2534
|
-
"aria-expanded":
|
|
2538
|
+
"aria-expanded": d,
|
|
2535
2539
|
children: [
|
|
2536
|
-
|
|
2537
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (
|
|
2538
|
-
(
|
|
2540
|
+
y != null && y.icon ? /* @__PURE__ */ e.jsx("span", { children: y.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5 }),
|
|
2541
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (y == null ? void 0 : y.displayName) || (y == null ? void 0 : y.name) || t }),
|
|
2542
|
+
O && (y == null ? void 0 : y.tier) && /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: Le[y.tier] || "default", children: y.tier })
|
|
2539
2543
|
]
|
|
2540
2544
|
}
|
|
2541
2545
|
),
|
|
2542
|
-
typeof document < "u" &&
|
|
2546
|
+
typeof document < "u" && pe.createPortal(P, document.body)
|
|
2543
2547
|
]
|
|
2544
2548
|
}
|
|
2545
2549
|
);
|
|
2546
2550
|
}
|
|
2547
|
-
|
|
2551
|
+
const Bs = ({ filename: s, pages: t }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
2552
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: s }),
|
|
2553
|
+
t.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(t) })
|
|
2554
|
+
] });
|
|
2555
|
+
function Ne(s) {
|
|
2548
2556
|
return s != null && s.length ? "p. " + s.join(", ") : null;
|
|
2549
2557
|
}
|
|
2550
|
-
function
|
|
2558
|
+
function Ms(s) {
|
|
2551
2559
|
const t = /* @__PURE__ */ new Map();
|
|
2552
2560
|
for (const r of s)
|
|
2553
2561
|
t.has(r.filename) || t.set(r.filename, { filename: r.filename, url: r.url, items: [] }), t.get(r.filename).items.push(r);
|
|
2554
2562
|
return [...t.values()];
|
|
2555
2563
|
}
|
|
2556
|
-
function
|
|
2564
|
+
function Ft({
|
|
2557
2565
|
sources: s = [],
|
|
2558
2566
|
layout: t = "list",
|
|
2559
2567
|
title: r = "Sources",
|
|
2560
2568
|
maxVisible: i = 5,
|
|
2561
2569
|
onSourceClick: a
|
|
2562
2570
|
}) {
|
|
2563
|
-
const [n, o] =
|
|
2571
|
+
const [n, o] = A(!1), l = Ms(s), m = l.length > i, d = n ? l : l.slice(0, i), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2564
2572
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2565
|
-
|
|
2566
|
-
const
|
|
2573
|
+
d.map((h) => {
|
|
2574
|
+
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2567
2575
|
return /* @__PURE__ */ e.jsxs(
|
|
2568
2576
|
"div",
|
|
2569
2577
|
{
|
|
2570
|
-
className: `ds-sources-panel__compact-row${
|
|
2571
|
-
onClick:
|
|
2578
|
+
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2579
|
+
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2572
2580
|
children: [
|
|
2573
|
-
/* @__PURE__ */ e.jsx(rs, { size:
|
|
2581
|
+
/* @__PURE__ */ e.jsx(rs, { size: D[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2574
2582
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2575
|
-
|
|
2583
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2576
2584
|
]
|
|
2577
2585
|
},
|
|
2578
2586
|
h.filename
|
|
@@ -2585,35 +2593,32 @@ function Bt({
|
|
|
2585
2593
|
] })
|
|
2586
2594
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2587
2595
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
|
|
2588
|
-
|
|
2589
|
-
const
|
|
2596
|
+
d.map((h) => {
|
|
2597
|
+
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2590
2598
|
return f ? /* @__PURE__ */ e.jsx(
|
|
2591
|
-
|
|
2599
|
+
Ee,
|
|
2592
2600
|
{
|
|
2593
|
-
title: /* @__PURE__ */ e.
|
|
2594
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2595
|
-
d.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: je(d) })
|
|
2596
|
-
] }),
|
|
2601
|
+
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: u }),
|
|
2597
2602
|
padding: "s",
|
|
2598
|
-
children: h.items.map((
|
|
2603
|
+
children: h.items.map((j, S) => /* @__PURE__ */ e.jsx(
|
|
2599
2604
|
"div",
|
|
2600
2605
|
{
|
|
2601
|
-
className: `ds-sources-panel__snippet${
|
|
2602
|
-
onClick:
|
|
2603
|
-
children:
|
|
2606
|
+
className: `ds-sources-panel__snippet${b ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2607
|
+
onClick: b ? () => a(j) : void 0,
|
|
2608
|
+
children: j.snippet ?? `p. ${j.page}`
|
|
2604
2609
|
},
|
|
2605
|
-
|
|
2610
|
+
S
|
|
2606
2611
|
))
|
|
2607
2612
|
},
|
|
2608
2613
|
h.filename
|
|
2609
2614
|
) : /* @__PURE__ */ e.jsxs(
|
|
2610
2615
|
"div",
|
|
2611
2616
|
{
|
|
2612
|
-
className: `ds-sources-panel__row${
|
|
2613
|
-
onClick:
|
|
2617
|
+
className: `ds-sources-panel__row${b ? " ds-sources-panel__row--clickable" : ""}`,
|
|
2618
|
+
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2614
2619
|
children: [
|
|
2615
2620
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2616
|
-
|
|
2621
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2617
2622
|
]
|
|
2618
2623
|
},
|
|
2619
2624
|
h.filename
|
|
@@ -2626,10 +2631,10 @@ function Bt({
|
|
|
2626
2631
|
] })
|
|
2627
2632
|
] });
|
|
2628
2633
|
}
|
|
2629
|
-
function
|
|
2634
|
+
function ze(s) {
|
|
2630
2635
|
return s >= 1e6 ? (s / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : s >= 1e3 ? (s / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(s);
|
|
2631
2636
|
}
|
|
2632
|
-
function
|
|
2637
|
+
function Wt({
|
|
2633
2638
|
used: s,
|
|
2634
2639
|
limit: t,
|
|
2635
2640
|
size: r = "s",
|
|
@@ -2638,7 +2643,7 @@ function Pt({
|
|
|
2638
2643
|
warningThreshold: n = 0.8,
|
|
2639
2644
|
errorThreshold: o = 1
|
|
2640
2645
|
}) {
|
|
2641
|
-
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100),
|
|
2646
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >= n ? "warning" : "normal";
|
|
2642
2647
|
return /* @__PURE__ */ e.jsxs(
|
|
2643
2648
|
"div",
|
|
2644
2649
|
{
|
|
@@ -2650,15 +2655,15 @@ function Pt({
|
|
|
2650
2655
|
/* @__PURE__ */ e.jsx("div", { className: "ds-token-counter__track", children: /* @__PURE__ */ e.jsx(
|
|
2651
2656
|
"div",
|
|
2652
2657
|
{
|
|
2653
|
-
className: `ds-token-counter__fill ds-token-counter__fill--${
|
|
2658
|
+
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2654
2659
|
style: { width: `${m}%` }
|
|
2655
2660
|
}
|
|
2656
2661
|
) }),
|
|
2657
|
-
(i || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${
|
|
2662
|
+
(i || a) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${d}`, children: [
|
|
2658
2663
|
i && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2659
|
-
|
|
2664
|
+
ze(s),
|
|
2660
2665
|
" / ",
|
|
2661
|
-
|
|
2666
|
+
ze(t),
|
|
2662
2667
|
" tokens"
|
|
2663
2668
|
] }),
|
|
2664
2669
|
a && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
@@ -2670,24 +2675,24 @@ function Pt({
|
|
|
2670
2675
|
}
|
|
2671
2676
|
);
|
|
2672
2677
|
}
|
|
2673
|
-
const
|
|
2674
|
-
function
|
|
2678
|
+
const Oe = 5;
|
|
2679
|
+
function Ps(s) {
|
|
2675
2680
|
return s < 0.34 ? "low" : s < 0.67 ? "medium" : "high";
|
|
2676
2681
|
}
|
|
2677
|
-
function
|
|
2682
|
+
function Ct({
|
|
2678
2683
|
value: s = 0,
|
|
2679
2684
|
size: t = "xs",
|
|
2680
2685
|
showLabel: r = "none",
|
|
2681
2686
|
layout: i = "inline"
|
|
2682
2687
|
}) {
|
|
2683
|
-
const a = Math.max(0, Math.min(1, s)), n = Math.round(a *
|
|
2688
|
+
const a = Math.max(0, Math.min(1, s)), n = Math.round(a * Oe), o = Ps(a);
|
|
2684
2689
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2685
2690
|
"ds-confidence-bar",
|
|
2686
2691
|
`ds-confidence-bar--${t}`,
|
|
2687
2692
|
`ds-confidence-bar--${o}`,
|
|
2688
2693
|
i === "block" && "ds-confidence-bar--block"
|
|
2689
2694
|
].filter(Boolean).join(" "), children: [
|
|
2690
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length:
|
|
2695
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, m) => /* @__PURE__ */ e.jsx(
|
|
2691
2696
|
"div",
|
|
2692
2697
|
{
|
|
2693
2698
|
className: `ds-confidence-bar__seg${m < n ? " ds-confidence-bar__seg--filled" : ""}`
|
|
@@ -2697,15 +2702,15 @@ function Mt({
|
|
|
2697
2702
|
r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
|
|
2698
2703
|
] });
|
|
2699
2704
|
}
|
|
2700
|
-
const
|
|
2701
|
-
function
|
|
2705
|
+
const Ls = { add: "+", remove: "-", context: " " };
|
|
2706
|
+
function _e({ line: s, lineNumbers: t }) {
|
|
2702
2707
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
|
|
2703
2708
|
t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
|
|
2704
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children:
|
|
2709
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Ls[s.type] }),
|
|
2705
2710
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: s.text })
|
|
2706
2711
|
] });
|
|
2707
2712
|
}
|
|
2708
|
-
function
|
|
2713
|
+
function Ut({
|
|
2709
2714
|
lines: s = [],
|
|
2710
2715
|
layout: t = "inline",
|
|
2711
2716
|
wordWrap: r = !1,
|
|
@@ -2719,88 +2724,216 @@ function Lt({
|
|
|
2719
2724
|
r && "ds-diff-view--wrap"
|
|
2720
2725
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2721
2726
|
if (t === "split") {
|
|
2722
|
-
const m = s.filter((f) => f.type === "remove" || f.type === "context"),
|
|
2727
|
+
const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2723
2728
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2724
2729
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2725
2730
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2726
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(
|
|
2727
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children:
|
|
2731
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) }),
|
|
2732
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) })
|
|
2728
2733
|
] })
|
|
2729
2734
|
] });
|
|
2730
2735
|
}
|
|
2731
2736
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2732
2737
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2733
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m,
|
|
2738
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(_e, { line: m, lineNumbers: i }, d)) })
|
|
2734
2739
|
] });
|
|
2735
2740
|
}
|
|
2741
|
+
const zs = {
|
|
2742
|
+
running: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "info", children: "Running…" }),
|
|
2743
|
+
success: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "success", children: "Done" }),
|
|
2744
|
+
error: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "error", children: "Error" })
|
|
2745
|
+
};
|
|
2746
|
+
function Vt({
|
|
2747
|
+
label: s,
|
|
2748
|
+
status: t = "idle",
|
|
2749
|
+
icon: r,
|
|
2750
|
+
badge: i,
|
|
2751
|
+
className: a = "",
|
|
2752
|
+
...n
|
|
2753
|
+
}) {
|
|
2754
|
+
return /* @__PURE__ */ e.jsxs(
|
|
2755
|
+
"div",
|
|
2756
|
+
{
|
|
2757
|
+
className: ["ds-tool-bubble", a].filter(Boolean).join(" "),
|
|
2758
|
+
...n,
|
|
2759
|
+
children: [
|
|
2760
|
+
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-bubble__icon", children: r }),
|
|
2761
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-bubble__label", children: s }),
|
|
2762
|
+
zs[t],
|
|
2763
|
+
i
|
|
2764
|
+
]
|
|
2765
|
+
}
|
|
2766
|
+
);
|
|
2767
|
+
}
|
|
2768
|
+
function Os({
|
|
2769
|
+
value: s = "idle",
|
|
2770
|
+
onLike: t,
|
|
2771
|
+
onDislike: r,
|
|
2772
|
+
className: i = "",
|
|
2773
|
+
...a
|
|
2774
|
+
}) {
|
|
2775
|
+
const n = s !== "idle";
|
|
2776
|
+
return /* @__PURE__ */ e.jsxs(
|
|
2777
|
+
"div",
|
|
2778
|
+
{
|
|
2779
|
+
className: [
|
|
2780
|
+
"ds-message-feedback",
|
|
2781
|
+
n && "ds-message-feedback--voted",
|
|
2782
|
+
i
|
|
2783
|
+
].filter(Boolean).join(" "),
|
|
2784
|
+
...a,
|
|
2785
|
+
children: [
|
|
2786
|
+
(!n || s === "liked") && /* @__PURE__ */ e.jsx(
|
|
2787
|
+
"button",
|
|
2788
|
+
{
|
|
2789
|
+
className: [
|
|
2790
|
+
"ds-message-feedback__btn",
|
|
2791
|
+
s === "liked" && "ds-message-feedback__btn--liked"
|
|
2792
|
+
].filter(Boolean).join(" "),
|
|
2793
|
+
onClick: t,
|
|
2794
|
+
disabled: n,
|
|
2795
|
+
"aria-label": "Like",
|
|
2796
|
+
"aria-pressed": s === "liked",
|
|
2797
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2798
|
+
ns,
|
|
2799
|
+
{
|
|
2800
|
+
size: D[1],
|
|
2801
|
+
strokeWidth: 1.5,
|
|
2802
|
+
fill: s === "liked" ? "currentColor" : "none"
|
|
2803
|
+
}
|
|
2804
|
+
)
|
|
2805
|
+
}
|
|
2806
|
+
),
|
|
2807
|
+
(!n || s === "disliked") && /* @__PURE__ */ e.jsx(
|
|
2808
|
+
"button",
|
|
2809
|
+
{
|
|
2810
|
+
className: [
|
|
2811
|
+
"ds-message-feedback__btn",
|
|
2812
|
+
s === "disliked" && "ds-message-feedback__btn--disliked"
|
|
2813
|
+
].filter(Boolean).join(" "),
|
|
2814
|
+
onClick: r,
|
|
2815
|
+
disabled: n,
|
|
2816
|
+
"aria-label": "Dislike",
|
|
2817
|
+
"aria-pressed": s === "disliked",
|
|
2818
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2819
|
+
as,
|
|
2820
|
+
{
|
|
2821
|
+
size: D[1],
|
|
2822
|
+
strokeWidth: 1.5,
|
|
2823
|
+
fill: s === "disliked" ? "currentColor" : "none"
|
|
2824
|
+
}
|
|
2825
|
+
)
|
|
2826
|
+
}
|
|
2827
|
+
)
|
|
2828
|
+
]
|
|
2829
|
+
}
|
|
2830
|
+
);
|
|
2831
|
+
}
|
|
2832
|
+
function Fs(s) {
|
|
2833
|
+
const t = s instanceof Date ? s : new Date(s);
|
|
2834
|
+
if (isNaN(t)) return null;
|
|
2835
|
+
const r = /* @__PURE__ */ new Date(), i = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(r.getFullYear(), r.getMonth(), r.getDate()), n = new Date(a - 864e5);
|
|
2836
|
+
if (t >= a) return i;
|
|
2837
|
+
if (t >= n) return `Yesterday ${i}`;
|
|
2838
|
+
const o = t.getDate(), l = t.toLocaleString([], { month: "short" });
|
|
2839
|
+
return `${o} ${l} ${i}`;
|
|
2840
|
+
}
|
|
2841
|
+
function Yt({
|
|
2842
|
+
role: s = "assistant",
|
|
2843
|
+
text: t,
|
|
2844
|
+
timestamp: r,
|
|
2845
|
+
feedbackValue: i = "idle",
|
|
2846
|
+
onLike: a,
|
|
2847
|
+
onDislike: n,
|
|
2848
|
+
className: o = "",
|
|
2849
|
+
...l
|
|
2850
|
+
}) {
|
|
2851
|
+
const m = s === "assistant" && (a || n), d = !!t, f = r ? Fs(r) : null;
|
|
2852
|
+
return !m && !d && !f ? null : /* @__PURE__ */ e.jsxs(
|
|
2853
|
+
"div",
|
|
2854
|
+
{
|
|
2855
|
+
className: ["ds-message-footer", `ds-message-footer--${s}`, o].filter(Boolean).join(" "),
|
|
2856
|
+
...l,
|
|
2857
|
+
children: [
|
|
2858
|
+
s === "user" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp", children: f }),
|
|
2859
|
+
m && /* @__PURE__ */ e.jsx(Os, { value: i, onLike: a, onDislike: n }),
|
|
2860
|
+
d && /* @__PURE__ */ e.jsx(As, { text: t }),
|
|
2861
|
+
s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp", children: f })
|
|
2862
|
+
]
|
|
2863
|
+
}
|
|
2864
|
+
);
|
|
2865
|
+
}
|
|
2736
2866
|
export {
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2867
|
+
Ee as Accordion,
|
|
2868
|
+
et as Alert,
|
|
2869
|
+
Tt as AnimatedNumber,
|
|
2870
|
+
ut as Avatar,
|
|
2871
|
+
ae as Badge,
|
|
2872
|
+
kt as Banner,
|
|
2873
|
+
wt as Breadcrumb,
|
|
2874
|
+
me as Button,
|
|
2875
|
+
Ks as Card,
|
|
2876
|
+
Pt as ChatMessage,
|
|
2877
|
+
ct as Checkbox,
|
|
2878
|
+
tt as Code,
|
|
2879
|
+
ms as CodeAccordion,
|
|
2880
|
+
Ct as ConfidenceBar,
|
|
2881
|
+
As as CopyButton,
|
|
2882
|
+
Ut as DiffView,
|
|
2883
|
+
yt as Drawer,
|
|
2884
|
+
Be as DrawerFooter,
|
|
2885
|
+
Et as Dropdown,
|
|
2886
|
+
jt as EmptyState,
|
|
2887
|
+
vt as FormField,
|
|
2888
|
+
Gs as H1,
|
|
2889
|
+
Xs as H2,
|
|
2890
|
+
Js as H3,
|
|
2891
|
+
Zs as H4,
|
|
2892
|
+
Rt as InView,
|
|
2893
|
+
Vs as Input,
|
|
2894
|
+
rt as Link,
|
|
2895
|
+
Os as MessageFeedback,
|
|
2896
|
+
Yt as MessageFooter,
|
|
2897
|
+
st as Modal,
|
|
2766
2898
|
Ie as ModalFooter,
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2899
|
+
Ot as ModelPicker,
|
|
2900
|
+
Qs as P1,
|
|
2901
|
+
ds as P2,
|
|
2902
|
+
Fe as P3,
|
|
2903
|
+
gt as Pagination,
|
|
2904
|
+
$t as ProgressBar,
|
|
2905
|
+
zt as PromptInput,
|
|
2906
|
+
dt as Radio,
|
|
2907
|
+
It as ReasoningBlock,
|
|
2908
|
+
it as SegmentedControl,
|
|
2909
|
+
Hs as Select,
|
|
2910
|
+
xs as Skeleton,
|
|
2911
|
+
Ft as SourcesPanel,
|
|
2912
|
+
ls as Spinner,
|
|
2913
|
+
Nt as Stat,
|
|
2914
|
+
Bt as StepIndicator,
|
|
2915
|
+
qs as Stepper,
|
|
2916
|
+
Mt as StreamingText,
|
|
2917
|
+
at as Tab,
|
|
2918
|
+
ft as Table,
|
|
2919
|
+
pt as TableBody,
|
|
2920
|
+
mt as TableHead,
|
|
2921
|
+
ht as TableRow,
|
|
2922
|
+
xt as TableSubheaderRow,
|
|
2923
|
+
nt as Tabs,
|
|
2924
|
+
_t as Td,
|
|
2925
|
+
Ys as Textarea,
|
|
2926
|
+
bt as Th,
|
|
2927
|
+
At as ToastContainer,
|
|
2928
|
+
lt as Toggle,
|
|
2929
|
+
Wt as TokenCounter,
|
|
2930
|
+
Vt as ToolCallBubble,
|
|
2931
|
+
Dt as ToolCallCard,
|
|
2932
|
+
ot as Tooltip,
|
|
2933
|
+
D as iconSizes,
|
|
2934
|
+
ks as useAnimatedNumber,
|
|
2935
|
+
Ds as useAnimatedPlaceholder,
|
|
2936
|
+
Es as useInView,
|
|
2937
|
+
Lt as useStreamScroll,
|
|
2938
|
+
St as useToast
|
|
2806
2939
|
};
|