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