@donkit-ai/design-system 1.4.0 → 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 +38 -1
- package/dist/index.es.js +1088 -953
- 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,40 +136,40 @@ 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
|
-
function
|
|
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,
|
|
172
|
-
get:
|
|
172
|
+
get: m
|
|
173
173
|
}) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -189,28 +189,28 @@ 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);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
|
-
else
|
|
208
|
-
if (U.call(
|
|
207
|
+
else p(W);
|
|
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
|
-
function
|
|
244
|
-
h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof ===
|
|
243
|
+
function p(c) {
|
|
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",
|
|
@@ -304,60 +304,62 @@ function fe({
|
|
|
304
304
|
disabled: n = !1,
|
|
305
305
|
state: o = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
308
|
-
href:
|
|
307
|
+
type: m = "button",
|
|
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
|
}
|
|
345
347
|
return /* @__PURE__ */ e.jsx(
|
|
346
348
|
"button",
|
|
347
349
|
{
|
|
348
|
-
type:
|
|
349
|
-
className:
|
|
350
|
+
type: m,
|
|
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,
|
|
@@ -366,23 +368,23 @@ function Os({
|
|
|
366
368
|
iconRight: n,
|
|
367
369
|
onIconRightClick: o,
|
|
368
370
|
size: l = "m",
|
|
369
|
-
disabled:
|
|
370
|
-
id:
|
|
371
|
+
disabled: m,
|
|
372
|
+
id: d,
|
|
371
373
|
...f
|
|
372
374
|
}) {
|
|
373
|
-
const
|
|
374
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${
|
|
375
|
-
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor:
|
|
375
|
+
const p = d || `input-${K.useId()}`, h = r ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, b = u || h;
|
|
376
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
|
+
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
376
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
377
379
|
a && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: a }),
|
|
378
380
|
/* @__PURE__ */ e.jsx(
|
|
379
381
|
"input",
|
|
380
382
|
{
|
|
381
|
-
id:
|
|
383
|
+
id: p,
|
|
382
384
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${n ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
383
|
-
disabled:
|
|
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,
|
|
@@ -411,10 +413,10 @@ function zs({
|
|
|
411
413
|
disabled: n,
|
|
412
414
|
id: o,
|
|
413
415
|
resize: l = !0,
|
|
414
|
-
rows:
|
|
415
|
-
...
|
|
416
|
+
rows: m = 3,
|
|
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":
|
|
428
|
-
rows:
|
|
429
|
-
...
|
|
429
|
+
"aria-describedby": u,
|
|
430
|
+
rows: m,
|
|
431
|
+
...d
|
|
430
432
|
}
|
|
431
433
|
),
|
|
432
|
-
r && !t && /* @__PURE__ */ e.jsx("span", { id:
|
|
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,
|
|
@@ -442,148 +444,148 @@ function Fs({
|
|
|
442
444
|
error: n,
|
|
443
445
|
fullWidth: o = !0,
|
|
444
446
|
size: l = "m",
|
|
445
|
-
disabled:
|
|
446
|
-
id:
|
|
447
|
+
disabled: m = !1,
|
|
448
|
+
id: d,
|
|
447
449
|
...f
|
|
448
450
|
}) {
|
|
449
|
-
const [
|
|
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
|
-
|
|
470
|
-
if (
|
|
471
|
-
return
|
|
472
|
-
window.removeEventListener("scroll",
|
|
471
|
+
M(() => {
|
|
472
|
+
if (p)
|
|
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
|
-
}, [
|
|
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 (!
|
|
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
|
-
|
|
495
|
+
p && (g.preventDefault(), $(0));
|
|
494
496
|
break;
|
|
495
497
|
case "End":
|
|
496
|
-
|
|
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
|
-
|
|
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
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${
|
|
547
|
-
s && /* @__PURE__ */ e.jsx("label", { id:
|
|
548
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${o ? "ds-select-wrapper--full" : ""} ${m ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
549
|
+
s && /* @__PURE__ */ e.jsx("label", { id: 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
|
-
"aria-expanded":
|
|
557
|
-
"aria-activedescendant":
|
|
558
|
-
"aria-labelledby": s ?
|
|
558
|
+
"aria-expanded": p,
|
|
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
|
-
|
|
565
|
+
m || (p ? U() : x());
|
|
564
566
|
},
|
|
565
|
-
onKeyDown:
|
|
566
|
-
disabled:
|
|
567
|
+
onKeyDown: k,
|
|
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 ${
|
|
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,
|
|
@@ -592,42 +594,42 @@ function Ws({
|
|
|
592
594
|
step: n = 1,
|
|
593
595
|
size: o = "m",
|
|
594
596
|
disabled: l = !1,
|
|
595
|
-
hint:
|
|
596
|
-
error:
|
|
597
|
+
hint: m,
|
|
598
|
+
error: d,
|
|
597
599
|
...f
|
|
598
600
|
}) {
|
|
599
|
-
const
|
|
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,
|
|
@@ -658,18 +660,18 @@ function Ws({
|
|
|
658
660
|
{
|
|
659
661
|
type: "button",
|
|
660
662
|
className: "ds-stepper-button ds-stepper-button--plus",
|
|
661
|
-
onClick:
|
|
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
|
-
|
|
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,69 +682,69 @@ 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
|
|
710
|
+
const p = d && a ? "button" : "div", h = d && a ? {
|
|
709
711
|
type: "button",
|
|
710
712
|
onClick: a,
|
|
711
713
|
disabled: o
|
|
712
714
|
} : {};
|
|
713
715
|
return /* @__PURE__ */ e.jsx(
|
|
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 =
|
|
801
|
-
!r || l || (
|
|
802
|
-
|
|
803
|
-
},
|
|
802
|
+
const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
|
|
803
|
+
!r || l || (m(!0), setTimeout(() => {
|
|
804
|
+
m(!1), r();
|
|
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,18 +827,18 @@ 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
|
)
|
|
837
839
|
] }),
|
|
838
840
|
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body", children: h }),
|
|
839
|
-
|
|
841
|
+
p
|
|
840
842
|
]
|
|
841
843
|
}
|
|
842
844
|
) });
|
|
@@ -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,30 +856,30 @@ function fs({
|
|
|
854
856
|
className: o = "",
|
|
855
857
|
...l
|
|
856
858
|
}) {
|
|
857
|
-
const [
|
|
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
|
{
|
|
869
871
|
type: "button",
|
|
870
872
|
className: "ds-code-accordion__header",
|
|
871
873
|
onClick: h,
|
|
872
|
-
"aria-expanded":
|
|
874
|
+
"aria-expanded": p,
|
|
873
875
|
children: [
|
|
874
876
|
/* @__PURE__ */ e.jsx("span", { className: "ds-code-accordion__title", children: t }),
|
|
875
877
|
/* @__PURE__ */ e.jsx(
|
|
876
878
|
xe,
|
|
877
879
|
{
|
|
878
|
-
size:
|
|
880
|
+
size: D[2],
|
|
879
881
|
strokeWidth: 1.5,
|
|
880
|
-
className: `ds-code-accordion__icon ${
|
|
882
|
+
className: `ds-code-accordion__icon ${p ? "ds-code-accordion__icon--expanded" : ""}`
|
|
881
883
|
}
|
|
882
884
|
)
|
|
883
885
|
]
|
|
@@ -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
|
-
|
|
917
|
-
].filter(Boolean).join(" "),
|
|
918
|
+
d && "ds-tab--icon-only"
|
|
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",
|
|
@@ -935,8 +937,8 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
935
937
|
className: f,
|
|
936
938
|
href: n ? void 0 : l,
|
|
937
939
|
onClick: h,
|
|
938
|
-
...
|
|
939
|
-
children:
|
|
940
|
+
...m,
|
|
941
|
+
children: p
|
|
940
942
|
}
|
|
941
943
|
);
|
|
942
944
|
}
|
|
@@ -948,34 +950,34 @@ function Zs({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
948
950
|
className: f,
|
|
949
951
|
onClick: r,
|
|
950
952
|
disabled: n,
|
|
951
|
-
...
|
|
952
|
-
children:
|
|
953
|
+
...m,
|
|
954
|
+
children: p
|
|
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
|
-
return
|
|
971
|
-
const
|
|
972
|
-
f.current = t,
|
|
973
|
-
}),
|
|
972
|
+
return p.current = h, Ve(() => {
|
|
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,
|
|
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}`,
|
|
@@ -1037,14 +1039,14 @@ function Fe({
|
|
|
1037
1039
|
{
|
|
1038
1040
|
type: "button",
|
|
1039
1041
|
className: "ds-accordion__header",
|
|
1040
|
-
onClick:
|
|
1042
|
+
onClick: p,
|
|
1041
1043
|
"aria-expanded": f,
|
|
1042
1044
|
children: [
|
|
1043
1045
|
/* @__PURE__ */ e.jsx("span", { className: "ds-accordion__title", children: t }),
|
|
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,49 +1077,49 @@ 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
|
-
if (!f.current || !
|
|
1093
|
-
const
|
|
1094
|
-
|
|
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 = () => {
|
|
1094
|
+
if (!f.current || !p.current) return;
|
|
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
|
-
ref:
|
|
1120
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1121
|
+
ref: p,
|
|
1122
|
+
className: `ds-tooltip ds-tooltip--${m}`,
|
|
1121
1123
|
role: "tooltip",
|
|
1122
1124
|
style: o,
|
|
1123
1125
|
children: t
|
|
@@ -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,12 +1156,12 @@ 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"
|
|
1161
1163
|
].filter(Boolean).join(" ");
|
|
1162
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1164
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1163
1165
|
/* @__PURE__ */ e.jsx(
|
|
1164
1166
|
"input",
|
|
1165
1167
|
{
|
|
@@ -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,12 +1187,12 @@ 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(" "),
|
|
1193
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1194
|
+
].filter(Boolean).join(" "), d = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1195
|
+
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1194
1196
|
/* @__PURE__ */ e.jsx(
|
|
1195
1197
|
"input",
|
|
1196
1198
|
{
|
|
@@ -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",
|
|
@@ -1223,33 +1225,33 @@ function rt({
|
|
|
1223
1225
|
name: n,
|
|
1224
1226
|
value: o,
|
|
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
|
-
onChange: (
|
|
1243
|
+
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1242
1244
|
disabled: i,
|
|
1243
1245
|
name: n,
|
|
1244
1246
|
value: o,
|
|
1245
|
-
...
|
|
1247
|
+
...m
|
|
1246
1248
|
}
|
|
1247
1249
|
),
|
|
1248
1250
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
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 ?? ""), [
|
|
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 && !
|
|
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,40 +1336,42 @@ 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
|
{
|
|
1347
1349
|
className: [
|
|
1348
1350
|
"ds-table-row",
|
|
1349
|
-
t ||
|
|
1351
|
+
t || l ? "ds-table-row--interactive" : "",
|
|
1350
1352
|
r ? "ds-table-row--selected" : "",
|
|
1351
1353
|
i ? "ds-table-row--subheader" : "",
|
|
1352
|
-
a
|
|
1354
|
+
a ? "ds-table-row--exiting" : "",
|
|
1355
|
+
n ? "ds-table-row--updated" : "",
|
|
1356
|
+
o
|
|
1353
1357
|
].filter(Boolean).join(" "),
|
|
1354
|
-
onClick:
|
|
1355
|
-
...
|
|
1358
|
+
onClick: l,
|
|
1359
|
+
...m,
|
|
1356
1360
|
children: s
|
|
1357
1361
|
}
|
|
1358
1362
|
);
|
|
1359
1363
|
}
|
|
1360
|
-
function
|
|
1364
|
+
function xt({ children: s, colSpan: t = 999, ...r }) {
|
|
1361
1365
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1362
1366
|
}
|
|
1363
|
-
function
|
|
1364
|
-
const
|
|
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;
|
|
1365
1369
|
return /* @__PURE__ */ e.jsx(
|
|
1366
1370
|
"th",
|
|
1367
1371
|
{
|
|
1368
1372
|
className: [
|
|
1369
1373
|
"ds-th",
|
|
1370
|
-
|
|
1374
|
+
m ? "ds-th--sortable" : "",
|
|
1371
1375
|
r ? "ds-th--sorted" : "",
|
|
1372
1376
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1373
1377
|
n
|
|
@@ -1375,14 +1379,14 @@ function dt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
|
|
|
1375
1379
|
onClick: i,
|
|
1376
1380
|
style: { width: a, ...o },
|
|
1377
1381
|
...l,
|
|
1378
|
-
children:
|
|
1382
|
+
children: m ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1379
1383
|
s,
|
|
1380
|
-
/* @__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 }) })
|
|
1381
1385
|
] }) : s
|
|
1382
1386
|
}
|
|
1383
1387
|
);
|
|
1384
1388
|
}
|
|
1385
|
-
function
|
|
1389
|
+
function _t({ children: s, align: t = "left", secondary: r, muted: i, truncate: a, nowrap: n, className: o = "", ...l }) {
|
|
1386
1390
|
return /* @__PURE__ */ e.jsx(
|
|
1387
1391
|
"td",
|
|
1388
1392
|
{
|
|
@@ -1400,7 +1404,7 @@ function ut({ children: s, align: t = "left", secondary: r, muted: i, truncate:
|
|
|
1400
1404
|
}
|
|
1401
1405
|
);
|
|
1402
1406
|
}
|
|
1403
|
-
function
|
|
1407
|
+
function jt({
|
|
1404
1408
|
icon: s,
|
|
1405
1409
|
title: t,
|
|
1406
1410
|
description: r,
|
|
@@ -1423,7 +1427,7 @@ function ft({
|
|
|
1423
1427
|
}
|
|
1424
1428
|
);
|
|
1425
1429
|
}
|
|
1426
|
-
function
|
|
1430
|
+
function vt({
|
|
1427
1431
|
label: s,
|
|
1428
1432
|
hint: t,
|
|
1429
1433
|
error: r,
|
|
@@ -1432,10 +1436,10 @@ function mt({
|
|
|
1432
1436
|
htmlFor: n,
|
|
1433
1437
|
children: o,
|
|
1434
1438
|
className: l = "",
|
|
1435
|
-
style:
|
|
1436
|
-
...
|
|
1439
|
+
style: m,
|
|
1440
|
+
...d
|
|
1437
1441
|
}) {
|
|
1438
|
-
const f =
|
|
1442
|
+
const f = K.useId(), p = n ?? f, h = `${p}-hint`, u = `${p}-error`;
|
|
1439
1443
|
return /* @__PURE__ */ e.jsxs(
|
|
1440
1444
|
"div",
|
|
1441
1445
|
{
|
|
@@ -1443,19 +1447,19 @@ function mt({
|
|
|
1443
1447
|
"data-state": r ? "error" : void 0,
|
|
1444
1448
|
"data-required": i ? "" : void 0,
|
|
1445
1449
|
"data-disabled": a ? "" : void 0,
|
|
1446
|
-
style:
|
|
1447
|
-
...
|
|
1450
|
+
style: m,
|
|
1451
|
+
...d,
|
|
1448
1452
|
children: [
|
|
1449
|
-
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor:
|
|
1453
|
+
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1450
1454
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
|
|
1451
1455
|
t && !r && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1452
|
-
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 })
|
|
1453
1457
|
]
|
|
1454
1458
|
}
|
|
1455
1459
|
);
|
|
1456
1460
|
}
|
|
1457
|
-
function
|
|
1458
|
-
const
|
|
1461
|
+
function Nt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, className: n = "", style: o, ...l }) {
|
|
1462
|
+
const m = r != null && r.startsWith("+") ? "up" : r != null && r.startsWith("-") ? "down" : "neutral";
|
|
1459
1463
|
return /* @__PURE__ */ e.jsxs(
|
|
1460
1464
|
"div",
|
|
1461
1465
|
{
|
|
@@ -1470,12 +1474,12 @@ function pt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
|
|
|
1470
1474
|
children: [
|
|
1471
1475
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1472
1476
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1473
|
-
r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${
|
|
1477
|
+
r != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: r })
|
|
1474
1478
|
]
|
|
1475
1479
|
}
|
|
1476
1480
|
);
|
|
1477
1481
|
}
|
|
1478
|
-
function
|
|
1482
|
+
function wt({
|
|
1479
1483
|
children: s,
|
|
1480
1484
|
separator: t = "/",
|
|
1481
1485
|
"aria-label": r = "Breadcrumb",
|
|
@@ -1483,7 +1487,7 @@ function ht({
|
|
|
1483
1487
|
style: a,
|
|
1484
1488
|
...n
|
|
1485
1489
|
}) {
|
|
1486
|
-
const o =
|
|
1490
|
+
const o = K.Children.toArray(s).filter(Boolean);
|
|
1487
1491
|
return /* @__PURE__ */ e.jsx(
|
|
1488
1492
|
"nav",
|
|
1489
1493
|
{
|
|
@@ -1491,14 +1495,14 @@ function ht({
|
|
|
1491
1495
|
"aria-label": r,
|
|
1492
1496
|
style: a,
|
|
1493
1497
|
...n,
|
|
1494
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l,
|
|
1498
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1495
1499
|
l,
|
|
1496
|
-
|
|
1497
|
-
] },
|
|
1500
|
+
m < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
1501
|
+
] }, m)) })
|
|
1498
1502
|
}
|
|
1499
1503
|
);
|
|
1500
1504
|
}
|
|
1501
|
-
function
|
|
1505
|
+
function gt({
|
|
1502
1506
|
page: s,
|
|
1503
1507
|
total: t,
|
|
1504
1508
|
onChange: r,
|
|
@@ -1508,7 +1512,7 @@ function xt({
|
|
|
1508
1512
|
style: o,
|
|
1509
1513
|
...l
|
|
1510
1514
|
}) {
|
|
1511
|
-
const
|
|
1515
|
+
const m = vs(s, t, i);
|
|
1512
1516
|
return /* @__PURE__ */ e.jsxs(
|
|
1513
1517
|
"nav",
|
|
1514
1518
|
{
|
|
@@ -1524,20 +1528,20 @@ function xt({
|
|
|
1524
1528
|
onClick: () => r == null ? void 0 : r(s - 1),
|
|
1525
1529
|
disabled: s <= 1,
|
|
1526
1530
|
"aria-label": "Previous page",
|
|
1527
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1531
|
+
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
1528
1532
|
}
|
|
1529
1533
|
),
|
|
1530
|
-
|
|
1531
|
-
(
|
|
1534
|
+
m.map(
|
|
1535
|
+
(d, f) => d === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${f}`) : /* @__PURE__ */ e.jsx(
|
|
1532
1536
|
"button",
|
|
1533
1537
|
{
|
|
1534
|
-
className: `ds-pagination-page${
|
|
1535
|
-
onClick: () =>
|
|
1536
|
-
"aria-current":
|
|
1537
|
-
"aria-label": `Page ${
|
|
1538
|
-
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
|
|
1539
1543
|
},
|
|
1540
|
-
|
|
1544
|
+
d
|
|
1541
1545
|
)
|
|
1542
1546
|
),
|
|
1543
1547
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1547,44 +1551,44 @@ function xt({
|
|
|
1547
1551
|
onClick: () => r == null ? void 0 : r(s + 1),
|
|
1548
1552
|
disabled: s >= t,
|
|
1549
1553
|
"aria-label": "Next page",
|
|
1550
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1554
|
+
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1551
1555
|
}
|
|
1552
1556
|
)
|
|
1553
1557
|
]
|
|
1554
1558
|
}
|
|
1555
1559
|
);
|
|
1556
1560
|
}
|
|
1557
|
-
function
|
|
1561
|
+
function vs(s, t, r) {
|
|
1558
1562
|
if (t <= 7) return Array.from({ length: t }, (o, l) => l + 1);
|
|
1559
1563
|
const i = Math.max(2, s - r), a = Math.min(t - 1, s + r), n = [1];
|
|
1560
1564
|
i > 2 && n.push("…");
|
|
1561
1565
|
for (let o = i; o <= a; o++) n.push(o);
|
|
1562
1566
|
return a < t - 1 && n.push("…"), n.push(t), n;
|
|
1563
1567
|
}
|
|
1564
|
-
const
|
|
1565
|
-
function
|
|
1568
|
+
const Ns = 200;
|
|
1569
|
+
function yt({
|
|
1566
1570
|
children: s,
|
|
1567
1571
|
title: t,
|
|
1568
1572
|
onClose: r,
|
|
1569
1573
|
side: i = "right",
|
|
1570
1574
|
...a
|
|
1571
1575
|
}) {
|
|
1572
|
-
const n =
|
|
1573
|
-
!r || l || (
|
|
1574
|
-
|
|
1575
|
-
},
|
|
1576
|
+
const n = E(null), o = K.useId(), [l, m] = A(!1), d = () => {
|
|
1577
|
+
!r || l || (m(!0), setTimeout(() => {
|
|
1578
|
+
m(!1), r();
|
|
1579
|
+
}, Ns));
|
|
1576
1580
|
};
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
},
|
|
1581
|
-
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();
|
|
1582
1586
|
};
|
|
1583
|
-
return document.addEventListener("keydown",
|
|
1584
|
-
document.removeEventListener("keydown",
|
|
1587
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", b), () => {
|
|
1588
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", b);
|
|
1585
1589
|
};
|
|
1586
1590
|
}, [r, l]);
|
|
1587
|
-
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);
|
|
1588
1592
|
return /* @__PURE__ */ e.jsx(
|
|
1589
1593
|
"div",
|
|
1590
1594
|
{
|
|
@@ -1602,26 +1606,26 @@ function _t({
|
|
|
1602
1606
|
children: [
|
|
1603
1607
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1604
1608
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
|
|
1605
|
-
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 }) })
|
|
1606
1610
|
] }),
|
|
1607
1611
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1608
|
-
|
|
1612
|
+
p
|
|
1609
1613
|
]
|
|
1610
1614
|
}
|
|
1611
1615
|
)
|
|
1612
1616
|
}
|
|
1613
1617
|
);
|
|
1614
1618
|
}
|
|
1615
|
-
function
|
|
1619
|
+
function Be({ children: s }) {
|
|
1616
1620
|
return /* @__PURE__ */ e.jsx("footer", { className: "ds-drawer-footer", children: s });
|
|
1617
1621
|
}
|
|
1618
|
-
const
|
|
1622
|
+
const ws = {
|
|
1619
1623
|
info: ke,
|
|
1620
|
-
success:
|
|
1621
|
-
warning:
|
|
1624
|
+
success: ye,
|
|
1625
|
+
warning: ge,
|
|
1622
1626
|
error: we
|
|
1623
1627
|
};
|
|
1624
|
-
function
|
|
1628
|
+
function kt({
|
|
1625
1629
|
children: s,
|
|
1626
1630
|
variant: t = "info",
|
|
1627
1631
|
action: r,
|
|
@@ -1630,15 +1634,15 @@ function jt({
|
|
|
1630
1634
|
role: n,
|
|
1631
1635
|
...o
|
|
1632
1636
|
}) {
|
|
1633
|
-
const l =
|
|
1637
|
+
const l = ws[t], m = n || (t === "error" ? "alert" : "status");
|
|
1634
1638
|
return /* @__PURE__ */ e.jsxs(
|
|
1635
1639
|
"div",
|
|
1636
1640
|
{
|
|
1637
1641
|
className: `ds-banner ds-banner--${t}`,
|
|
1638
|
-
role:
|
|
1642
|
+
role: m,
|
|
1639
1643
|
...o,
|
|
1640
1644
|
children: [
|
|
1641
|
-
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 }) }),
|
|
1642
1646
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1643
1647
|
r && /* @__PURE__ */ e.jsx(
|
|
1644
1648
|
"button",
|
|
@@ -1656,14 +1660,14 @@ function jt({
|
|
|
1656
1660
|
className: "ds-banner-dismiss",
|
|
1657
1661
|
onClick: a,
|
|
1658
1662
|
"aria-label": "Dismiss",
|
|
1659
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1663
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[2], strokeWidth: 1.5 })
|
|
1660
1664
|
}
|
|
1661
1665
|
)
|
|
1662
1666
|
]
|
|
1663
1667
|
}
|
|
1664
1668
|
);
|
|
1665
1669
|
}
|
|
1666
|
-
function
|
|
1670
|
+
function Et({
|
|
1667
1671
|
trigger: s,
|
|
1668
1672
|
items: t = [],
|
|
1669
1673
|
open: r,
|
|
@@ -1673,131 +1677,133 @@ function bt({
|
|
|
1673
1677
|
style: o,
|
|
1674
1678
|
...l
|
|
1675
1679
|
}) {
|
|
1676
|
-
const [
|
|
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 = () => {
|
|
1677
1681
|
if (h)
|
|
1678
1682
|
i == null || i(!1);
|
|
1679
1683
|
else {
|
|
1680
1684
|
if (f) return;
|
|
1681
|
-
|
|
1682
|
-
|
|
1685
|
+
p(!0), $.current = setTimeout(() => {
|
|
1686
|
+
d(!1), p(!1);
|
|
1683
1687
|
}, O);
|
|
1684
1688
|
}
|
|
1685
|
-
},
|
|
1686
|
-
const
|
|
1687
|
-
h ? i == null || i(
|
|
1688
|
-
},
|
|
1689
|
-
|
|
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)));
|
|
1690
1694
|
};
|
|
1691
|
-
|
|
1692
|
-
if (!
|
|
1693
|
-
const
|
|
1694
|
-
var
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1697
|
-
|
|
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 }
|
|
1698
1704
|
);
|
|
1699
1705
|
};
|
|
1700
|
-
return
|
|
1701
|
-
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);
|
|
1702
1708
|
};
|
|
1703
|
-
}, [
|
|
1704
|
-
const
|
|
1705
|
-
var
|
|
1706
|
-
const
|
|
1709
|
+
}, [u, a]);
|
|
1710
|
+
const P = () => {
|
|
1711
|
+
var v;
|
|
1712
|
+
const x = (v = S.current) == null ? void 0 : v.querySelector(
|
|
1707
1713
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
1708
1714
|
);
|
|
1709
|
-
|
|
1715
|
+
x == null || x.focus();
|
|
1710
1716
|
};
|
|
1711
|
-
|
|
1712
|
-
if (!
|
|
1713
|
-
const
|
|
1714
|
-
var
|
|
1715
|
-
!((
|
|
1716
|
-
},
|
|
1717
|
-
|
|
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());
|
|
1718
1724
|
};
|
|
1719
|
-
return document.addEventListener("mousedown",
|
|
1720
|
-
document.removeEventListener("mousedown",
|
|
1725
|
+
return document.addEventListener("mousedown", x), document.addEventListener("keydown", v), () => {
|
|
1726
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", v);
|
|
1721
1727
|
};
|
|
1722
|
-
}, [
|
|
1723
|
-
if (!
|
|
1724
|
-
const
|
|
1725
|
-
|
|
1726
|
-
}, [
|
|
1727
|
-
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(
|
|
1728
1734
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1729
|
-
)] : [],
|
|
1730
|
-
var
|
|
1731
|
-
if (
|
|
1732
|
-
|
|
1733
|
-
else if (
|
|
1734
|
-
if (
|
|
1735
|
-
|
|
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();
|
|
1736
1742
|
else {
|
|
1737
|
-
const
|
|
1738
|
-
(
|
|
1743
|
+
const L = N();
|
|
1744
|
+
(k = L[L.length - 1]) == null || k.focus();
|
|
1739
1745
|
}
|
|
1740
|
-
},
|
|
1741
|
-
var
|
|
1742
|
-
const
|
|
1743
|
-
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) {
|
|
1744
1750
|
case "ArrowDown":
|
|
1745
|
-
|
|
1751
|
+
x.preventDefault(), (L = v[Math.min(k + 1, v.length - 1)]) == null || L.focus();
|
|
1746
1752
|
break;
|
|
1747
1753
|
case "ArrowUp":
|
|
1748
|
-
|
|
1754
|
+
x.preventDefault(), k <= 0 ? P() : (H = v[k - 1]) == null || H.focus();
|
|
1749
1755
|
break;
|
|
1750
1756
|
case "Home":
|
|
1751
|
-
|
|
1757
|
+
x.preventDefault(), (X = v[0]) == null || X.focus();
|
|
1752
1758
|
break;
|
|
1753
1759
|
case "End":
|
|
1754
|
-
|
|
1760
|
+
x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
|
|
1755
1761
|
break;
|
|
1756
1762
|
case "Tab":
|
|
1757
|
-
|
|
1763
|
+
I();
|
|
1758
1764
|
break;
|
|
1759
1765
|
}
|
|
1760
|
-
}, U =
|
|
1766
|
+
}, U = u && /* @__PURE__ */ e.jsx(
|
|
1761
1767
|
"div",
|
|
1762
1768
|
{
|
|
1763
|
-
ref:
|
|
1769
|
+
ref: j,
|
|
1764
1770
|
role: "menu",
|
|
1765
1771
|
className: [
|
|
1766
1772
|
"ds-dropdown__menu",
|
|
1767
1773
|
`ds-dropdown__menu--${a}`,
|
|
1768
1774
|
f && "ds-dropdown__menu--closing"
|
|
1769
1775
|
].filter(Boolean).join(" "),
|
|
1770
|
-
style:
|
|
1771
|
-
onKeyDown:
|
|
1772
|
-
children: t.map((
|
|
1773
|
-
if (
|
|
1774
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" },
|
|
1775
|
-
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")
|
|
1776
1782
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
1777
|
-
|
|
1778
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
1779
|
-
] },
|
|
1780
|
-
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 };
|
|
1781
1787
|
return /* @__PURE__ */ e.jsxs(
|
|
1782
|
-
|
|
1788
|
+
L,
|
|
1783
1789
|
{
|
|
1784
1790
|
role: "menuitem",
|
|
1785
1791
|
className: [
|
|
1786
1792
|
"ds-dropdown__item",
|
|
1787
|
-
|
|
1793
|
+
x.danger && "ds-dropdown__item--danger"
|
|
1788
1794
|
].filter(Boolean).join(" "),
|
|
1789
|
-
...
|
|
1795
|
+
...H,
|
|
1790
1796
|
onClick: () => {
|
|
1791
|
-
var
|
|
1792
|
-
(
|
|
1797
|
+
var X;
|
|
1798
|
+
(X = x.onClick) == null || X.call(x), I();
|
|
1793
1799
|
},
|
|
1794
1800
|
children: [
|
|
1795
|
-
|
|
1796
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
1797
|
-
|
|
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 })
|
|
1798
1804
|
]
|
|
1799
1805
|
},
|
|
1800
|
-
|
|
1806
|
+
v
|
|
1801
1807
|
);
|
|
1802
1808
|
})
|
|
1803
1809
|
}
|
|
@@ -1805,7 +1811,7 @@ function bt({
|
|
|
1805
1811
|
return /* @__PURE__ */ e.jsxs(
|
|
1806
1812
|
"div",
|
|
1807
1813
|
{
|
|
1808
|
-
ref:
|
|
1814
|
+
ref: b,
|
|
1809
1815
|
className: ["ds-dropdown", n].filter(Boolean).join(" "),
|
|
1810
1816
|
style: o,
|
|
1811
1817
|
...l,
|
|
@@ -1813,19 +1819,19 @@ function bt({
|
|
|
1813
1819
|
/* @__PURE__ */ e.jsx(
|
|
1814
1820
|
"div",
|
|
1815
1821
|
{
|
|
1816
|
-
ref:
|
|
1822
|
+
ref: S,
|
|
1817
1823
|
className: "ds-dropdown__trigger",
|
|
1818
|
-
onClick:
|
|
1819
|
-
onKeyDown:
|
|
1824
|
+
onClick: Y,
|
|
1825
|
+
onKeyDown: C,
|
|
1820
1826
|
children: s
|
|
1821
1827
|
}
|
|
1822
1828
|
),
|
|
1823
|
-
typeof document < "u" &&
|
|
1829
|
+
typeof document < "u" && pe.createPortal(U, document.body)
|
|
1824
1830
|
]
|
|
1825
1831
|
}
|
|
1826
1832
|
);
|
|
1827
1833
|
}
|
|
1828
|
-
function
|
|
1834
|
+
function $t({
|
|
1829
1835
|
value: s = 0,
|
|
1830
1836
|
size: t = "m",
|
|
1831
1837
|
variant: r = "default",
|
|
@@ -1833,7 +1839,7 @@ function vt({
|
|
|
1833
1839
|
min: a = 2,
|
|
1834
1840
|
animate: n = !0
|
|
1835
1841
|
}) {
|
|
1836
|
-
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o),
|
|
1842
|
+
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m = r === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : r;
|
|
1837
1843
|
return /* @__PURE__ */ e.jsxs(
|
|
1838
1844
|
"div",
|
|
1839
1845
|
{
|
|
@@ -1850,7 +1856,7 @@ function vt({
|
|
|
1850
1856
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
1851
1857
|
"div",
|
|
1852
1858
|
{
|
|
1853
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
1859
|
+
className: `ds-progress__fill ds-progress__fill--${m}`,
|
|
1854
1860
|
style: { width: `${l}%` }
|
|
1855
1861
|
}
|
|
1856
1862
|
) }),
|
|
@@ -1862,50 +1868,50 @@ function vt({
|
|
|
1862
1868
|
}
|
|
1863
1869
|
);
|
|
1864
1870
|
}
|
|
1865
|
-
const
|
|
1866
|
-
function
|
|
1867
|
-
const [r, i] =
|
|
1868
|
-
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(() => {
|
|
1869
1875
|
if (ys()) {
|
|
1870
1876
|
i(s), a.current = s;
|
|
1871
1877
|
return;
|
|
1872
1878
|
}
|
|
1873
1879
|
const o = a.current, l = s - o;
|
|
1874
1880
|
if (l === 0) return;
|
|
1875
|
-
let
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
const
|
|
1879
|
-
i(o + l *
|
|
1881
|
+
let m = null;
|
|
1882
|
+
const d = (f) => {
|
|
1883
|
+
m || (m = f);
|
|
1884
|
+
const p = Math.min((f - m) / t, 1);
|
|
1885
|
+
i(o + l * gs(p)), p < 1 ? n.current = requestAnimationFrame(d) : a.current = s;
|
|
1880
1886
|
};
|
|
1881
|
-
return n.current = requestAnimationFrame(
|
|
1887
|
+
return n.current = requestAnimationFrame(d), () => cancelAnimationFrame(n.current);
|
|
1882
1888
|
}, [s, t]), r;
|
|
1883
1889
|
}
|
|
1884
|
-
function
|
|
1890
|
+
function Tt({
|
|
1885
1891
|
value: s,
|
|
1886
1892
|
duration: t = 600,
|
|
1887
1893
|
decimals: r = 0,
|
|
1888
1894
|
prefix: i = "",
|
|
1889
1895
|
suffix: a = ""
|
|
1890
1896
|
}) {
|
|
1891
|
-
const o =
|
|
1897
|
+
const o = ks(s, { duration: t }).toFixed(r);
|
|
1892
1898
|
return `${i}${o}${a}`;
|
|
1893
1899
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const i =
|
|
1896
|
-
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(() => {
|
|
1897
1903
|
const o = i.current;
|
|
1898
1904
|
if (!o) return;
|
|
1899
1905
|
const l = new IntersectionObserver(
|
|
1900
|
-
([
|
|
1901
|
-
|
|
1906
|
+
([m]) => {
|
|
1907
|
+
m.isIntersecting ? (n(!0), r && l.disconnect()) : r || n(!1);
|
|
1902
1908
|
},
|
|
1903
1909
|
{ threshold: s, rootMargin: t }
|
|
1904
1910
|
);
|
|
1905
1911
|
return l.observe(o), () => l.disconnect();
|
|
1906
1912
|
}, [s, t, r]), { ref: i, inView: a };
|
|
1907
1913
|
}
|
|
1908
|
-
function
|
|
1914
|
+
function Rt({
|
|
1909
1915
|
children: s,
|
|
1910
1916
|
as: t = "div",
|
|
1911
1917
|
once: r = !1,
|
|
@@ -1915,31 +1921,31 @@ function wt({
|
|
|
1915
1921
|
onLeave: o,
|
|
1916
1922
|
...l
|
|
1917
1923
|
}) {
|
|
1918
|
-
const { ref:
|
|
1919
|
-
return
|
|
1920
|
-
|
|
1921
|
-
}, [
|
|
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 });
|
|
1922
1928
|
}
|
|
1923
|
-
const
|
|
1929
|
+
const Me = {
|
|
1924
1930
|
default: ke,
|
|
1925
|
-
success:
|
|
1926
|
-
warning:
|
|
1931
|
+
success: ye,
|
|
1932
|
+
warning: ge,
|
|
1927
1933
|
error: we
|
|
1928
1934
|
};
|
|
1929
|
-
let
|
|
1930
|
-
const
|
|
1935
|
+
let de = [];
|
|
1936
|
+
const ve = /* @__PURE__ */ new Set();
|
|
1931
1937
|
function We() {
|
|
1932
|
-
|
|
1933
|
-
}
|
|
1934
|
-
function Es(s) {
|
|
1935
|
-
ce = [...ce, s], We();
|
|
1938
|
+
ve.forEach((s) => s([...de]));
|
|
1936
1939
|
}
|
|
1937
1940
|
function $s(s) {
|
|
1938
|
-
|
|
1941
|
+
de = [...de, s], We();
|
|
1942
|
+
}
|
|
1943
|
+
function Ts(s) {
|
|
1944
|
+
de = de.filter((t) => t.id !== s), We();
|
|
1939
1945
|
}
|
|
1940
|
-
function
|
|
1946
|
+
function St() {
|
|
1941
1947
|
const s = (t, r = {}) => {
|
|
1942
|
-
|
|
1948
|
+
$s({
|
|
1943
1949
|
id: `${Date.now()}-${Math.random()}`,
|
|
1944
1950
|
message: t,
|
|
1945
1951
|
type: "default",
|
|
@@ -1949,13 +1955,13 @@ function yt() {
|
|
|
1949
1955
|
};
|
|
1950
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 };
|
|
1951
1957
|
}
|
|
1952
|
-
function
|
|
1953
|
-
const [r, i] =
|
|
1954
|
-
|
|
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)), []);
|
|
1955
1961
|
function n() {
|
|
1956
1962
|
i(!1), setTimeout(() => t(s.id), 250);
|
|
1957
1963
|
}
|
|
1958
|
-
const o =
|
|
1964
|
+
const o = Me[s.type] ?? Me.default;
|
|
1959
1965
|
return /* @__PURE__ */ e.jsxs(
|
|
1960
1966
|
"div",
|
|
1961
1967
|
{
|
|
@@ -1967,7 +1973,7 @@ function Ts({ data: s, onDismiss: t }) {
|
|
|
1967
1973
|
role: s.type === "error" ? "alert" : "status",
|
|
1968
1974
|
"aria-live": "polite",
|
|
1969
1975
|
children: [
|
|
1970
|
-
/* @__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 }) }),
|
|
1971
1977
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: s.message }),
|
|
1972
1978
|
/* @__PURE__ */ e.jsx(
|
|
1973
1979
|
"button",
|
|
@@ -1975,26 +1981,26 @@ function Ts({ data: s, onDismiss: t }) {
|
|
|
1975
1981
|
className: "ds-toast__close",
|
|
1976
1982
|
onClick: n,
|
|
1977
1983
|
"aria-label": "Закрыть",
|
|
1978
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
1984
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[3], strokeWidth: 1.5 })
|
|
1979
1985
|
}
|
|
1980
1986
|
)
|
|
1981
1987
|
]
|
|
1982
1988
|
}
|
|
1983
1989
|
);
|
|
1984
1990
|
}
|
|
1985
|
-
function
|
|
1986
|
-
const [t, r] =
|
|
1987
|
-
return
|
|
1988
|
-
/* @__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)) }),
|
|
1989
1995
|
document.body
|
|
1990
1996
|
);
|
|
1991
1997
|
}
|
|
1992
|
-
const
|
|
1993
|
-
running: /* @__PURE__ */ e.jsx(
|
|
1994
|
-
success: /* @__PURE__ */ e.jsx(
|
|
1995
|
-
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" })
|
|
1996
2002
|
};
|
|
1997
|
-
function
|
|
2003
|
+
function Dt({
|
|
1998
2004
|
label: s,
|
|
1999
2005
|
status: t = "idle",
|
|
2000
2006
|
icon: r,
|
|
@@ -2002,88 +2008,82 @@ function kt({
|
|
|
2002
2008
|
defaultExpanded: a = !1,
|
|
2003
2009
|
expanded: n,
|
|
2004
2010
|
onToggle: o,
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
...
|
|
2011
|
+
children: l,
|
|
2012
|
+
className: m = "",
|
|
2013
|
+
...d
|
|
2008
2014
|
}) {
|
|
2009
|
-
const
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
"button",
|
|
2015
|
-
{
|
|
2016
|
-
type: "button",
|
|
2017
|
-
className: "ds-tool-card__header",
|
|
2018
|
-
onClick: R,
|
|
2019
|
-
"aria-expanded": b,
|
|
2020
|
-
"aria-controls": m,
|
|
2021
|
-
children: [
|
|
2022
|
-
/* @__PURE__ */ e.jsx(
|
|
2023
|
-
Oe,
|
|
2024
|
-
{
|
|
2025
|
-
size: I[1],
|
|
2026
|
-
strokeWidth: 1.5,
|
|
2027
|
-
className: `ds-tool-card__chevron${b ? " ds-tool-card__chevron--expanded" : ""}`
|
|
2028
|
-
}
|
|
2029
|
-
),
|
|
2030
|
-
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: r }),
|
|
2031
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2032
|
-
Rs[t],
|
|
2033
|
-
i
|
|
2034
|
-
]
|
|
2035
|
-
}
|
|
2036
|
-
),
|
|
2037
|
-
b && /* @__PURE__ */ e.jsx("div", { id: m, className: "ds-tool-card__body", children: p })
|
|
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
|
|
2038
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
|
+
);
|
|
2039
2039
|
}
|
|
2040
|
-
function
|
|
2040
|
+
function As({
|
|
2041
2041
|
text: s,
|
|
2042
2042
|
size: t = "xs",
|
|
2043
2043
|
timeout: r = 2e3,
|
|
2044
2044
|
"aria-label": i = "Copy to clipboard",
|
|
2045
2045
|
...a
|
|
2046
2046
|
}) {
|
|
2047
|
-
const [n, o] =
|
|
2047
|
+
const [n, o] = A(!1), l = () => {
|
|
2048
2048
|
navigator.clipboard.writeText(s).then(() => {
|
|
2049
2049
|
o(!0), setTimeout(() => o(!1), r);
|
|
2050
2050
|
});
|
|
2051
2051
|
};
|
|
2052
2052
|
return /* @__PURE__ */ e.jsx(
|
|
2053
|
-
|
|
2053
|
+
me,
|
|
2054
2054
|
{
|
|
2055
2055
|
variant: "ghost",
|
|
2056
2056
|
size: t,
|
|
2057
|
-
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 }),
|
|
2058
2058
|
"aria-label": i,
|
|
2059
2059
|
onClick: l,
|
|
2060
2060
|
...a
|
|
2061
2061
|
}
|
|
2062
2062
|
);
|
|
2063
2063
|
}
|
|
2064
|
-
function
|
|
2065
|
-
const [i, a] =
|
|
2066
|
-
return
|
|
2064
|
+
function It({ content: s, streaming: t = !1, ...r }) {
|
|
2065
|
+
const [i, a] = A(t);
|
|
2066
|
+
return M(() => {
|
|
2067
2067
|
a(!!t);
|
|
2068
2068
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
2069
|
-
|
|
2069
|
+
Ee,
|
|
2070
2070
|
{
|
|
2071
2071
|
expanded: i,
|
|
2072
2072
|
onToggle: a,
|
|
2073
2073
|
padding: "s",
|
|
2074
2074
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2075
|
-
/* @__PURE__ */ e.jsx(Ze, { size:
|
|
2076
|
-
/* @__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" })
|
|
2077
2077
|
] }),
|
|
2078
2078
|
...r,
|
|
2079
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2079
|
+
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2080
2080
|
s,
|
|
2081
2081
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
2082
2082
|
] })
|
|
2083
2083
|
}
|
|
2084
2084
|
);
|
|
2085
2085
|
}
|
|
2086
|
-
function
|
|
2086
|
+
function Bt({
|
|
2087
2087
|
count: s,
|
|
2088
2088
|
current: t = 0,
|
|
2089
2089
|
done: r = [],
|
|
@@ -2094,35 +2094,35 @@ function Tt({
|
|
|
2094
2094
|
...l
|
|
2095
2095
|
}) {
|
|
2096
2096
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", n].filter(Boolean).join(" "), ...l, children: [
|
|
2097
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (
|
|
2098
|
-
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 = [
|
|
2099
2099
|
"ds-step-indicator__dot",
|
|
2100
2100
|
f && "ds-step-indicator__dot--active",
|
|
2101
|
-
|
|
2101
|
+
p && "ds-step-indicator__dot--done"
|
|
2102
2102
|
].filter(Boolean).join(" ");
|
|
2103
2103
|
return /* @__PURE__ */ e.jsx(
|
|
2104
2104
|
"button",
|
|
2105
2105
|
{
|
|
2106
2106
|
type: "button",
|
|
2107
|
-
className:
|
|
2107
|
+
className: u,
|
|
2108
2108
|
role: "tab",
|
|
2109
2109
|
"aria-selected": f,
|
|
2110
|
-
"aria-label": `Step ${
|
|
2111
|
-
disabled: !h ||
|
|
2112
|
-
onClick: () => i == null ? void 0 : i(
|
|
2113
|
-
children:
|
|
2110
|
+
"aria-label": `Step ${d + 1}`,
|
|
2111
|
+
disabled: !h || d === t,
|
|
2112
|
+
onClick: () => i == null ? void 0 : i(d),
|
|
2113
|
+
children: p ? /* @__PURE__ */ e.jsx(he, { size: 8, strokeWidth: 3 }) : null
|
|
2114
2114
|
},
|
|
2115
|
-
|
|
2115
|
+
d
|
|
2116
2116
|
);
|
|
2117
2117
|
}) }),
|
|
2118
|
-
a && /* @__PURE__ */ e.jsxs(
|
|
2118
|
+
a && /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, className: "ds-step-indicator__counter", children: [
|
|
2119
2119
|
t + 1,
|
|
2120
2120
|
" / ",
|
|
2121
2121
|
s
|
|
2122
2122
|
] })
|
|
2123
2123
|
] });
|
|
2124
2124
|
}
|
|
2125
|
-
function
|
|
2125
|
+
function Mt({
|
|
2126
2126
|
content: s,
|
|
2127
2127
|
isStreaming: t = !1,
|
|
2128
2128
|
cursor: r = "line",
|
|
@@ -2130,15 +2130,15 @@ function Rt({
|
|
|
2130
2130
|
className: a = "",
|
|
2131
2131
|
...n
|
|
2132
2132
|
}) {
|
|
2133
|
-
const o =
|
|
2134
|
-
return
|
|
2133
|
+
const o = E(s);
|
|
2134
|
+
return M(() => {
|
|
2135
2135
|
s !== o.current && (i == null || i(s), o.current = s);
|
|
2136
2136
|
}, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...n, children: [
|
|
2137
2137
|
s,
|
|
2138
2138
|
t && r !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${r}`, "aria-hidden": "true" })
|
|
2139
2139
|
] });
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function Pt({
|
|
2142
2142
|
role: s = "assistant",
|
|
2143
2143
|
header: t,
|
|
2144
2144
|
footer: r,
|
|
@@ -2148,26 +2148,26 @@ function St({
|
|
|
2148
2148
|
className: o = "",
|
|
2149
2149
|
...l
|
|
2150
2150
|
}) {
|
|
2151
|
-
const
|
|
2151
|
+
const m = [
|
|
2152
2152
|
"ds-chat-message",
|
|
2153
2153
|
`ds-chat-message--${s}`,
|
|
2154
2154
|
a && "ds-chat-message--streaming",
|
|
2155
2155
|
o
|
|
2156
2156
|
].filter(Boolean).join(" ");
|
|
2157
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2157
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: n }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2158
2158
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2159
2159
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: n }),
|
|
2160
2160
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2161
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2161
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2162
2162
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2163
2163
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2164
2164
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: n }),
|
|
2165
2165
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: r })
|
|
2166
2166
|
] });
|
|
2167
2167
|
}
|
|
2168
|
-
function
|
|
2169
|
-
const i =
|
|
2170
|
-
|
|
2168
|
+
function Lt(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
2169
|
+
const i = E(!1), a = E(0);
|
|
2170
|
+
M(() => {
|
|
2171
2171
|
const n = t == null ? void 0 : t.current;
|
|
2172
2172
|
if (!n) return;
|
|
2173
2173
|
const o = () => {
|
|
@@ -2175,12 +2175,12 @@ function At(s, { containerRef: t, smartPause: r = !0 } = {}) {
|
|
|
2175
2175
|
!l && n.scrollTop < a.current && (i.current = !0), l && (i.current = !1), a.current = n.scrollTop;
|
|
2176
2176
|
};
|
|
2177
2177
|
return n.addEventListener("scroll", o, { passive: !0 }), () => n.removeEventListener("scroll", o);
|
|
2178
|
-
}, [t]),
|
|
2178
|
+
}, [t]), M(() => {
|
|
2179
2179
|
const n = t == null ? void 0 : t.current;
|
|
2180
2180
|
n && (r && i.current || (n.scrollTop = n.scrollHeight));
|
|
2181
2181
|
}, s);
|
|
2182
2182
|
}
|
|
2183
|
-
function
|
|
2183
|
+
function Ds({
|
|
2184
2184
|
prompts: s,
|
|
2185
2185
|
enabled: t,
|
|
2186
2186
|
typingSpeed: r = 38,
|
|
@@ -2189,36 +2189,36 @@ function Ss({
|
|
|
2189
2189
|
betweenTime: n = 380,
|
|
2190
2190
|
manualPauseMs: o = 5e3
|
|
2191
2191
|
}) {
|
|
2192
|
-
const [l,
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
}, [l]),
|
|
2196
|
-
if (
|
|
2197
|
-
f(""), h.current = 0,
|
|
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) {
|
|
2197
|
+
f(""), h.current = 0, p.current = "typing";
|
|
2198
2198
|
return;
|
|
2199
2199
|
}
|
|
2200
|
-
const
|
|
2200
|
+
const $ = () => {
|
|
2201
2201
|
const O = Date.now();
|
|
2202
|
-
if (
|
|
2203
|
-
|
|
2202
|
+
if (j.current > O) {
|
|
2203
|
+
b.current = setTimeout($, j.current - O);
|
|
2204
2204
|
return;
|
|
2205
2205
|
}
|
|
2206
|
-
const
|
|
2207
|
-
|
|
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));
|
|
2208
2208
|
};
|
|
2209
|
-
return
|
|
2210
|
-
|
|
2209
|
+
return b.current = setTimeout($, 260), () => {
|
|
2210
|
+
b.current && clearTimeout(b.current);
|
|
2211
2211
|
};
|
|
2212
2212
|
}, [t, s, r, i, a, n]);
|
|
2213
|
-
const
|
|
2213
|
+
const S = ($) => {
|
|
2214
2214
|
if (s.length === 0) return;
|
|
2215
|
-
const O = (
|
|
2216
|
-
|
|
2217
|
-
},
|
|
2218
|
-
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 };
|
|
2219
2219
|
}
|
|
2220
|
-
let
|
|
2221
|
-
function
|
|
2220
|
+
let Is = 0;
|
|
2221
|
+
function zt({
|
|
2222
2222
|
value: s = "",
|
|
2223
2223
|
onChange: t,
|
|
2224
2224
|
onSubmit: r,
|
|
@@ -2227,122 +2227,122 @@ function It({
|
|
|
2227
2227
|
loading: n = !1,
|
|
2228
2228
|
disabled: o = !1,
|
|
2229
2229
|
placeholder: l = "Let's get things done...",
|
|
2230
|
-
animatedPlaceholders:
|
|
2231
|
-
attachments:
|
|
2230
|
+
animatedPlaceholders: m,
|
|
2231
|
+
attachments: d,
|
|
2232
2232
|
images: f,
|
|
2233
|
-
onAttachFiles:
|
|
2233
|
+
onAttachFiles: p,
|
|
2234
2234
|
onAttachImages: h,
|
|
2235
|
-
onRemoveAttachment:
|
|
2236
|
-
onRemoveImage:
|
|
2237
|
-
acceptImage:
|
|
2238
|
-
acceptFile:
|
|
2239
|
-
maxImages:
|
|
2240
|
-
maxImageSize:
|
|
2241
|
-
leftSlot:
|
|
2242
|
-
rightSlot:
|
|
2235
|
+
onRemoveAttachment: u,
|
|
2236
|
+
onRemoveImage: b,
|
|
2237
|
+
acceptImage: j,
|
|
2238
|
+
acceptFile: S,
|
|
2239
|
+
maxImages: R,
|
|
2240
|
+
maxImageSize: B,
|
|
2241
|
+
leftSlot: y,
|
|
2242
|
+
rightSlot: $,
|
|
2243
2243
|
className: O = "",
|
|
2244
|
-
...
|
|
2244
|
+
...I
|
|
2245
2245
|
}) {
|
|
2246
|
-
const
|
|
2247
|
-
const T = ++
|
|
2248
|
-
U((V) => [...V, { id: T, msg:
|
|
2249
|
-
},
|
|
2250
|
-
const T = [], V = [],
|
|
2251
|
-
let ee = 0,
|
|
2252
|
-
for (const se of
|
|
2253
|
-
|
|
2254
|
-
return { imageFiles: T, docFiles: V, tooLarge:
|
|
2255
|
-
}, c = (
|
|
2256
|
-
const { imageFiles: T, docFiles: V, tooLarge:
|
|
2257
|
-
|
|
2258
|
-
const
|
|
2259
|
-
|
|
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);
|
|
2260
2260
|
};
|
|
2261
|
-
|
|
2262
|
-
const
|
|
2263
|
-
|
|
2264
|
-
}, [s]),
|
|
2265
|
-
const
|
|
2266
|
-
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;
|
|
2267
2267
|
if (n || o) return;
|
|
2268
|
-
const V = (
|
|
2269
|
-
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();
|
|
2270
2270
|
};
|
|
2271
|
-
return document.addEventListener("keydown",
|
|
2271
|
+
return document.addEventListener("keydown", _), () => document.removeEventListener("keydown", _);
|
|
2272
2272
|
}, [n, o]);
|
|
2273
|
-
const
|
|
2274
|
-
|
|
2275
|
-
},
|
|
2276
|
-
|
|
2277
|
-
}, F = (
|
|
2278
|
-
|
|
2279
|
-
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);
|
|
2280
2280
|
T.length && c(T);
|
|
2281
|
-
},
|
|
2282
|
-
const T = Array.from(
|
|
2283
|
-
|
|
2284
|
-
}, W = (
|
|
2281
|
+
}, ie = (_) => {
|
|
2282
|
+
const T = Array.from(_.target.files || []);
|
|
2283
|
+
Y.current && (Y.current.value = ""), T.length && c(T);
|
|
2284
|
+
}, W = (_) => {
|
|
2285
2285
|
var se;
|
|
2286
2286
|
if (!h) return;
|
|
2287
|
-
const T = (se =
|
|
2287
|
+
const T = (se = _.clipboardData) == null ? void 0 : se.items;
|
|
2288
2288
|
if (!T) return;
|
|
2289
2289
|
const V = [];
|
|
2290
2290
|
for (const Ue of T) {
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2291
|
+
const Te = Ue.getAsFile();
|
|
2292
|
+
Te && V.push(Te);
|
|
2293
2293
|
}
|
|
2294
2294
|
if (V.length === 0) return;
|
|
2295
|
-
const { imageFiles:
|
|
2296
|
-
|
|
2297
|
-
}, Q = !n && !o && !!(
|
|
2298
|
-
prompts:
|
|
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({
|
|
2298
|
+
prompts: m ?? [],
|
|
2299
2299
|
enabled: Q
|
|
2300
|
-
}),
|
|
2300
|
+
}), be = (_) => {
|
|
2301
2301
|
if (Q) {
|
|
2302
|
-
if (
|
|
2303
|
-
|
|
2302
|
+
if (_.key === "ArrowDown" || _.key === "ArrowRight") {
|
|
2303
|
+
_.preventDefault(), oe.next();
|
|
2304
2304
|
return;
|
|
2305
2305
|
}
|
|
2306
|
-
if (
|
|
2307
|
-
|
|
2306
|
+
if (_.key === "ArrowUp" || _.key === "ArrowLeft") {
|
|
2307
|
+
_.preventDefault(), oe.prev();
|
|
2308
2308
|
return;
|
|
2309
2309
|
}
|
|
2310
|
-
if (
|
|
2311
|
-
|
|
2310
|
+
if (_.key === "Tab" && !_.shiftKey) {
|
|
2311
|
+
_.preventDefault(), t == null || t(oe.currentPrompt);
|
|
2312
2312
|
return;
|
|
2313
2313
|
}
|
|
2314
2314
|
}
|
|
2315
|
-
a == null || a(
|
|
2316
|
-
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (
|
|
2317
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...
|
|
2318
|
-
|
|
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(
|
|
2319
2319
|
"input",
|
|
2320
2320
|
{
|
|
2321
|
-
ref:
|
|
2321
|
+
ref: Y,
|
|
2322
2322
|
type: "file",
|
|
2323
2323
|
multiple: !0,
|
|
2324
2324
|
accept: "*/*",
|
|
2325
2325
|
className: "ds-prompt-input__file-input",
|
|
2326
|
-
onChange:
|
|
2326
|
+
onChange: ie
|
|
2327
2327
|
}
|
|
2328
2328
|
),
|
|
2329
2329
|
/* @__PURE__ */ e.jsxs(
|
|
2330
2330
|
"div",
|
|
2331
2331
|
{
|
|
2332
|
-
className: ["ds-prompt-input__box",
|
|
2333
|
-
onDragEnter:
|
|
2334
|
-
onDragLeave:
|
|
2332
|
+
className: ["ds-prompt-input__box", N && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2333
|
+
onDragEnter: w,
|
|
2334
|
+
onDragLeave: z,
|
|
2335
2335
|
onDragOver: F,
|
|
2336
2336
|
onDrop: te,
|
|
2337
2337
|
children: [
|
|
2338
|
-
|
|
2338
|
+
N && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2339
2339
|
/* @__PURE__ */ e.jsx(
|
|
2340
2340
|
"textarea",
|
|
2341
2341
|
{
|
|
2342
|
-
ref:
|
|
2342
|
+
ref: q,
|
|
2343
2343
|
value: s,
|
|
2344
|
-
onChange: (
|
|
2345
|
-
onKeyDown:
|
|
2344
|
+
onChange: (_) => t == null ? void 0 : t(_.target.value),
|
|
2345
|
+
onKeyDown: be,
|
|
2346
2346
|
onPaste: W,
|
|
2347
2347
|
placeholder: Q ? "" : l,
|
|
2348
2348
|
disabled: n || o,
|
|
@@ -2351,80 +2351,80 @@ function It({
|
|
|
2351
2351
|
}
|
|
2352
2352
|
),
|
|
2353
2353
|
Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
|
|
2354
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children:
|
|
2354
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: oe.displayed }),
|
|
2355
2355
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2356
2356
|
] }),
|
|
2357
|
-
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((
|
|
2358
|
-
/* @__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: "" }),
|
|
2359
2359
|
/* @__PURE__ */ e.jsx(
|
|
2360
2360
|
"button",
|
|
2361
2361
|
{
|
|
2362
2362
|
className: "ds-prompt-input__image-remove",
|
|
2363
|
-
onClick: () =>
|
|
2363
|
+
onClick: () => b == null ? void 0 : b(T),
|
|
2364
2364
|
"aria-label": "Remove image",
|
|
2365
2365
|
type: "button",
|
|
2366
2366
|
children: /* @__PURE__ */ e.jsx(ne, { size: 12, strokeWidth: 2 })
|
|
2367
2367
|
}
|
|
2368
2368
|
)
|
|
2369
2369
|
] }, T)) }),
|
|
2370
|
-
|
|
2371
|
-
/* @__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 }),
|
|
2372
2372
|
/* @__PURE__ */ e.jsx(
|
|
2373
2373
|
"button",
|
|
2374
2374
|
{
|
|
2375
2375
|
type: "button",
|
|
2376
2376
|
className: "ds-prompt-input__warning-close",
|
|
2377
|
-
onClick: () =>
|
|
2377
|
+
onClick: () => v(_.id),
|
|
2378
2378
|
"aria-label": "Dismiss",
|
|
2379
|
-
children: /* @__PURE__ */ e.jsx(ne, { size:
|
|
2379
|
+
children: /* @__PURE__ */ e.jsx(ne, { size: D[1], strokeWidth: 1.5 })
|
|
2380
2380
|
}
|
|
2381
2381
|
)
|
|
2382
|
-
] },
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
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(
|
|
2387
2387
|
"button",
|
|
2388
2388
|
{
|
|
2389
2389
|
type: "button",
|
|
2390
2390
|
className: "ds-prompt-input__remove-btn",
|
|
2391
|
-
onClick: () =>
|
|
2392
|
-
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 })
|
|
2393
2393
|
}
|
|
2394
2394
|
)
|
|
2395
2395
|
] }) }, T)) }),
|
|
2396
2396
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2397
|
-
|
|
2398
|
-
|
|
2397
|
+
$e && /* @__PURE__ */ e.jsx(
|
|
2398
|
+
me,
|
|
2399
2399
|
{
|
|
2400
2400
|
variant: "ghost",
|
|
2401
2401
|
size: "xs",
|
|
2402
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2402
|
+
icon: /* @__PURE__ */ e.jsx(Re, { size: D[2], strokeWidth: 1.5 }),
|
|
2403
2403
|
"aria-label": "Attach files",
|
|
2404
2404
|
onClick: () => {
|
|
2405
|
-
var
|
|
2406
|
-
return (
|
|
2405
|
+
var _;
|
|
2406
|
+
return (_ = Y.current) == null ? void 0 : _.click();
|
|
2407
2407
|
}
|
|
2408
2408
|
}
|
|
2409
2409
|
),
|
|
2410
|
-
|
|
2411
|
-
|
|
2410
|
+
y,
|
|
2411
|
+
$,
|
|
2412
2412
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2413
2413
|
n ? /* @__PURE__ */ e.jsx(
|
|
2414
|
-
|
|
2414
|
+
me,
|
|
2415
2415
|
{
|
|
2416
2416
|
variant: "primary",
|
|
2417
2417
|
size: "xs",
|
|
2418
|
-
icon: /* @__PURE__ */ e.jsx(es, { size:
|
|
2418
|
+
icon: /* @__PURE__ */ e.jsx(es, { size: D[2], strokeWidth: 1.5 }),
|
|
2419
2419
|
onClick: i,
|
|
2420
2420
|
"aria-label": "Stop"
|
|
2421
2421
|
}
|
|
2422
2422
|
) : /* @__PURE__ */ e.jsx(
|
|
2423
|
-
|
|
2423
|
+
me,
|
|
2424
2424
|
{
|
|
2425
2425
|
variant: "primary",
|
|
2426
2426
|
size: "xs",
|
|
2427
|
-
icon: /* @__PURE__ */ e.jsx(ss, { size:
|
|
2427
|
+
icon: /* @__PURE__ */ e.jsx(ss, { size: D[2], strokeWidth: 1.5 }),
|
|
2428
2428
|
onClick: r,
|
|
2429
2429
|
disabled: !Ce,
|
|
2430
2430
|
"aria-label": "Send"
|
|
@@ -2436,8 +2436,8 @@ function It({
|
|
|
2436
2436
|
)
|
|
2437
2437
|
] });
|
|
2438
2438
|
}
|
|
2439
|
-
const Pe = { fast: 0, standard: 1, premium: 2 };
|
|
2440
|
-
function
|
|
2439
|
+
const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
2440
|
+
function Ot({
|
|
2441
2441
|
models: s = [],
|
|
2442
2442
|
value: t,
|
|
2443
2443
|
onChange: r,
|
|
@@ -2446,54 +2446,59 @@ function Dt({
|
|
|
2446
2446
|
showAutoOption: n = !1,
|
|
2447
2447
|
groupByTier: o = !0,
|
|
2448
2448
|
className: l = "",
|
|
2449
|
-
...
|
|
2449
|
+
...m
|
|
2450
2450
|
}) {
|
|
2451
|
-
const [
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
}, z = (H) => {
|
|
2466
|
-
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
|
+
});
|
|
2467
2465
|
};
|
|
2468
|
-
|
|
2469
|
-
|
|
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);
|
|
2470
2472
|
};
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
},
|
|
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(
|
|
2475
2480
|
"button",
|
|
2476
2481
|
{
|
|
2477
2482
|
type: "button",
|
|
2478
2483
|
className: [
|
|
2479
2484
|
"ds-model-picker__item",
|
|
2480
|
-
|
|
2485
|
+
N.name === t && "ds-model-picker__item--active"
|
|
2481
2486
|
].filter(Boolean).join(" "),
|
|
2482
|
-
onClick: () =>
|
|
2487
|
+
onClick: () => I(N.name),
|
|
2483
2488
|
children: [
|
|
2484
|
-
|
|
2485
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
2486
|
-
|
|
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 })
|
|
2487
2492
|
]
|
|
2488
2493
|
},
|
|
2489
|
-
|
|
2490
|
-
),
|
|
2491
|
-
const
|
|
2492
|
-
return
|
|
2493
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
2494
|
-
...
|
|
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)
|
|
2495
2500
|
] : [];
|
|
2496
|
-
})
|
|
2501
|
+
}), P = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu", style: b, children: [
|
|
2497
2502
|
n && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2498
2503
|
/* @__PURE__ */ e.jsxs(
|
|
2499
2504
|
"button",
|
|
@@ -2504,130 +2509,132 @@ function Dt({
|
|
|
2504
2509
|
"ds-model-picker__item--auto",
|
|
2505
2510
|
t === "auto" && "ds-model-picker__item--active"
|
|
2506
2511
|
].filter(Boolean).join(" "),
|
|
2507
|
-
onClick: () =>
|
|
2512
|
+
onClick: () => I("auto"),
|
|
2508
2513
|
children: [
|
|
2509
2514
|
/* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2510
2515
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
2511
2516
|
]
|
|
2512
2517
|
}
|
|
2513
2518
|
),
|
|
2514
|
-
|
|
2519
|
+
B.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
2515
2520
|
] }),
|
|
2516
|
-
|
|
2521
|
+
q()
|
|
2517
2522
|
] });
|
|
2518
2523
|
return /* @__PURE__ */ e.jsxs(
|
|
2519
2524
|
"div",
|
|
2520
2525
|
{
|
|
2521
|
-
ref:
|
|
2526
|
+
ref: p,
|
|
2522
2527
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2523
|
-
...
|
|
2528
|
+
...m,
|
|
2524
2529
|
children: [
|
|
2525
2530
|
/* @__PURE__ */ e.jsxs(
|
|
2526
2531
|
"button",
|
|
2527
2532
|
{
|
|
2533
|
+
ref: h,
|
|
2528
2534
|
type: "button",
|
|
2529
2535
|
className: "ds-model-picker__trigger",
|
|
2530
|
-
onClick: () => f((
|
|
2536
|
+
onClick: () => f((N) => !N),
|
|
2531
2537
|
"aria-haspopup": "listbox",
|
|
2532
|
-
"aria-expanded":
|
|
2538
|
+
"aria-expanded": d,
|
|
2533
2539
|
children: [
|
|
2534
|
-
|
|
2535
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (
|
|
2536
|
-
(
|
|
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 })
|
|
2537
2543
|
]
|
|
2538
2544
|
}
|
|
2539
2545
|
),
|
|
2540
|
-
typeof document < "u" &&
|
|
2546
|
+
typeof document < "u" && pe.createPortal(P, document.body)
|
|
2541
2547
|
]
|
|
2542
2548
|
}
|
|
2543
2549
|
);
|
|
2544
2550
|
}
|
|
2545
|
-
|
|
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) {
|
|
2546
2556
|
return s != null && s.length ? "p. " + s.join(", ") : null;
|
|
2547
2557
|
}
|
|
2548
|
-
function
|
|
2558
|
+
function Ms(s) {
|
|
2549
2559
|
const t = /* @__PURE__ */ new Map();
|
|
2550
2560
|
for (const r of s)
|
|
2551
2561
|
t.has(r.filename) || t.set(r.filename, { filename: r.filename, url: r.url, items: [] }), t.get(r.filename).items.push(r);
|
|
2552
2562
|
return [...t.values()];
|
|
2553
2563
|
}
|
|
2554
|
-
function
|
|
2564
|
+
function Ft({
|
|
2555
2565
|
sources: s = [],
|
|
2556
2566
|
layout: t = "list",
|
|
2557
2567
|
title: r = "Sources",
|
|
2558
2568
|
maxVisible: i = 5,
|
|
2559
2569
|
onSourceClick: a
|
|
2560
2570
|
}) {
|
|
2561
|
-
const [n, o] =
|
|
2562
|
-
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className:
|
|
2563
|
-
|
|
2564
|
-
const
|
|
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(" ");
|
|
2572
|
+
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2573
|
+
d.map((h) => {
|
|
2574
|
+
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2565
2575
|
return /* @__PURE__ */ e.jsxs(
|
|
2566
2576
|
"div",
|
|
2567
2577
|
{
|
|
2568
|
-
className: `ds-sources-panel__compact-row${
|
|
2569
|
-
onClick:
|
|
2578
|
+
className: `ds-sources-panel__compact-row${b ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2579
|
+
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2570
2580
|
children: [
|
|
2571
|
-
/* @__PURE__ */ e.jsx(rs, { size:
|
|
2581
|
+
/* @__PURE__ */ e.jsx(rs, { size: D[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2572
2582
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2573
|
-
|
|
2583
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2574
2584
|
]
|
|
2575
2585
|
},
|
|
2576
2586
|
h.filename
|
|
2577
2587
|
);
|
|
2578
2588
|
}),
|
|
2579
|
-
|
|
2589
|
+
m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2580
2590
|
"+",
|
|
2581
2591
|
l.length - i,
|
|
2582
2592
|
" more sources"
|
|
2583
2593
|
] })
|
|
2584
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2594
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2585
2595
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: r }),
|
|
2586
|
-
|
|
2587
|
-
const
|
|
2596
|
+
d.map((h) => {
|
|
2597
|
+
const u = h.items.map((j) => j.page).filter(Boolean), b = !!a;
|
|
2588
2598
|
return f ? /* @__PURE__ */ e.jsx(
|
|
2589
|
-
|
|
2599
|
+
Ee,
|
|
2590
2600
|
{
|
|
2591
|
-
title: /* @__PURE__ */ e.
|
|
2592
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2593
|
-
d.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: je(d) })
|
|
2594
|
-
] }),
|
|
2601
|
+
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: u }),
|
|
2595
2602
|
padding: "s",
|
|
2596
|
-
children: h.items.map((
|
|
2603
|
+
children: h.items.map((j, S) => /* @__PURE__ */ e.jsx(
|
|
2597
2604
|
"div",
|
|
2598
2605
|
{
|
|
2599
|
-
className: `ds-sources-panel__snippet${
|
|
2600
|
-
onClick:
|
|
2601
|
-
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}`
|
|
2602
2609
|
},
|
|
2603
|
-
|
|
2610
|
+
S
|
|
2604
2611
|
))
|
|
2605
2612
|
},
|
|
2606
2613
|
h.filename
|
|
2607
2614
|
) : /* @__PURE__ */ e.jsxs(
|
|
2608
2615
|
"div",
|
|
2609
2616
|
{
|
|
2610
|
-
className: `ds-sources-panel__row${
|
|
2611
|
-
onClick:
|
|
2617
|
+
className: `ds-sources-panel__row${b ? " ds-sources-panel__row--clickable" : ""}`,
|
|
2618
|
+
onClick: b ? () => a(h.items[0]) : void 0,
|
|
2612
2619
|
children: [
|
|
2613
2620
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2614
|
-
|
|
2621
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ne(u) })
|
|
2615
2622
|
]
|
|
2616
2623
|
},
|
|
2617
2624
|
h.filename
|
|
2618
2625
|
);
|
|
2619
2626
|
}),
|
|
2620
|
-
|
|
2627
|
+
m && !n && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2621
2628
|
"+",
|
|
2622
2629
|
l.length - i,
|
|
2623
2630
|
" more sources"
|
|
2624
2631
|
] })
|
|
2625
2632
|
] });
|
|
2626
2633
|
}
|
|
2627
|
-
function
|
|
2634
|
+
function ze(s) {
|
|
2628
2635
|
return s >= 1e6 ? (s / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : s >= 1e3 ? (s / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(s);
|
|
2629
2636
|
}
|
|
2630
|
-
function
|
|
2637
|
+
function Wt({
|
|
2631
2638
|
used: s,
|
|
2632
2639
|
limit: t,
|
|
2633
2640
|
size: r = "s",
|
|
@@ -2636,7 +2643,7 @@ function Pt({
|
|
|
2636
2643
|
warningThreshold: n = 0.8,
|
|
2637
2644
|
errorThreshold: o = 1
|
|
2638
2645
|
}) {
|
|
2639
|
-
const l = t > 0 ? s / t : 0,
|
|
2646
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >= n ? "warning" : "normal";
|
|
2640
2647
|
return /* @__PURE__ */ e.jsxs(
|
|
2641
2648
|
"div",
|
|
2642
2649
|
{
|
|
@@ -2648,15 +2655,15 @@ function Pt({
|
|
|
2648
2655
|
/* @__PURE__ */ e.jsx("div", { className: "ds-token-counter__track", children: /* @__PURE__ */ e.jsx(
|
|
2649
2656
|
"div",
|
|
2650
2657
|
{
|
|
2651
|
-
className: `ds-token-counter__fill ds-token-counter__fill--${
|
|
2652
|
-
style: { width: `${
|
|
2658
|
+
className: `ds-token-counter__fill ds-token-counter__fill--${d}`,
|
|
2659
|
+
style: { width: `${m}%` }
|
|
2653
2660
|
}
|
|
2654
2661
|
) }),
|
|
2655
|
-
(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: [
|
|
2656
2663
|
i && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
2657
|
-
|
|
2664
|
+
ze(s),
|
|
2658
2665
|
" / ",
|
|
2659
|
-
|
|
2666
|
+
ze(t),
|
|
2660
2667
|
" tokens"
|
|
2661
2668
|
] }),
|
|
2662
2669
|
a && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
@@ -2668,42 +2675,42 @@ function Pt({
|
|
|
2668
2675
|
}
|
|
2669
2676
|
);
|
|
2670
2677
|
}
|
|
2671
|
-
const
|
|
2672
|
-
function
|
|
2678
|
+
const Oe = 5;
|
|
2679
|
+
function Ps(s) {
|
|
2673
2680
|
return s < 0.34 ? "low" : s < 0.67 ? "medium" : "high";
|
|
2674
2681
|
}
|
|
2675
|
-
function
|
|
2682
|
+
function Ct({
|
|
2676
2683
|
value: s = 0,
|
|
2677
2684
|
size: t = "xs",
|
|
2678
2685
|
showLabel: r = "none",
|
|
2679
2686
|
layout: i = "inline"
|
|
2680
2687
|
}) {
|
|
2681
|
-
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);
|
|
2682
2689
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2683
2690
|
"ds-confidence-bar",
|
|
2684
2691
|
`ds-confidence-bar--${t}`,
|
|
2685
2692
|
`ds-confidence-bar--${o}`,
|
|
2686
2693
|
i === "block" && "ds-confidence-bar--block"
|
|
2687
2694
|
].filter(Boolean).join(" "), children: [
|
|
2688
|
-
/* @__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(
|
|
2689
2696
|
"div",
|
|
2690
2697
|
{
|
|
2691
|
-
className: `ds-confidence-bar__seg${
|
|
2698
|
+
className: `ds-confidence-bar__seg${m < n ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2692
2699
|
},
|
|
2693
|
-
|
|
2700
|
+
m
|
|
2694
2701
|
)) }),
|
|
2695
2702
|
r === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
|
|
2696
2703
|
] });
|
|
2697
2704
|
}
|
|
2698
|
-
const
|
|
2699
|
-
function
|
|
2705
|
+
const Ls = { add: "+", remove: "-", context: " " };
|
|
2706
|
+
function _e({ line: s, lineNumbers: t }) {
|
|
2700
2707
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
|
|
2701
2708
|
t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
|
|
2702
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children:
|
|
2709
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Ls[s.type] }),
|
|
2703
2710
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: s.text })
|
|
2704
2711
|
] });
|
|
2705
2712
|
}
|
|
2706
|
-
function
|
|
2713
|
+
function Ut({
|
|
2707
2714
|
lines: s = [],
|
|
2708
2715
|
layout: t = "inline",
|
|
2709
2716
|
wordWrap: r = !1,
|
|
@@ -2717,88 +2724,216 @@ function Lt({
|
|
|
2717
2724
|
r && "ds-diff-view--wrap"
|
|
2718
2725
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2719
2726
|
if (t === "split") {
|
|
2720
|
-
const
|
|
2727
|
+
const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2721
2728
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2722
2729
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2723
2730
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2724
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children:
|
|
2725
|
-
/* @__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)) })
|
|
2726
2733
|
] })
|
|
2727
2734
|
] });
|
|
2728
2735
|
}
|
|
2729
2736
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2730
2737
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: n }),
|
|
2731
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((
|
|
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)) })
|
|
2732
2739
|
] });
|
|
2733
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
|
+
}
|
|
2734
2866
|
export {
|
|
2735
|
-
|
|
2736
|
-
|
|
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
|
-
|
|
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,
|
|
2764
2898
|
Ie as ModalFooter,
|
|
2765
|
-
|
|
2766
|
-
|
|
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
|
-
|
|
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
|
|
2804
2939
|
};
|