@donkit-ai/design-system 1.4.62 → 1.4.63
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 +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +700 -699
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Y, { useState as I, useRef as T, useEffect as D, useLayoutEffect as Ze, useContext as je, forwardRef as Qe, createContext as et, useCallback as $e } from "react";
|
|
2
2
|
import { Check as Te, X as ee, ChevronDown as ve, Minus as tt, Plus as st, XCircle as Re, AlertTriangle as Se, CheckCircle as Ae, Info as Ie, ChevronUp as nt, ChevronsUpDown as rt, ChevronLeft as at, ChevronRight as ot, Copy as it, Brain as lt, Loader as ct, Paperclip as Me, Square as dt, ArrowUp as ut, Zap as ft, Cpu as ze, FileText as mt, ThumbsUp as pt, ThumbsDown as ht } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const P = {
|
|
@@ -56,38 +56,38 @@ function vt() {
|
|
|
56
56
|
function t(f) {
|
|
57
57
|
if (f == null) return null;
|
|
58
58
|
if (typeof f == "function")
|
|
59
|
-
return f.$$typeof ===
|
|
59
|
+
return f.$$typeof === M ? null : f.displayName || f.name || null;
|
|
60
60
|
if (typeof f == "string") return f;
|
|
61
61
|
switch (f) {
|
|
62
|
-
case
|
|
62
|
+
case j:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case g:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case E:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case C:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case
|
|
70
|
+
case U:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case w:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof f == "object")
|
|
76
76
|
switch (typeof f.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), f.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case v:
|
|
80
80
|
return "Portal";
|
|
81
81
|
case S:
|
|
82
82
|
return f.displayName || "Context";
|
|
83
|
-
case
|
|
83
|
+
case b:
|
|
84
84
|
return (f._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case
|
|
85
|
+
case L:
|
|
86
86
|
var $ = f.render;
|
|
87
87
|
return f = f.displayName, f || (f = $.displayName || $.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
|
|
88
|
-
case
|
|
88
|
+
case K:
|
|
89
89
|
return $ = f.displayName || null, $ !== null ? $ : t(f.type) || "Memo";
|
|
90
|
-
case
|
|
90
|
+
case V:
|
|
91
91
|
$ = f._payload, f = f._init;
|
|
92
92
|
try {
|
|
93
93
|
return t(f($));
|
|
@@ -108,17 +108,17 @@ function vt() {
|
|
|
108
108
|
}
|
|
109
109
|
if ($) {
|
|
110
110
|
$ = console;
|
|
111
|
-
var z = $.error,
|
|
111
|
+
var z = $.error, W = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
|
|
112
112
|
return z.call(
|
|
113
113
|
$,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
|
-
|
|
115
|
+
W
|
|
116
116
|
), s(f);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function a(f) {
|
|
120
|
-
if (f ===
|
|
121
|
-
if (typeof f == "object" && f !== null && f.$$typeof ===
|
|
120
|
+
if (f === j) return "<>";
|
|
121
|
+
if (typeof f == "object" && f !== null && f.$$typeof === V)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
124
|
var $ = t(f);
|
|
@@ -128,14 +128,14 @@ function vt() {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function o() {
|
|
131
|
-
var f =
|
|
131
|
+
var f = G.A;
|
|
132
132
|
return f === null ? null : f.getOwner();
|
|
133
133
|
}
|
|
134
134
|
function r() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(f) {
|
|
138
|
-
if (
|
|
138
|
+
if (F.call(f, "key")) {
|
|
139
139
|
var $ = Object.getOwnPropertyDescriptor(f, "key").get;
|
|
140
140
|
if ($ && $.isReactWarning) return !1;
|
|
141
141
|
}
|
|
@@ -143,7 +143,7 @@ function vt() {
|
|
|
143
143
|
}
|
|
144
144
|
function l(f, $) {
|
|
145
145
|
function z() {
|
|
146
|
-
|
|
146
|
+
y || (y = !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
|
$
|
|
149
149
|
));
|
|
@@ -153,23 +153,23 @@ function vt() {
|
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function d() {
|
|
157
157
|
var f = t(this.type);
|
|
158
|
-
return
|
|
158
|
+
return R[f] || (R[f] = !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
|
)), f = this.props.ref, f !== void 0 ? f : null;
|
|
161
161
|
}
|
|
162
|
-
function c(f, $, z,
|
|
163
|
-
var
|
|
162
|
+
function c(f, $, z, W, ne, oe) {
|
|
163
|
+
var q = z.ref;
|
|
164
164
|
return f = {
|
|
165
|
-
$$typeof:
|
|
165
|
+
$$typeof: x,
|
|
166
166
|
type: f,
|
|
167
167
|
key: $,
|
|
168
168
|
props: z,
|
|
169
|
-
_owner:
|
|
170
|
-
}, (
|
|
169
|
+
_owner: W
|
|
170
|
+
}, (q !== void 0 ? q : null) !== null ? Object.defineProperty(f, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
|
-
get:
|
|
172
|
+
get: d
|
|
173
173
|
}) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
@@ -192,48 +192,48 @@ function vt() {
|
|
|
192
192
|
value: oe
|
|
193
193
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
194
194
|
}
|
|
195
|
-
function m(f, $, z,
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
200
|
-
for (
|
|
201
|
-
p(
|
|
202
|
-
Object.freeze && Object.freeze(
|
|
195
|
+
function m(f, $, z, W, ne, oe) {
|
|
196
|
+
var q = $.children;
|
|
197
|
+
if (q !== void 0)
|
|
198
|
+
if (W)
|
|
199
|
+
if (A(q)) {
|
|
200
|
+
for (W = 0; W < q.length; W++)
|
|
201
|
+
p(q[W]);
|
|
202
|
+
Object.freeze && Object.freeze(q);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
|
-
else p(
|
|
208
|
-
if (
|
|
209
|
-
|
|
207
|
+
else p(q);
|
|
208
|
+
if (F.call($, "key")) {
|
|
209
|
+
q = t(f);
|
|
210
210
|
var Q = Object.keys($).filter(function(Ne) {
|
|
211
211
|
return Ne !== "key";
|
|
212
212
|
});
|
|
213
|
-
|
|
213
|
+
W = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", k[q + W] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
215
215
|
let props = %s;
|
|
216
216
|
<%s {...props} />
|
|
217
217
|
React keys must be passed directly to JSX without using spread:
|
|
218
218
|
let props = %s;
|
|
219
219
|
<%s key={someKey} {...props} />`,
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
W,
|
|
221
|
+
q,
|
|
222
222
|
Q,
|
|
223
|
-
|
|
224
|
-
),
|
|
223
|
+
q
|
|
224
|
+
), k[q + W] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (
|
|
226
|
+
if (q = null, z !== void 0 && (n(z), q = "" + z), i($) && (n($.key), q = "" + $.key), "key" in $) {
|
|
227
227
|
z = {};
|
|
228
228
|
for (var ie in $)
|
|
229
229
|
ie !== "key" && (z[ie] = $[ie]);
|
|
230
230
|
} else z = $;
|
|
231
|
-
return
|
|
231
|
+
return q && l(
|
|
232
232
|
z,
|
|
233
233
|
typeof f == "function" ? f.displayName || f.name || "Unknown" : f
|
|
234
234
|
), c(
|
|
235
235
|
f,
|
|
236
|
-
|
|
236
|
+
q,
|
|
237
237
|
z,
|
|
238
238
|
o(),
|
|
239
239
|
ne,
|
|
@@ -241,42 +241,42 @@ React keys must be passed directly to JSX without using spread:
|
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(f) {
|
|
244
|
-
h(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof ===
|
|
244
|
+
h(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === V && (f._payload.status === "fulfilled" ? h(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(f) {
|
|
247
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
247
|
+
return typeof f == "object" && f !== null && f.$$typeof === x;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var u = Y, x = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), j = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), S = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), V = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), M = Symbol.for("react.client.reference"), G = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, A = Array.isArray, _ = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
u = {
|
|
253
253
|
react_stack_bottom_frame: function(f) {
|
|
254
254
|
return f();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
258
|
-
|
|
257
|
+
var y, R = {}, O = u.react_stack_bottom_frame.bind(
|
|
258
|
+
u,
|
|
259
259
|
r
|
|
260
|
-
)(),
|
|
261
|
-
xe.Fragment =
|
|
262
|
-
var
|
|
260
|
+
)(), H = _(a(r)), k = {};
|
|
261
|
+
xe.Fragment = j, xe.jsx = function(f, $, z) {
|
|
262
|
+
var W = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return m(
|
|
264
264
|
f,
|
|
265
265
|
$,
|
|
266
266
|
z,
|
|
267
267
|
!1,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
W ? Error("react-stack-top-frame") : O,
|
|
269
|
+
W ? _(a(f)) : H
|
|
270
270
|
);
|
|
271
271
|
}, xe.jsxs = function(f, $, z) {
|
|
272
|
-
var
|
|
272
|
+
var W = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return m(
|
|
274
274
|
f,
|
|
275
275
|
$,
|
|
276
276
|
z,
|
|
277
277
|
!0,
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
W ? Error("react-stack-top-frame") : O,
|
|
279
|
+
W ? _(a(f)) : H
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), xe;
|
|
@@ -304,58 +304,58 @@ function ae({
|
|
|
304
304
|
disabled: r = !1,
|
|
305
305
|
state: i = "idle",
|
|
306
306
|
onClick: l,
|
|
307
|
-
type:
|
|
307
|
+
type: d = "button",
|
|
308
308
|
href: c,
|
|
309
309
|
"aria-label": m,
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const
|
|
313
|
+
const u = o && !t, x = i === "loading", v = i === "success", j = i === "error", E = x || v || j, g = n === "xs" ? "s" : "m", b = s === "danger" ? "on-accent" : "default", S = bt[n] ?? 16, L = x ? /* @__PURE__ */ e.jsx(_t, { size: g, color: b }) : v ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Te, { size: S, strokeWidth: 2.5 }) }) : j ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(ee, { size: S, strokeWidth: 2.5 }) }) : null, C = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${s}`,
|
|
316
316
|
`ds-button--${n}`,
|
|
317
317
|
a && "ds-button--full",
|
|
318
|
-
|
|
318
|
+
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
321
|
-
|
|
320
|
+
].filter(Boolean).join(" "), U = i !== "idle" ? i : void 0, K = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
|
+
E ? L : o && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: o }),
|
|
322
322
|
t
|
|
323
323
|
] });
|
|
324
324
|
if (c) {
|
|
325
|
-
const
|
|
326
|
-
if (r ||
|
|
327
|
-
|
|
325
|
+
const V = (w) => {
|
|
326
|
+
if (r || x) {
|
|
327
|
+
w.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
w.metaKey || w.ctrlKey || w.button === 1 || (w.preventDefault(), l == null || l(w));
|
|
331
331
|
};
|
|
332
332
|
return /* @__PURE__ */ e.jsx(
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
|
-
className:
|
|
336
|
-
href: r ||
|
|
337
|
-
onClick:
|
|
335
|
+
className: C,
|
|
336
|
+
href: r || x ? void 0 : c,
|
|
337
|
+
onClick: V,
|
|
338
338
|
"aria-label": m,
|
|
339
|
-
"aria-disabled": r ||
|
|
340
|
-
"aria-busy":
|
|
341
|
-
"data-state":
|
|
339
|
+
"aria-disabled": r || x ? "true" : void 0,
|
|
340
|
+
"aria-busy": x ? "true" : void 0,
|
|
341
|
+
"data-state": U,
|
|
342
342
|
...h,
|
|
343
|
-
children:
|
|
343
|
+
children: K
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
return /* @__PURE__ */ e.jsx(
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
|
-
type:
|
|
351
|
-
className:
|
|
350
|
+
type: d,
|
|
351
|
+
className: C,
|
|
352
352
|
disabled: r,
|
|
353
|
-
onClick:
|
|
353
|
+
onClick: x ? void 0 : l,
|
|
354
354
|
"aria-label": m,
|
|
355
|
-
"aria-busy":
|
|
356
|
-
"data-state":
|
|
355
|
+
"aria-busy": x ? "true" : void 0,
|
|
356
|
+
"data-state": U,
|
|
357
357
|
...h,
|
|
358
|
-
children:
|
|
358
|
+
children: K
|
|
359
359
|
}
|
|
360
360
|
);
|
|
361
361
|
}
|
|
@@ -368,12 +368,12 @@ function is({
|
|
|
368
368
|
iconRight: r,
|
|
369
369
|
onIconRightClick: i,
|
|
370
370
|
size: l = "m",
|
|
371
|
-
disabled:
|
|
371
|
+
disabled: d,
|
|
372
372
|
id: c,
|
|
373
373
|
...m
|
|
374
374
|
}) {
|
|
375
|
-
const p = c || `input-${
|
|
376
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${a ? "ds-input-wrapper--full" : ""} ${
|
|
375
|
+
const p = c || `input-${Y.useId()}`, h = n ? `${p}-hint` : void 0, u = s ? `${p}-error` : void 0, x = u || h;
|
|
376
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${a ? "ds-input-wrapper--full" : ""} ${d ? "ds-input-wrapper--disabled" : ""} ${s ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
377
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: t }),
|
|
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 }),
|
|
@@ -382,9 +382,9 @@ function is({
|
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
384
|
className: `ds-input ds-input--${l} ${o ? "ds-input--with-icon" : ""} ${r ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
|
|
385
|
-
disabled:
|
|
385
|
+
disabled: d,
|
|
386
386
|
"aria-invalid": s ? "true" : "false",
|
|
387
|
-
"aria-describedby":
|
|
387
|
+
"aria-describedby": x,
|
|
388
388
|
...m
|
|
389
389
|
}
|
|
390
390
|
),
|
|
@@ -401,7 +401,7 @@ function is({
|
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
403
403
|
n && !s && /* @__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: s && /* @__PURE__ */ e.jsx("span", { id:
|
|
404
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id: u, className: "ds-input-error", role: "alert", children: s }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
407
|
function ls({
|
|
@@ -413,10 +413,10 @@ function ls({
|
|
|
413
413
|
disabled: r,
|
|
414
414
|
id: i,
|
|
415
415
|
resize: l = !0,
|
|
416
|
-
rows:
|
|
416
|
+
rows: d = 3,
|
|
417
417
|
...c
|
|
418
418
|
}) {
|
|
419
|
-
const m = i || `textarea-${
|
|
419
|
+
const m = i || `textarea-${Y.useId()}`, p = n ? `${m}-hint` : void 0, h = s ? `${m}-error` : void 0, u = h || p;
|
|
420
420
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${a ? "ds-textarea-wrapper--full" : ""} ${r ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
421
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: m, children: t }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
@@ -426,8 +426,8 @@ function ls({
|
|
|
426
426
|
className: `ds-textarea ds-textarea--${o} ${s ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
427
|
disabled: r,
|
|
428
428
|
"aria-invalid": s ? "true" : "false",
|
|
429
|
-
"aria-describedby":
|
|
430
|
-
rows:
|
|
429
|
+
"aria-describedby": u,
|
|
430
|
+
rows: d,
|
|
431
431
|
...c
|
|
432
432
|
}
|
|
433
433
|
),
|
|
@@ -444,146 +444,146 @@ function cs({
|
|
|
444
444
|
error: r,
|
|
445
445
|
fullWidth: i = !0,
|
|
446
446
|
size: l = "m",
|
|
447
|
-
disabled:
|
|
447
|
+
disabled: d = !1,
|
|
448
448
|
id: c,
|
|
449
449
|
...m
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] =
|
|
452
|
-
|
|
451
|
+
const [p, h] = I(!1), [u, x] = I(!1), [v, j] = I({}), [E, g] = I("down"), [b, S] = I(-1), L = T(null), C = T(null), U = T(null), K = T(null), V = c || `select-${Y.useId()}`, w = `${V}-label`, M = r ? `${V}-error` : void 0, G = 150, F = (k = !1) => {
|
|
452
|
+
u || (x(!0), S(-1), K.current = setTimeout(() => {
|
|
453
453
|
var f;
|
|
454
|
-
h(!1),
|
|
455
|
-
},
|
|
456
|
-
},
|
|
457
|
-
clearTimeout(
|
|
458
|
-
const f =
|
|
454
|
+
h(!1), x(!1), k && ((f = U.current) == null || f.focus());
|
|
455
|
+
}, G));
|
|
456
|
+
}, A = (k) => {
|
|
457
|
+
clearTimeout(K.current), x(!1);
|
|
458
|
+
const f = k !== void 0 ? k : Math.max(a.findIndex(($) => $.value === s), 0);
|
|
459
459
|
S(f), h(!0);
|
|
460
460
|
};
|
|
461
|
-
|
|
462
|
-
const
|
|
461
|
+
D(() => () => clearTimeout(K.current), []);
|
|
462
|
+
const _ = () => {
|
|
463
463
|
var oe;
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
466
|
-
const f = window.innerHeight, $ = f -
|
|
467
|
-
|
|
468
|
-
ne ? { bottom: f -
|
|
464
|
+
const k = (oe = L.current) == null ? void 0 : oe.getBoundingClientRect();
|
|
465
|
+
if (!k) return;
|
|
466
|
+
const f = window.innerHeight, $ = f - k.bottom, z = k.top, ne = $ < 300 && z > $;
|
|
467
|
+
g(ne ? "up" : "down"), j(
|
|
468
|
+
ne ? { bottom: f - k.top + 4, left: k.left, width: k.width } : { top: k.bottom + 4, left: k.left, width: k.width }
|
|
469
469
|
);
|
|
470
470
|
};
|
|
471
|
-
|
|
471
|
+
D(() => {
|
|
472
472
|
if (p)
|
|
473
|
-
return
|
|
474
|
-
window.removeEventListener("scroll",
|
|
473
|
+
return _(), window.addEventListener("scroll", _, !0), window.addEventListener("resize", _), () => {
|
|
474
|
+
window.removeEventListener("scroll", _, !0), window.removeEventListener("resize", _);
|
|
475
475
|
};
|
|
476
|
-
}, [p]),
|
|
477
|
-
const
|
|
478
|
-
|
|
476
|
+
}, [p]), D(() => {
|
|
477
|
+
const k = (f) => {
|
|
478
|
+
L.current && !L.current.contains(f.target) && C.current && !C.current.contains(f.target) && F();
|
|
479
479
|
};
|
|
480
|
-
return document.addEventListener("mousedown",
|
|
481
|
-
}, [
|
|
480
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
481
|
+
}, [u]), D(() => {
|
|
482
482
|
var f;
|
|
483
|
-
if (!p ||
|
|
484
|
-
(f =
|
|
485
|
-
}, [
|
|
486
|
-
const
|
|
487
|
-
switch (
|
|
483
|
+
if (!p || b < 0 || !C.current) return;
|
|
484
|
+
(f = C.current.querySelectorAll(".ds-select-option")[b]) == null || f.scrollIntoView({ block: "nearest" });
|
|
485
|
+
}, [b, p]);
|
|
486
|
+
const y = (k) => {
|
|
487
|
+
switch (k.key) {
|
|
488
488
|
case "ArrowDown":
|
|
489
|
-
|
|
489
|
+
k.preventDefault(), p ? S((f) => Math.min(f + 1, a.length - 1)) : A();
|
|
490
490
|
break;
|
|
491
491
|
case "ArrowUp":
|
|
492
|
-
|
|
492
|
+
k.preventDefault(), p ? S((f) => Math.max(f - 1, 0)) : A(a.length - 1);
|
|
493
493
|
break;
|
|
494
494
|
case "Home":
|
|
495
|
-
p && (
|
|
495
|
+
p && (k.preventDefault(), S(0));
|
|
496
496
|
break;
|
|
497
497
|
case "End":
|
|
498
|
-
p && (
|
|
498
|
+
p && (k.preventDefault(), S(a.length - 1));
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
|
|
502
|
+
k.preventDefault(), p ? b >= 0 && (n == null || n(a[b].value), F(!0)) : A();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
|
-
p && (
|
|
505
|
+
p && (k.preventDefault(), F(!0));
|
|
506
506
|
break;
|
|
507
507
|
case "Tab":
|
|
508
|
-
p &&
|
|
508
|
+
p && F(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
},
|
|
511
|
+
}, R = a.find((k) => k.value === s), O = l === "xs" ? P[1] : l === "small" ? P[2] : P[3], H = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
|
-
ref:
|
|
514
|
+
ref: C,
|
|
515
515
|
"data-ds-portal": "",
|
|
516
516
|
role: "listbox",
|
|
517
|
-
"aria-labelledby": t ?
|
|
517
|
+
"aria-labelledby": t ? w : 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--${E}`,
|
|
523
|
+
u && "ds-select-dropdown--closing"
|
|
524
524
|
].filter(Boolean).join(" "),
|
|
525
|
-
style:
|
|
526
|
-
children: a.map((
|
|
525
|
+
style: v,
|
|
526
|
+
children: a.map((k, f) => /* @__PURE__ */ e.jsx(
|
|
527
527
|
"button",
|
|
528
528
|
{
|
|
529
|
-
id: `${
|
|
529
|
+
id: `${V}-opt-${f}`,
|
|
530
530
|
type: "button",
|
|
531
531
|
role: "option",
|
|
532
532
|
tabIndex: -1,
|
|
533
|
-
"aria-selected": s ===
|
|
533
|
+
"aria-selected": s === k.value,
|
|
534
534
|
className: [
|
|
535
535
|
"ds-select-option",
|
|
536
536
|
`ds-select-option--${l}`,
|
|
537
|
-
s ===
|
|
538
|
-
f ===
|
|
537
|
+
s === k.value && "ds-select-option--selected",
|
|
538
|
+
f === b && "ds-select-option--active"
|
|
539
539
|
].filter(Boolean).join(" "),
|
|
540
540
|
onClick: () => {
|
|
541
|
-
n == null || n(
|
|
541
|
+
n == null || n(k.value), F(!0);
|
|
542
542
|
},
|
|
543
|
-
children:
|
|
543
|
+
children: k.label
|
|
544
544
|
},
|
|
545
|
-
|
|
545
|
+
k.value
|
|
546
546
|
))
|
|
547
547
|
}
|
|
548
548
|
);
|
|
549
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${
|
|
550
|
-
t && /* @__PURE__ */ e.jsx("label", { id:
|
|
551
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref:
|
|
549
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${d ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
550
|
+
t && /* @__PURE__ */ e.jsx("label", { id: w, className: "ds-select-label", children: t }),
|
|
551
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: L, children: /* @__PURE__ */ e.jsxs(
|
|
552
552
|
"button",
|
|
553
553
|
{
|
|
554
|
-
ref:
|
|
554
|
+
ref: U,
|
|
555
555
|
type: "button",
|
|
556
|
-
id:
|
|
556
|
+
id: V,
|
|
557
557
|
role: "combobox",
|
|
558
558
|
"aria-haspopup": "listbox",
|
|
559
559
|
"aria-expanded": p,
|
|
560
|
-
"aria-activedescendant": p &&
|
|
561
|
-
"aria-labelledby": t ?
|
|
560
|
+
"aria-activedescendant": p && b >= 0 ? `${V}-opt-${b}` : void 0,
|
|
561
|
+
"aria-labelledby": t ? w : void 0,
|
|
562
562
|
"aria-invalid": r ? "true" : "false",
|
|
563
|
-
"aria-describedby":
|
|
563
|
+
"aria-describedby": M,
|
|
564
564
|
className: `ds-select-trigger ds-select-trigger--${l} ${r ? "ds-select-trigger--error" : ""}`,
|
|
565
565
|
onClick: () => {
|
|
566
|
-
|
|
566
|
+
d || (p ? F() : A());
|
|
567
567
|
},
|
|
568
|
-
onKeyDown:
|
|
569
|
-
disabled:
|
|
568
|
+
onKeyDown: y,
|
|
569
|
+
disabled: d,
|
|
570
570
|
...m,
|
|
571
571
|
children: [
|
|
572
|
-
/* @__PURE__ */ e.jsx("span", { className:
|
|
572
|
+
/* @__PURE__ */ e.jsx("span", { className: R ? "" : "ds-select-placeholder", children: (R == null ? void 0 : R.label) || o }),
|
|
573
573
|
/* @__PURE__ */ e.jsx(
|
|
574
574
|
ve,
|
|
575
575
|
{
|
|
576
|
-
size:
|
|
576
|
+
size: O,
|
|
577
577
|
strokeWidth: 1.5,
|
|
578
|
-
className: `ds-select-icon ${p &&
|
|
578
|
+
className: `ds-select-icon ${p && E === "down" ? "ds-select-icon--open" : ""} ${p && E === "up" ? "ds-select-icon--up" : ""}`,
|
|
579
579
|
"aria-hidden": "true"
|
|
580
580
|
}
|
|
581
581
|
)
|
|
582
582
|
]
|
|
583
583
|
}
|
|
584
584
|
) }),
|
|
585
|
-
r && /* @__PURE__ */ e.jsx("span", { id:
|
|
586
|
-
typeof document < "u" && pe.createPortal(
|
|
585
|
+
r && /* @__PURE__ */ e.jsx("span", { id: M, className: "ds-select-error", role: "alert", children: r }),
|
|
586
|
+
typeof document < "u" && pe.createPortal(H, document.body)
|
|
587
587
|
] });
|
|
588
588
|
}
|
|
589
589
|
function ds({
|
|
@@ -595,42 +595,42 @@ function ds({
|
|
|
595
595
|
step: r = 1,
|
|
596
596
|
size: i = "m",
|
|
597
597
|
disabled: l = !1,
|
|
598
|
-
hint:
|
|
598
|
+
hint: d,
|
|
599
599
|
error: c,
|
|
600
600
|
...m
|
|
601
601
|
}) {
|
|
602
602
|
const p = () => {
|
|
603
603
|
if (l) return;
|
|
604
|
-
const
|
|
605
|
-
n == null || n(
|
|
604
|
+
const E = Math.min(Number(s) + r, o);
|
|
605
|
+
n == null || n(E);
|
|
606
606
|
}, h = () => {
|
|
607
607
|
if (l) return;
|
|
608
|
-
const
|
|
609
|
-
n == null || n(
|
|
610
|
-
},
|
|
608
|
+
const E = Math.max(Number(s) - r, a);
|
|
609
|
+
n == null || n(E);
|
|
610
|
+
}, u = (E) => {
|
|
611
611
|
if (l) return;
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
612
|
+
const g = E.target.value;
|
|
613
|
+
if (g === "") {
|
|
614
614
|
n == null || n(a);
|
|
615
615
|
return;
|
|
616
616
|
}
|
|
617
|
-
const
|
|
618
|
-
if (!isNaN(
|
|
619
|
-
const S = Math.min(Math.max(
|
|
617
|
+
const b = Number(g);
|
|
618
|
+
if (!isNaN(b)) {
|
|
619
|
+
const S = Math.min(Math.max(b, a), o);
|
|
620
620
|
n == null || n(S);
|
|
621
621
|
}
|
|
622
|
-
},
|
|
622
|
+
}, x = [
|
|
623
623
|
"ds-stepper-wrapper",
|
|
624
624
|
l && "ds-stepper-wrapper--disabled",
|
|
625
625
|
c && "ds-stepper-wrapper--error"
|
|
626
|
-
].filter(Boolean).join(" "),
|
|
626
|
+
].filter(Boolean).join(" "), v = [
|
|
627
627
|
"ds-stepper",
|
|
628
628
|
`ds-stepper--${i}`,
|
|
629
629
|
l && "ds-stepper--disabled"
|
|
630
|
-
].filter(Boolean).join(" "),
|
|
631
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
630
|
+
].filter(Boolean).join(" "), j = i === "xs" ? P[1] : i === "small" ? P[2] : P[3];
|
|
631
|
+
return /* @__PURE__ */ e.jsxs("div", { className: x, children: [
|
|
632
632
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
633
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
633
|
+
/* @__PURE__ */ e.jsxs("div", { className: v, children: [
|
|
634
634
|
/* @__PURE__ */ e.jsx(
|
|
635
635
|
"button",
|
|
636
636
|
{
|
|
@@ -639,7 +639,7 @@ function ds({
|
|
|
639
639
|
onClick: h,
|
|
640
640
|
disabled: l || s <= a,
|
|
641
641
|
"aria-label": "Decrease",
|
|
642
|
-
children: /* @__PURE__ */ e.jsx(tt, { size:
|
|
642
|
+
children: /* @__PURE__ */ e.jsx(tt, { size: j, strokeWidth: 1.5 })
|
|
643
643
|
}
|
|
644
644
|
),
|
|
645
645
|
/* @__PURE__ */ e.jsx(
|
|
@@ -648,7 +648,7 @@ function ds({
|
|
|
648
648
|
type: "number",
|
|
649
649
|
className: "ds-stepper-input",
|
|
650
650
|
value: s,
|
|
651
|
-
onChange:
|
|
651
|
+
onChange: u,
|
|
652
652
|
min: a,
|
|
653
653
|
max: o,
|
|
654
654
|
step: r,
|
|
@@ -664,11 +664,11 @@ function ds({
|
|
|
664
664
|
onClick: p,
|
|
665
665
|
disabled: l || s >= o,
|
|
666
666
|
"aria-label": "Increase",
|
|
667
|
-
children: /* @__PURE__ */ e.jsx(st, { size:
|
|
667
|
+
children: /* @__PURE__ */ e.jsx(st, { size: j, strokeWidth: 1.5 })
|
|
668
668
|
}
|
|
669
669
|
)
|
|
670
670
|
] }),
|
|
671
|
-
|
|
671
|
+
d && !c && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-hint", children: d }),
|
|
672
672
|
c && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: c })
|
|
673
673
|
] });
|
|
674
674
|
}
|
|
@@ -689,19 +689,19 @@ function us({
|
|
|
689
689
|
c && "ds-card--interactive"
|
|
690
690
|
].filter(Boolean).join(" ");
|
|
691
691
|
if (r) {
|
|
692
|
-
const
|
|
692
|
+
const u = (x) => {
|
|
693
693
|
if (i) {
|
|
694
|
-
|
|
694
|
+
x.preventDefault();
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
|
-
|
|
697
|
+
x.metaKey || x.ctrlKey || x.button === 1 || (x.preventDefault(), o == null || o(x));
|
|
698
698
|
};
|
|
699
699
|
return /* @__PURE__ */ e.jsx(
|
|
700
700
|
"a",
|
|
701
701
|
{
|
|
702
702
|
className: m,
|
|
703
703
|
href: i ? void 0 : r,
|
|
704
|
-
onClick:
|
|
704
|
+
onClick: u,
|
|
705
705
|
"aria-disabled": i ? "true" : void 0,
|
|
706
706
|
...l,
|
|
707
707
|
children: t
|
|
@@ -764,7 +764,7 @@ const Nt = {
|
|
|
764
764
|
success: Ae,
|
|
765
765
|
warning: Se,
|
|
766
766
|
error: Re
|
|
767
|
-
}, vs =
|
|
767
|
+
}, vs = Y.forwardRef(function({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: n = "info",
|
|
770
770
|
title: a,
|
|
@@ -772,9 +772,9 @@ const Nt = {
|
|
|
772
772
|
role: r,
|
|
773
773
|
...i
|
|
774
774
|
}, l) {
|
|
775
|
-
const
|
|
775
|
+
const d = Nt[n], c = r || (n === "error" ? "alert" : "status");
|
|
776
776
|
return /* @__PURE__ */ e.jsxs("div", { ref: l, className: `ds-alert ds-alert--${n} ${a ? "" : "ds-alert--no-title"}`, role: c, ...i, children: [
|
|
777
|
-
|
|
777
|
+
d && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(d, { size: P[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
779
|
a && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: a }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
@@ -790,7 +790,7 @@ const Nt = {
|
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
793
|
-
}),
|
|
793
|
+
}), wt = 200;
|
|
794
794
|
function _s({
|
|
795
795
|
children: t,
|
|
796
796
|
title: s,
|
|
@@ -800,24 +800,24 @@ function _s({
|
|
|
800
800
|
subHeader: r,
|
|
801
801
|
...i
|
|
802
802
|
}) {
|
|
803
|
-
const l =
|
|
803
|
+
const l = T(null), d = Y.useId(), [c, m] = I(!1), p = () => {
|
|
804
804
|
!n || c || (m(!0), setTimeout(() => {
|
|
805
805
|
m(!1), n();
|
|
806
|
-
},
|
|
806
|
+
}, wt));
|
|
807
807
|
};
|
|
808
|
-
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
},
|
|
812
|
-
var
|
|
813
|
-
const
|
|
814
|
-
l.current && !l.current.contains(
|
|
808
|
+
D(() => {
|
|
809
|
+
const v = (E) => {
|
|
810
|
+
E.key === "Escape" && p();
|
|
811
|
+
}, j = (E) => {
|
|
812
|
+
var b, S, L;
|
|
813
|
+
const g = ((S = (b = E.composedPath) == null ? void 0 : b.call(E)) == null ? void 0 : S[0]) ?? E.target;
|
|
814
|
+
l.current && !l.current.contains(g) && !((L = g.closest) != null && L.call(g, "[data-ds-portal]")) && p();
|
|
815
815
|
};
|
|
816
|
-
return document.addEventListener("keydown",
|
|
817
|
-
document.removeEventListener("keydown",
|
|
816
|
+
return document.addEventListener("keydown", v), document.addEventListener("mousedown", j), () => {
|
|
817
|
+
document.removeEventListener("keydown", v), document.removeEventListener("mousedown", j);
|
|
818
818
|
};
|
|
819
819
|
}, [n, c]);
|
|
820
|
-
const h =
|
|
820
|
+
const h = Y.Children.toArray(t), u = h.find((v) => (v == null ? void 0 : v.type) === fe), x = h.filter((v) => (v == null ? void 0 : v.type) !== fe);
|
|
821
821
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", c && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...i, children: /* @__PURE__ */ e.jsxs(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
@@ -825,7 +825,7 @@ function _s({
|
|
|
825
825
|
ref: l,
|
|
826
826
|
role: "dialog",
|
|
827
827
|
"aria-modal": "true",
|
|
828
|
-
"aria-labelledby": s ?
|
|
828
|
+
"aria-labelledby": s ? d : void 0,
|
|
829
829
|
children: [
|
|
830
830
|
n && /* @__PURE__ */ e.jsx(
|
|
831
831
|
ae,
|
|
@@ -839,19 +839,19 @@ function _s({
|
|
|
839
839
|
}
|
|
840
840
|
),
|
|
841
841
|
(s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
842
|
-
s && /* @__PURE__ */ e.jsx("h3", { id:
|
|
842
|
+
s && /* @__PURE__ */ e.jsx("h3", { id: d, className: "ds-modal__title", children: s }),
|
|
843
843
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: r })
|
|
844
844
|
] }),
|
|
845
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children:
|
|
846
|
-
|
|
845
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: x }),
|
|
846
|
+
u
|
|
847
847
|
]
|
|
848
848
|
}
|
|
849
849
|
) });
|
|
850
850
|
}
|
|
851
851
|
function fe({ children: t }) {
|
|
852
|
-
return !t ||
|
|
852
|
+
return !t || Y.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
|
|
853
853
|
}
|
|
854
|
-
const
|
|
854
|
+
const gt = 320;
|
|
855
855
|
function bs({
|
|
856
856
|
children: t,
|
|
857
857
|
title: s,
|
|
@@ -859,24 +859,24 @@ function bs({
|
|
|
859
859
|
subHeader: a,
|
|
860
860
|
...o
|
|
861
861
|
}) {
|
|
862
|
-
const r =
|
|
863
|
-
!n || l || (
|
|
864
|
-
|
|
865
|
-
},
|
|
862
|
+
const r = T(null), i = Y.useId(), [l, d] = I(!1), c = () => {
|
|
863
|
+
!n || l || (d(!0), setTimeout(() => {
|
|
864
|
+
d(!1), n();
|
|
865
|
+
}, gt));
|
|
866
866
|
};
|
|
867
|
-
|
|
868
|
-
const
|
|
869
|
-
|
|
870
|
-
},
|
|
871
|
-
var
|
|
872
|
-
const
|
|
873
|
-
r.current && !r.current.contains(
|
|
867
|
+
D(() => {
|
|
868
|
+
const u = (v) => {
|
|
869
|
+
v.key === "Escape" && c();
|
|
870
|
+
}, x = (v) => {
|
|
871
|
+
var E, g, b;
|
|
872
|
+
const j = ((g = (E = v.composedPath) == null ? void 0 : E.call(v)) == null ? void 0 : g[0]) ?? v.target;
|
|
873
|
+
r.current && !r.current.contains(j) && !((b = j.closest) != null && b.call(j, "[data-ds-portal]")) && c();
|
|
874
874
|
};
|
|
875
|
-
return document.addEventListener("keydown",
|
|
876
|
-
document.removeEventListener("keydown",
|
|
875
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", x), () => {
|
|
876
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", x);
|
|
877
877
|
};
|
|
878
878
|
}, [n, l]);
|
|
879
|
-
const m =
|
|
879
|
+
const m = Y.Children.toArray(t), p = m.find((u) => (u == null ? void 0 : u.type) === fe), h = m.filter((u) => (u == null ? void 0 : u.type) !== fe);
|
|
880
880
|
return /* @__PURE__ */ e.jsx(
|
|
881
881
|
"div",
|
|
882
882
|
{
|
|
@@ -925,15 +925,15 @@ function yt({
|
|
|
925
925
|
className: i = "",
|
|
926
926
|
...l
|
|
927
927
|
}) {
|
|
928
|
-
const [
|
|
929
|
-
m ? o == null || o(!a) : c((
|
|
930
|
-
},
|
|
928
|
+
const [d, c] = I(n), m = a !== void 0, p = m ? a : d, h = () => {
|
|
929
|
+
m ? o == null || o(!a) : c((x) => !x);
|
|
930
|
+
}, u = [
|
|
931
931
|
"ds-code-accordion",
|
|
932
932
|
`ds-code-accordion--${r}`,
|
|
933
933
|
p && "ds-code-accordion--expanded",
|
|
934
934
|
i
|
|
935
935
|
].filter(Boolean).join(" ");
|
|
936
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
936
|
+
return /* @__PURE__ */ e.jsxs("div", { className: u, ...l, children: [
|
|
937
937
|
/* @__PURE__ */ e.jsxs(
|
|
938
938
|
"button",
|
|
939
939
|
{
|
|
@@ -975,10 +975,10 @@ function Ns({ href: t, children: s, onClick: n, target: a, rel: o, ...r }) {
|
|
|
975
975
|
}
|
|
976
976
|
);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
979
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...a, children:
|
|
978
|
+
function ws({ children: t, size: s = "m", variant: n = "ghost", ...a }) {
|
|
979
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...a, children: Y.Children.map(t, (o) => Y.isValidElement(o) ? Y.cloneElement(o, { size: s, variant: n }) : o) });
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function gs({ children: t, selected: s = !1, onClick: n, size: a = "m", variant: o = "ghost", disabled: r = !1, icon: i, href: l, ...d }) {
|
|
982
982
|
const c = i && !t, m = [
|
|
983
983
|
"ds-tab",
|
|
984
984
|
`ds-tab--${a}`,
|
|
@@ -990,12 +990,12 @@ function ws({ children: t, selected: s = !1, onClick: n, size: a = "m", variant:
|
|
|
990
990
|
t
|
|
991
991
|
] });
|
|
992
992
|
if (l) {
|
|
993
|
-
const h = (
|
|
993
|
+
const h = (u) => {
|
|
994
994
|
if (r) {
|
|
995
|
-
|
|
995
|
+
u.preventDefault();
|
|
996
996
|
return;
|
|
997
997
|
}
|
|
998
|
-
|
|
998
|
+
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), n == null || n(u));
|
|
999
999
|
};
|
|
1000
1000
|
return /* @__PURE__ */ e.jsx(
|
|
1001
1001
|
"a",
|
|
@@ -1006,7 +1006,7 @@ function ws({ children: t, selected: s = !1, onClick: n, size: a = "m", variant:
|
|
|
1006
1006
|
className: m,
|
|
1007
1007
|
href: r ? void 0 : l,
|
|
1008
1008
|
onClick: h,
|
|
1009
|
-
...
|
|
1009
|
+
...d,
|
|
1010
1010
|
children: p
|
|
1011
1011
|
}
|
|
1012
1012
|
);
|
|
@@ -1019,34 +1019,34 @@ function ws({ children: t, selected: s = !1, onClick: n, size: a = "m", variant:
|
|
|
1019
1019
|
className: m,
|
|
1020
1020
|
onClick: n,
|
|
1021
1021
|
disabled: r,
|
|
1022
|
-
...
|
|
1022
|
+
...d,
|
|
1023
1023
|
children: p
|
|
1024
1024
|
}
|
|
1025
1025
|
);
|
|
1026
1026
|
}
|
|
1027
1027
|
function ys({ options: t, value: s, onChange: n, size: a = "m", disabled: o = !1 }) {
|
|
1028
|
-
const r =
|
|
1028
|
+
const r = T(null), i = T(null), [l, d] = I(!1), c = T(!1), m = T(null), p = T(null), h = () => {
|
|
1029
1029
|
if (!r.current) return;
|
|
1030
|
-
const
|
|
1031
|
-
if (!
|
|
1032
|
-
const
|
|
1033
|
-
i.current ? (i.current.style.transition = c.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left =
|
|
1030
|
+
const u = r.current.querySelector(`[data-value="${s}"]`);
|
|
1031
|
+
if (!u) return;
|
|
1032
|
+
const x = r.current.getBoundingClientRect(), v = u.getBoundingClientRect(), j = v.left - x.left, E = v.width;
|
|
1033
|
+
i.current ? (i.current.style.transition = c.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = j + "px", i.current.style.width = E + "px", c.current = !1) : (d(!0), requestAnimationFrame(() => {
|
|
1034
1034
|
if (!i.current || !r.current) return;
|
|
1035
|
-
const
|
|
1036
|
-
if (!
|
|
1037
|
-
const
|
|
1038
|
-
i.current.style.transition = "none", i.current.style.left = S.left -
|
|
1035
|
+
const g = r.current.querySelector(`[data-value="${s}"]`);
|
|
1036
|
+
if (!g) return;
|
|
1037
|
+
const b = r.current.getBoundingClientRect(), S = g.getBoundingClientRect();
|
|
1038
|
+
i.current.style.transition = "none", i.current.style.left = S.left - b.left + "px", i.current.style.width = S.width + "px";
|
|
1039
1039
|
}));
|
|
1040
1040
|
};
|
|
1041
1041
|
return p.current = h, Ze(() => {
|
|
1042
|
-
const
|
|
1043
|
-
m.current = s, c.current = l &&
|
|
1044
|
-
}),
|
|
1042
|
+
const u = m.current !== s;
|
|
1043
|
+
m.current = s, c.current = l && u, h();
|
|
1044
|
+
}), D(() => {
|
|
1045
1045
|
if (!r.current) return;
|
|
1046
|
-
const
|
|
1046
|
+
const u = new ResizeObserver(() => {
|
|
1047
1047
|
c.current = !1, p.current();
|
|
1048
1048
|
});
|
|
1049
|
-
return
|
|
1049
|
+
return u.observe(r.current), () => u.disconnect();
|
|
1050
1050
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
1051
1051
|
"div",
|
|
1052
1052
|
{
|
|
@@ -1066,21 +1066,21 @@ function ys({ options: t, value: s, onChange: n, size: a = "m", disabled: o = !1
|
|
|
1066
1066
|
"aria-hidden": "true"
|
|
1067
1067
|
}
|
|
1068
1068
|
),
|
|
1069
|
-
t.map((
|
|
1069
|
+
t.map((u) => /* @__PURE__ */ e.jsxs(
|
|
1070
1070
|
"button",
|
|
1071
1071
|
{
|
|
1072
1072
|
type: "button",
|
|
1073
|
-
"data-value":
|
|
1074
|
-
className: ["ds-seg__btn", s ===
|
|
1075
|
-
onClick: () => !o && n(
|
|
1076
|
-
"aria-pressed": s ===
|
|
1073
|
+
"data-value": u.value,
|
|
1074
|
+
className: ["ds-seg__btn", s === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1075
|
+
onClick: () => !o && n(u.value),
|
|
1076
|
+
"aria-pressed": s === u.value,
|
|
1077
1077
|
disabled: o,
|
|
1078
1078
|
children: [
|
|
1079
|
-
|
|
1080
|
-
|
|
1079
|
+
u.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: u.icon }),
|
|
1080
|
+
u.label
|
|
1081
1081
|
]
|
|
1082
1082
|
},
|
|
1083
|
-
|
|
1083
|
+
u.value
|
|
1084
1084
|
))
|
|
1085
1085
|
]
|
|
1086
1086
|
}
|
|
@@ -1095,8 +1095,8 @@ function Be({
|
|
|
1095
1095
|
padding: r = "m",
|
|
1096
1096
|
...i
|
|
1097
1097
|
}) {
|
|
1098
|
-
const [l,
|
|
1099
|
-
c ? o == null || o(!a) :
|
|
1098
|
+
const [l, d] = I(n), c = a !== void 0, m = c ? a : l, p = () => {
|
|
1099
|
+
c ? o == null || o(!a) : d((u) => !u);
|
|
1100
1100
|
}, h = [
|
|
1101
1101
|
"ds-accordion",
|
|
1102
1102
|
`ds-accordion--${r}`,
|
|
@@ -1159,37 +1159,37 @@ function Et(t, s, n) {
|
|
|
1159
1159
|
return r === t.top ? "top" : r === o - t.bottom ? "bottom" : r === a - t.right ? "right" : "left";
|
|
1160
1160
|
}
|
|
1161
1161
|
function De({ children: t, content: s, position: n, ...a }) {
|
|
1162
|
-
const [o, r] =
|
|
1162
|
+
const [o, r] = I(!1), [i, l] = I({ visibility: "hidden" }), [d, c] = I(n || "top"), m = T(null), p = T(null), h = T(!1), u = () => {
|
|
1163
1163
|
if (!m.current || !p.current) return;
|
|
1164
|
-
const
|
|
1165
|
-
c(
|
|
1164
|
+
const v = m.current.getBoundingClientRect(), j = p.current.getBoundingClientRect(), E = n || Et(v, j.height, j.width), { top: g, left: b, arrowOffset: S } = kt(E, v, j);
|
|
1165
|
+
c(E), l({
|
|
1166
1166
|
position: "fixed",
|
|
1167
|
-
top:
|
|
1168
|
-
left:
|
|
1167
|
+
top: g,
|
|
1168
|
+
left: b,
|
|
1169
1169
|
visibility: "visible",
|
|
1170
1170
|
"--arrow-offset": `${S}px`
|
|
1171
1171
|
});
|
|
1172
1172
|
};
|
|
1173
|
-
if (
|
|
1173
|
+
if (D(() => {
|
|
1174
1174
|
if (!o) return;
|
|
1175
1175
|
l({ position: "fixed", visibility: "hidden" });
|
|
1176
|
-
const
|
|
1177
|
-
return window.addEventListener("scroll",
|
|
1178
|
-
cancelAnimationFrame(
|
|
1176
|
+
const v = requestAnimationFrame(u);
|
|
1177
|
+
return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1178
|
+
cancelAnimationFrame(v), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1179
1179
|
};
|
|
1180
|
-
}, [o, n]),
|
|
1180
|
+
}, [o, n]), D(() => {
|
|
1181
1181
|
if (!o) return;
|
|
1182
|
-
const
|
|
1183
|
-
m.current && !m.current.contains(
|
|
1182
|
+
const v = (j) => {
|
|
1183
|
+
m.current && !m.current.contains(j.target) && r(!1);
|
|
1184
1184
|
};
|
|
1185
|
-
return document.addEventListener("touchstart",
|
|
1185
|
+
return document.addEventListener("touchstart", v), () => document.removeEventListener("touchstart", v);
|
|
1186
1186
|
}, [o]), !s) return t;
|
|
1187
|
-
const
|
|
1187
|
+
const x = o && /* @__PURE__ */ e.jsx(
|
|
1188
1188
|
"div",
|
|
1189
1189
|
{
|
|
1190
1190
|
ref: p,
|
|
1191
1191
|
"data-ds-portal": "",
|
|
1192
|
-
className: `ds-tooltip ds-tooltip--${
|
|
1192
|
+
className: `ds-tooltip ds-tooltip--${d}`,
|
|
1193
1193
|
role: "tooltip",
|
|
1194
1194
|
style: i,
|
|
1195
1195
|
children: s
|
|
@@ -1207,12 +1207,12 @@ function De({ children: t, content: s, position: n, ...a }) {
|
|
|
1207
1207
|
h.current || r(!1);
|
|
1208
1208
|
},
|
|
1209
1209
|
onTouchStart: () => {
|
|
1210
|
-
h.current = !0, r((
|
|
1210
|
+
h.current = !0, r((v) => !v);
|
|
1211
1211
|
},
|
|
1212
1212
|
...a,
|
|
1213
1213
|
children: [
|
|
1214
1214
|
t,
|
|
1215
|
-
typeof document < "u" && pe.createPortal(
|
|
1215
|
+
typeof document < "u" && pe.createPortal(x, document.body)
|
|
1216
1216
|
]
|
|
1217
1217
|
}
|
|
1218
1218
|
);
|
|
@@ -1226,12 +1226,12 @@ function ks({
|
|
|
1226
1226
|
id: r,
|
|
1227
1227
|
...i
|
|
1228
1228
|
}) {
|
|
1229
|
-
const l = r || `toggle-${
|
|
1229
|
+
const l = r || `toggle-${Y.useId()}`, d = [
|
|
1230
1230
|
"ds-toggle",
|
|
1231
1231
|
`ds-toggle--${n}`,
|
|
1232
1232
|
a && "ds-toggle--disabled"
|
|
1233
1233
|
].filter(Boolean).join(" ");
|
|
1234
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1234
|
+
return /* @__PURE__ */ e.jsxs("label", { className: d, htmlFor: l, children: [
|
|
1235
1235
|
/* @__PURE__ */ e.jsx(
|
|
1236
1236
|
"input",
|
|
1237
1237
|
{
|
|
@@ -1257,12 +1257,12 @@ function Es({
|
|
|
1257
1257
|
id: r,
|
|
1258
1258
|
...i
|
|
1259
1259
|
}) {
|
|
1260
|
-
const l = r || `checkbox-${
|
|
1260
|
+
const l = r || `checkbox-${Y.useId()}`, d = [
|
|
1261
1261
|
"ds-checkbox",
|
|
1262
1262
|
`ds-checkbox--${n}`,
|
|
1263
1263
|
a && "ds-checkbox--disabled"
|
|
1264
1264
|
].filter(Boolean).join(" "), c = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1265
|
-
return /* @__PURE__ */ e.jsxs("label", { className:
|
|
1265
|
+
return /* @__PURE__ */ e.jsxs("label", { className: d, htmlFor: l, children: [
|
|
1266
1266
|
/* @__PURE__ */ e.jsx(
|
|
1267
1267
|
"input",
|
|
1268
1268
|
{
|
|
@@ -1295,9 +1295,9 @@ function $s({
|
|
|
1295
1295
|
name: r,
|
|
1296
1296
|
value: i,
|
|
1297
1297
|
id: l,
|
|
1298
|
-
...
|
|
1298
|
+
...d
|
|
1299
1299
|
}) {
|
|
1300
|
-
const c = l || `radio-${
|
|
1300
|
+
const c = l || `radio-${Y.useId()}`, m = [
|
|
1301
1301
|
"ds-radio",
|
|
1302
1302
|
`ds-radio--${n}`,
|
|
1303
1303
|
a && "ds-radio--disabled"
|
|
@@ -1314,7 +1314,7 @@ function $s({
|
|
|
1314
1314
|
disabled: a,
|
|
1315
1315
|
name: r,
|
|
1316
1316
|
value: i,
|
|
1317
|
-
...
|
|
1317
|
+
...d
|
|
1318
1318
|
}
|
|
1319
1319
|
),
|
|
1320
1320
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
@@ -1364,7 +1364,7 @@ function St(t) {
|
|
|
1364
1364
|
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
|
|
1365
1365
|
}
|
|
1366
1366
|
function Ts({ seed: t, icon: s, src: n, size: a = 32, className: o = "", style: r = {}, ...i }) {
|
|
1367
|
-
const l = Rt(t ?? ""), [
|
|
1367
|
+
const l = Rt(t ?? ""), [d, c] = I(!1), m = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: St(t) });
|
|
1368
1368
|
return /* @__PURE__ */ e.jsx(
|
|
1369
1369
|
"div",
|
|
1370
1370
|
{
|
|
@@ -1372,7 +1372,7 @@ function Ts({ seed: t, icon: s, src: n, size: a = 32, className: o = "", style:
|
|
|
1372
1372
|
style: { width: a, height: a, "--ds-avatar-h": l, ...r },
|
|
1373
1373
|
"aria-hidden": "true",
|
|
1374
1374
|
...i,
|
|
1375
|
-
children: n && !
|
|
1375
|
+
children: n && !d ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => c(!0) }) : m
|
|
1376
1376
|
}
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
@@ -1412,7 +1412,7 @@ function Ss({ children: t, ...s }) {
|
|
|
1412
1412
|
function As({ children: t, ...s }) {
|
|
1413
1413
|
return /* @__PURE__ */ e.jsx("tbody", { ...s, children: t });
|
|
1414
1414
|
}
|
|
1415
|
-
function Is({ children: t, interactive: s, selected: n, subheader: a, exiting: o, updated: r, className: i = "", onClick: l, ...
|
|
1415
|
+
function Is({ children: t, interactive: s, selected: n, subheader: a, exiting: o, updated: r, className: i = "", onClick: l, ...d }) {
|
|
1416
1416
|
return /* @__PURE__ */ e.jsx(
|
|
1417
1417
|
"tr",
|
|
1418
1418
|
{
|
|
@@ -1426,7 +1426,7 @@ function Is({ children: t, interactive: s, selected: n, subheader: a, exiting: o
|
|
|
1426
1426
|
i
|
|
1427
1427
|
].filter(Boolean).join(" "),
|
|
1428
1428
|
onClick: l,
|
|
1429
|
-
...
|
|
1429
|
+
...d,
|
|
1430
1430
|
children: t
|
|
1431
1431
|
}
|
|
1432
1432
|
);
|
|
@@ -1435,13 +1435,13 @@ function Bs({ children: t, colSpan: s = 999, ...n }) {
|
|
|
1435
1435
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: s, children: t }) });
|
|
1436
1436
|
}
|
|
1437
1437
|
function Ds({ children: t, align: s = "left", sortDir: n, onSort: a, width: o, className: r = "", style: i = {}, ...l }) {
|
|
1438
|
-
const
|
|
1438
|
+
const d = !!a || n !== void 0, c = n === "asc" ? nt : n === "desc" ? ve : rt;
|
|
1439
1439
|
return /* @__PURE__ */ e.jsx(
|
|
1440
1440
|
"th",
|
|
1441
1441
|
{
|
|
1442
1442
|
className: [
|
|
1443
1443
|
"ds-th",
|
|
1444
|
-
|
|
1444
|
+
d ? "ds-th--sortable" : "",
|
|
1445
1445
|
n ? "ds-th--sorted" : "",
|
|
1446
1446
|
s !== "left" ? `ds-table-cell--${s}` : "",
|
|
1447
1447
|
r
|
|
@@ -1449,7 +1449,7 @@ function Ds({ children: t, align: s = "left", sortDir: n, onSort: a, width: o, c
|
|
|
1449
1449
|
onClick: a,
|
|
1450
1450
|
style: { width: o, ...i },
|
|
1451
1451
|
...l,
|
|
1452
|
-
children:
|
|
1452
|
+
children: d ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1453
1453
|
t,
|
|
1454
1454
|
/* @__PURE__ */ e.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ e.jsx(c, { size: 11, strokeWidth: 2.5 }) })
|
|
1455
1455
|
] }) : t
|
|
@@ -1506,10 +1506,10 @@ function Ms({
|
|
|
1506
1506
|
htmlFor: r,
|
|
1507
1507
|
children: i,
|
|
1508
1508
|
className: l = "",
|
|
1509
|
-
style:
|
|
1509
|
+
style: d,
|
|
1510
1510
|
...c
|
|
1511
1511
|
}) {
|
|
1512
|
-
const m =
|
|
1512
|
+
const m = Y.useId(), p = r ?? m, h = `${p}-hint`, u = `${p}-error`;
|
|
1513
1513
|
return /* @__PURE__ */ e.jsxs(
|
|
1514
1514
|
"div",
|
|
1515
1515
|
{
|
|
@@ -1517,19 +1517,19 @@ function Ms({
|
|
|
1517
1517
|
"data-state": n ? "error" : void 0,
|
|
1518
1518
|
"data-required": a ? "" : void 0,
|
|
1519
1519
|
"data-disabled": o ? "" : void 0,
|
|
1520
|
-
style:
|
|
1520
|
+
style: d,
|
|
1521
1521
|
...c,
|
|
1522
1522
|
children: [
|
|
1523
1523
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: t }),
|
|
1524
1524
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: i }),
|
|
1525
1525
|
s && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: s }),
|
|
1526
|
-
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id:
|
|
1526
|
+
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: n })
|
|
1527
1527
|
]
|
|
1528
1528
|
}
|
|
1529
1529
|
);
|
|
1530
1530
|
}
|
|
1531
1531
|
function zs({ label: t, value: s, delta: n, size: a = "m", inline: o = !1, className: r = "", style: i, ...l }) {
|
|
1532
|
-
const
|
|
1532
|
+
const d = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1533
1533
|
return /* @__PURE__ */ e.jsxs(
|
|
1534
1534
|
"div",
|
|
1535
1535
|
{
|
|
@@ -1544,7 +1544,7 @@ function zs({ label: t, value: s, delta: n, size: a = "m", inline: o = !1, class
|
|
|
1544
1544
|
children: [
|
|
1545
1545
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: t }),
|
|
1546
1546
|
s != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: s }),
|
|
1547
|
-
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${
|
|
1547
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${d}`, children: n })
|
|
1548
1548
|
]
|
|
1549
1549
|
}
|
|
1550
1550
|
);
|
|
@@ -1557,7 +1557,7 @@ function Cs({
|
|
|
1557
1557
|
style: o,
|
|
1558
1558
|
...r
|
|
1559
1559
|
}) {
|
|
1560
|
-
const i =
|
|
1560
|
+
const i = Y.Children.toArray(t).filter(Boolean);
|
|
1561
1561
|
return /* @__PURE__ */ e.jsx(
|
|
1562
1562
|
"nav",
|
|
1563
1563
|
{
|
|
@@ -1565,10 +1565,10 @@ function Cs({
|
|
|
1565
1565
|
"aria-label": n,
|
|
1566
1566
|
style: o,
|
|
1567
1567
|
...r,
|
|
1568
|
-
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l,
|
|
1568
|
+
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: i.map((l, d) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1569
1569
|
l,
|
|
1570
|
-
|
|
1571
|
-
] },
|
|
1570
|
+
d < i.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: s })
|
|
1571
|
+
] }, d)) })
|
|
1572
1572
|
}
|
|
1573
1573
|
);
|
|
1574
1574
|
}
|
|
@@ -1582,7 +1582,7 @@ function Os({
|
|
|
1582
1582
|
style: i,
|
|
1583
1583
|
...l
|
|
1584
1584
|
}) {
|
|
1585
|
-
const
|
|
1585
|
+
const d = At(t, s, a);
|
|
1586
1586
|
return /* @__PURE__ */ e.jsxs(
|
|
1587
1587
|
"nav",
|
|
1588
1588
|
{
|
|
@@ -1601,7 +1601,7 @@ function Os({
|
|
|
1601
1601
|
children: /* @__PURE__ */ e.jsx(at, { size: 16 })
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
|
-
|
|
1604
|
+
d.map(
|
|
1605
1605
|
(c, m) => c === "…" ? /* @__PURE__ */ e.jsx("span", { className: "ds-pagination-gap", "aria-hidden": "true", children: "…" }, `gap-${m}`) : /* @__PURE__ */ e.jsx(
|
|
1606
1606
|
"button",
|
|
1607
1607
|
{
|
|
@@ -1643,24 +1643,24 @@ function Fs({
|
|
|
1643
1643
|
side: a = "right",
|
|
1644
1644
|
...o
|
|
1645
1645
|
}) {
|
|
1646
|
-
const r =
|
|
1647
|
-
!n || l || (
|
|
1648
|
-
|
|
1646
|
+
const r = T(null), i = Y.useId(), [l, d] = I(!1), c = () => {
|
|
1647
|
+
!n || l || (d(!0), setTimeout(() => {
|
|
1648
|
+
d(!1), n();
|
|
1649
1649
|
}, It));
|
|
1650
1650
|
};
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
},
|
|
1655
|
-
var
|
|
1656
|
-
const
|
|
1657
|
-
r.current && !r.current.contains(
|
|
1651
|
+
D(() => {
|
|
1652
|
+
const u = (v) => {
|
|
1653
|
+
v.key === "Escape" && c();
|
|
1654
|
+
}, x = (v) => {
|
|
1655
|
+
var E, g, b;
|
|
1656
|
+
const j = ((g = (E = v.composedPath) == null ? void 0 : E.call(v)) == null ? void 0 : g[0]) ?? v.target;
|
|
1657
|
+
r.current && !r.current.contains(j) && !((b = j.closest) != null && b.call(j, "[data-ds-portal]")) && c();
|
|
1658
1658
|
};
|
|
1659
|
-
return document.addEventListener("keydown",
|
|
1660
|
-
document.removeEventListener("keydown",
|
|
1659
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", x), () => {
|
|
1660
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", x);
|
|
1661
1661
|
};
|
|
1662
1662
|
}, [n, l]);
|
|
1663
|
-
const m =
|
|
1663
|
+
const m = Y.Children.toArray(t), p = m.find((u) => (u == null ? void 0 : u.type) === Fe), h = m.filter((u) => (u == null ? void 0 : u.type) !== Fe);
|
|
1664
1664
|
return /* @__PURE__ */ e.jsx(
|
|
1665
1665
|
"div",
|
|
1666
1666
|
{
|
|
@@ -1699,24 +1699,24 @@ function Ws({
|
|
|
1699
1699
|
subHeader: a,
|
|
1700
1700
|
...o
|
|
1701
1701
|
}) {
|
|
1702
|
-
const r =
|
|
1703
|
-
!n || l || (
|
|
1704
|
-
|
|
1702
|
+
const r = T(null), i = Y.useId(), [l, d] = I(!1), c = () => {
|
|
1703
|
+
!n || l || (d(!0), setTimeout(() => {
|
|
1704
|
+
d(!1), n();
|
|
1705
1705
|
}, Bt));
|
|
1706
1706
|
};
|
|
1707
|
-
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
},
|
|
1711
|
-
var
|
|
1712
|
-
const
|
|
1713
|
-
r.current && !r.current.contains(
|
|
1707
|
+
D(() => {
|
|
1708
|
+
const u = (v) => {
|
|
1709
|
+
v.key === "Escape" && c();
|
|
1710
|
+
}, x = (v) => {
|
|
1711
|
+
var E, g, b;
|
|
1712
|
+
const j = ((g = (E = v.composedPath) == null ? void 0 : E.call(v)) == null ? void 0 : g[0]) ?? v.target;
|
|
1713
|
+
r.current && !r.current.contains(j) && !((b = j.closest) != null && b.call(j, "[data-ds-portal]")) && c();
|
|
1714
1714
|
};
|
|
1715
|
-
return document.addEventListener("keydown",
|
|
1716
|
-
document.removeEventListener("keydown",
|
|
1715
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", x), () => {
|
|
1716
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", x);
|
|
1717
1717
|
};
|
|
1718
1718
|
}, [n, l]);
|
|
1719
|
-
const m =
|
|
1719
|
+
const m = Y.Children.toArray(t), p = m.find((u) => (u == null ? void 0 : u.type) === We || (u == null ? void 0 : u.type) === fe), h = m.filter((u) => (u == null ? void 0 : u.type) !== We && (u == null ? void 0 : u.type) !== fe);
|
|
1720
1720
|
return /* @__PURE__ */ e.jsx(
|
|
1721
1721
|
"div",
|
|
1722
1722
|
{
|
|
@@ -1755,7 +1755,7 @@ function Ws({
|
|
|
1755
1755
|
);
|
|
1756
1756
|
}
|
|
1757
1757
|
function We({ children: t }) {
|
|
1758
|
-
return !t ||
|
|
1758
|
+
return !t || Y.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
1759
1759
|
}
|
|
1760
1760
|
const _e = et({ collapsed: !1, side: "left" });
|
|
1761
1761
|
function Us({
|
|
@@ -1782,12 +1782,12 @@ function Vs({
|
|
|
1782
1782
|
onClick: r,
|
|
1783
1783
|
count: i,
|
|
1784
1784
|
updated: l = !1,
|
|
1785
|
-
open:
|
|
1785
|
+
open: d = !1,
|
|
1786
1786
|
onboarding: c = !1,
|
|
1787
1787
|
className: m = "",
|
|
1788
1788
|
...p
|
|
1789
1789
|
}) {
|
|
1790
|
-
const { collapsed: h, side:
|
|
1790
|
+
const { collapsed: h, side: u } = je(_e), j = {
|
|
1791
1791
|
className: [
|
|
1792
1792
|
"ds-nav-rail__item",
|
|
1793
1793
|
m
|
|
@@ -1800,18 +1800,18 @@ function Vs({
|
|
|
1800
1800
|
...{
|
|
1801
1801
|
"data-selected": n || void 0,
|
|
1802
1802
|
"data-disabled": a || void 0,
|
|
1803
|
-
"data-open":
|
|
1803
|
+
"data-open": d || void 0,
|
|
1804
1804
|
"data-onboarding": c || void 0
|
|
1805
1805
|
},
|
|
1806
1806
|
...p
|
|
1807
|
-
},
|
|
1807
|
+
}, E = i != null, g = u === "left" ? "right" : "left", b = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1808
1808
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1809
1809
|
!h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
|
|
1810
1810
|
!h && l && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: "accent", className: "ds-nav-rail__badge-expanded", children: "New" }),
|
|
1811
|
-
!h &&
|
|
1811
|
+
!h && E && /* @__PURE__ */ e.jsx("span", { className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "), children: i }),
|
|
1812
1812
|
h && l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
1813
|
-
] }), S = o ? /* @__PURE__ */ e.jsx("a", { href: a ? void 0 : o, ...
|
|
1814
|
-
return h ? /* @__PURE__ */ e.jsx(De, { content: s, position:
|
|
1813
|
+
] }), S = o ? /* @__PURE__ */ e.jsx("a", { href: a ? void 0 : o, ...j, children: b }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...j, children: b });
|
|
1814
|
+
return h ? /* @__PURE__ */ e.jsx(De, { content: s, position: g, children: S }) : S;
|
|
1815
1815
|
}
|
|
1816
1816
|
function Ys({ children: t, className: s = "", ...n }) {
|
|
1817
1817
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__body", "ds-scrollable", s].filter(Boolean).join(" "), ...n, children: t });
|
|
@@ -1826,14 +1826,14 @@ function Ks({ className: t = "", ...s }) {
|
|
|
1826
1826
|
return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
|
|
1827
1827
|
}
|
|
1828
1828
|
function Gs({ children: t, label: s = "Recents", defaultOpen: n = !0, className: a = "", ...o }) {
|
|
1829
|
-
const { collapsed: r } = je(_e), [i, l] =
|
|
1829
|
+
const { collapsed: r } = je(_e), [i, l] = I(n);
|
|
1830
1830
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", a].filter(Boolean).join(" "), ...o, children: [
|
|
1831
1831
|
!r && /* @__PURE__ */ e.jsxs(
|
|
1832
1832
|
"button",
|
|
1833
1833
|
{
|
|
1834
1834
|
type: "button",
|
|
1835
1835
|
className: ["ds-nav-rail__recents-toggle", !i && "ds-nav-rail__recents-toggle--closed"].filter(Boolean).join(" "),
|
|
1836
|
-
onClick: () => l((
|
|
1836
|
+
onClick: () => l((d) => !d),
|
|
1837
1837
|
"aria-expanded": i,
|
|
1838
1838
|
children: [
|
|
1839
1839
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__recents-label", children: s }),
|
|
@@ -1851,7 +1851,7 @@ const Xs = Qe(function({
|
|
|
1851
1851
|
className: o = "",
|
|
1852
1852
|
...r
|
|
1853
1853
|
}, i) {
|
|
1854
|
-
const { collapsed: l, side:
|
|
1854
|
+
const { collapsed: l, side: d } = je(_e), c = d === "left" ? "right" : "left", m = [
|
|
1855
1855
|
"ds-nav-rail__item",
|
|
1856
1856
|
"ds-nav-rail__agent",
|
|
1857
1857
|
o
|
|
@@ -1872,7 +1872,7 @@ const Xs = Qe(function({
|
|
|
1872
1872
|
return l ? /* @__PURE__ */ e.jsx(De, { content: a, position: c, children: h }) : h;
|
|
1873
1873
|
});
|
|
1874
1874
|
function Js({ avatar: t, label: s, selected: n = !1, disabled: a = !1, href: o, onClick: r, className: i = "", ...l }) {
|
|
1875
|
-
const { collapsed:
|
|
1875
|
+
const { collapsed: d, side: c } = je(_e), h = {
|
|
1876
1876
|
className: [
|
|
1877
1877
|
"ds-nav-rail__item",
|
|
1878
1878
|
"ds-nav-rail__agent",
|
|
@@ -1887,11 +1887,11 @@ function Js({ avatar: t, label: s, selected: n = !1, disabled: a = !1, href: o,
|
|
|
1887
1887
|
"data-disabled": a || void 0
|
|
1888
1888
|
},
|
|
1889
1889
|
...l
|
|
1890
|
-
},
|
|
1890
|
+
}, u = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1891
1891
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
1892
|
-
!
|
|
1893
|
-
] }),
|
|
1894
|
-
return
|
|
1892
|
+
!d && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
1893
|
+
] }), x = c === "left" ? "right" : "left", v = o ? /* @__PURE__ */ e.jsx("a", { href: a ? void 0 : o, ...h, children: u }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...h, children: u });
|
|
1894
|
+
return d ? /* @__PURE__ */ e.jsx(De, { content: s, position: x, children: v }) : v;
|
|
1895
1895
|
}
|
|
1896
1896
|
const Dt = {
|
|
1897
1897
|
info: Ie,
|
|
@@ -1908,12 +1908,12 @@ function Zs({
|
|
|
1908
1908
|
role: r,
|
|
1909
1909
|
...i
|
|
1910
1910
|
}) {
|
|
1911
|
-
const l = Dt[s],
|
|
1911
|
+
const l = Dt[s], d = r || (s === "error" ? "alert" : "status");
|
|
1912
1912
|
return /* @__PURE__ */ e.jsxs(
|
|
1913
1913
|
"div",
|
|
1914
1914
|
{
|
|
1915
1915
|
className: `ds-banner ds-banner--${s}`,
|
|
1916
|
-
role:
|
|
1916
|
+
role: d,
|
|
1917
1917
|
...i,
|
|
1918
1918
|
children: [
|
|
1919
1919
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: P[2], strokeWidth: 1.5 }) }),
|
|
@@ -1947,138 +1947,139 @@ function Qs({
|
|
|
1947
1947
|
open: n,
|
|
1948
1948
|
onOpenChange: a,
|
|
1949
1949
|
align: o = "left",
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1950
|
+
fullWidth: r = !1,
|
|
1951
|
+
className: i = "",
|
|
1952
|
+
style: l,
|
|
1953
|
+
...d
|
|
1953
1954
|
}) {
|
|
1954
|
-
const [
|
|
1955
|
-
if (
|
|
1955
|
+
const [c, m] = I(!1), [p, h] = I(!1), u = n !== void 0, x = u ? n : c, v = T(null), j = T(null), E = T(null), g = T(null), [b, S] = I({}), L = T(null), C = 150, U = () => {
|
|
1956
|
+
if (u)
|
|
1956
1957
|
a == null || a(!1);
|
|
1957
1958
|
else {
|
|
1958
|
-
if (
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
},
|
|
1959
|
+
if (p) return;
|
|
1960
|
+
h(!0), L.current = setTimeout(() => {
|
|
1961
|
+
m(!1), h(!1);
|
|
1962
|
+
}, C);
|
|
1962
1963
|
}
|
|
1963
|
-
},
|
|
1964
|
-
const
|
|
1965
|
-
|
|
1966
|
-
},
|
|
1967
|
-
|
|
1964
|
+
}, K = () => {
|
|
1965
|
+
const _ = !x;
|
|
1966
|
+
u ? a == null || a(_) : _ ? (clearTimeout(L.current), h(!1), m(!0)) : U();
|
|
1967
|
+
}, V = () => {
|
|
1968
|
+
x || (u ? a == null || a(!0) : (clearTimeout(L.current), h(!1), m(!0)));
|
|
1968
1969
|
};
|
|
1969
|
-
|
|
1970
|
-
if (!
|
|
1971
|
-
const
|
|
1972
|
-
var
|
|
1973
|
-
const
|
|
1974
|
-
if (!
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1977
|
-
o === "right" ?
|
|
1970
|
+
D(() => () => clearTimeout(L.current), []), D(() => {
|
|
1971
|
+
if (!x) return;
|
|
1972
|
+
const _ = 300, y = () => {
|
|
1973
|
+
var k;
|
|
1974
|
+
const R = (k = v.current) == null ? void 0 : k.getBoundingClientRect();
|
|
1975
|
+
if (!R) return;
|
|
1976
|
+
const O = window.innerHeight - R.bottom, H = O < _ + 8 && R.top > O;
|
|
1977
|
+
S(
|
|
1978
|
+
o === "right" ? H ? { bottom: window.innerHeight - R.top + 4, top: "auto", right: window.innerWidth - R.right } : { top: R.bottom + 4, bottom: "auto", right: window.innerWidth - R.right } : H ? { bottom: window.innerHeight - R.top + 4, top: "auto", left: R.left } : { top: R.bottom + 4, bottom: "auto", left: R.left }
|
|
1978
1979
|
);
|
|
1979
1980
|
};
|
|
1980
|
-
return
|
|
1981
|
-
window.removeEventListener("scroll",
|
|
1981
|
+
return y(), window.addEventListener("scroll", y, !0), window.addEventListener("resize", y), () => {
|
|
1982
|
+
window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y);
|
|
1982
1983
|
};
|
|
1983
|
-
}, [
|
|
1984
|
-
const
|
|
1985
|
-
var
|
|
1986
|
-
const
|
|
1984
|
+
}, [x, o]);
|
|
1985
|
+
const w = () => {
|
|
1986
|
+
var y;
|
|
1987
|
+
const _ = (y = E.current) == null ? void 0 : y.querySelector(
|
|
1987
1988
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
1988
1989
|
);
|
|
1989
|
-
|
|
1990
|
+
_ == null || _.focus();
|
|
1990
1991
|
};
|
|
1991
|
-
|
|
1992
|
-
if (!
|
|
1993
|
-
const
|
|
1994
|
-
var
|
|
1995
|
-
!((
|
|
1996
|
-
},
|
|
1997
|
-
|
|
1992
|
+
D(() => {
|
|
1993
|
+
if (!x) return;
|
|
1994
|
+
const _ = (R) => {
|
|
1995
|
+
var O, H;
|
|
1996
|
+
!((O = v.current) != null && O.contains(R.target)) && !((H = j.current) != null && H.contains(R.target)) && U();
|
|
1997
|
+
}, y = (R) => {
|
|
1998
|
+
R.key === "Escape" && (U(), w());
|
|
1998
1999
|
};
|
|
1999
|
-
return document.addEventListener("mousedown",
|
|
2000
|
-
document.removeEventListener("mousedown",
|
|
2000
|
+
return document.addEventListener("mousedown", _), document.addEventListener("keydown", y), () => {
|
|
2001
|
+
document.removeEventListener("mousedown", _), document.removeEventListener("keydown", y);
|
|
2001
2002
|
};
|
|
2002
|
-
}, [
|
|
2003
|
-
if (!
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2006
|
-
}, [
|
|
2007
|
-
const
|
|
2003
|
+
}, [x]), D(() => {
|
|
2004
|
+
if (!x || !g.current || !j.current) return;
|
|
2005
|
+
const _ = M(), y = g.current === "last" ? _[_.length - 1] : _[0];
|
|
2006
|
+
y == null || y.focus(), g.current = null;
|
|
2007
|
+
}, [x]);
|
|
2008
|
+
const M = () => j.current ? [...j.current.querySelectorAll(
|
|
2008
2009
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
2009
|
-
)] : [],
|
|
2010
|
-
var
|
|
2011
|
-
if (
|
|
2012
|
-
|
|
2013
|
-
else if (
|
|
2014
|
-
if (
|
|
2015
|
-
|
|
2010
|
+
)] : [], G = (_) => {
|
|
2011
|
+
var y, R;
|
|
2012
|
+
if (_.key === "ArrowDown")
|
|
2013
|
+
_.preventDefault(), x ? (y = M()[0]) == null || y.focus() : (g.current = "first", V());
|
|
2014
|
+
else if (_.key === "ArrowUp")
|
|
2015
|
+
if (_.preventDefault(), !x)
|
|
2016
|
+
g.current = "last", V();
|
|
2016
2017
|
else {
|
|
2017
|
-
const
|
|
2018
|
-
(
|
|
2018
|
+
const O = M();
|
|
2019
|
+
(R = O[O.length - 1]) == null || R.focus();
|
|
2019
2020
|
}
|
|
2020
|
-
},
|
|
2021
|
-
var
|
|
2022
|
-
const
|
|
2023
|
-
switch (
|
|
2021
|
+
}, F = (_) => {
|
|
2022
|
+
var O, H, k, f;
|
|
2023
|
+
const y = M(), R = y.findIndex(($) => $ === document.activeElement);
|
|
2024
|
+
switch (_.key) {
|
|
2024
2025
|
case "ArrowDown":
|
|
2025
|
-
|
|
2026
|
+
_.preventDefault(), (O = y[Math.min(R + 1, y.length - 1)]) == null || O.focus();
|
|
2026
2027
|
break;
|
|
2027
2028
|
case "ArrowUp":
|
|
2028
|
-
|
|
2029
|
+
_.preventDefault(), R <= 0 ? w() : (H = y[R - 1]) == null || H.focus();
|
|
2029
2030
|
break;
|
|
2030
2031
|
case "Home":
|
|
2031
|
-
|
|
2032
|
+
_.preventDefault(), (k = y[0]) == null || k.focus();
|
|
2032
2033
|
break;
|
|
2033
2034
|
case "End":
|
|
2034
|
-
|
|
2035
|
+
_.preventDefault(), (f = y[y.length - 1]) == null || f.focus();
|
|
2035
2036
|
break;
|
|
2036
2037
|
case "Tab":
|
|
2037
|
-
|
|
2038
|
+
U();
|
|
2038
2039
|
break;
|
|
2039
2040
|
}
|
|
2040
|
-
},
|
|
2041
|
+
}, A = x && /* @__PURE__ */ e.jsx(
|
|
2041
2042
|
"div",
|
|
2042
2043
|
{
|
|
2043
|
-
ref:
|
|
2044
|
+
ref: j,
|
|
2044
2045
|
role: "menu",
|
|
2045
2046
|
"data-ds-portal": "",
|
|
2046
2047
|
className: [
|
|
2047
2048
|
"ds-dropdown__menu",
|
|
2048
2049
|
`ds-dropdown__menu--${o}`,
|
|
2049
|
-
|
|
2050
|
+
p && "ds-dropdown__menu--closing"
|
|
2050
2051
|
].filter(Boolean).join(" "),
|
|
2051
|
-
style:
|
|
2052
|
-
onKeyDown:
|
|
2053
|
-
children: s.map((
|
|
2054
|
-
if (
|
|
2055
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" },
|
|
2056
|
-
if (
|
|
2052
|
+
style: b,
|
|
2053
|
+
onKeyDown: F,
|
|
2054
|
+
children: s.map((_, y) => {
|
|
2055
|
+
if (_.separator)
|
|
2056
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, y);
|
|
2057
|
+
if (_.type === "section")
|
|
2057
2058
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
2058
|
-
|
|
2059
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
2060
|
-
] },
|
|
2061
|
-
const
|
|
2059
|
+
_.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: _.label }),
|
|
2060
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: _.content })
|
|
2061
|
+
] }, y);
|
|
2062
|
+
const R = !!_.href, O = R ? "a" : "button", H = R ? { href: _.disabled ? void 0 : _.href, "aria-disabled": _.disabled ? "true" : void 0 } : { type: "button", disabled: _.disabled };
|
|
2062
2063
|
return /* @__PURE__ */ e.jsxs(
|
|
2063
|
-
|
|
2064
|
+
O,
|
|
2064
2065
|
{
|
|
2065
2066
|
role: "menuitem",
|
|
2066
2067
|
className: [
|
|
2067
2068
|
"ds-dropdown__item",
|
|
2068
|
-
|
|
2069
|
+
_.danger && "ds-dropdown__item--danger"
|
|
2069
2070
|
].filter(Boolean).join(" "),
|
|
2070
|
-
...
|
|
2071
|
+
...H,
|
|
2071
2072
|
onClick: () => {
|
|
2072
|
-
var
|
|
2073
|
-
(
|
|
2073
|
+
var k;
|
|
2074
|
+
(k = _.onClick) == null || k.call(_), U();
|
|
2074
2075
|
},
|
|
2075
2076
|
children: [
|
|
2076
|
-
|
|
2077
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
2078
|
-
|
|
2077
|
+
_.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: _.icon }),
|
|
2078
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: _.label }),
|
|
2079
|
+
_.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: _.shortcut })
|
|
2079
2080
|
]
|
|
2080
2081
|
},
|
|
2081
|
-
|
|
2082
|
+
y
|
|
2082
2083
|
);
|
|
2083
2084
|
})
|
|
2084
2085
|
}
|
|
@@ -2087,21 +2088,21 @@ function Qs({
|
|
|
2087
2088
|
"div",
|
|
2088
2089
|
{
|
|
2089
2090
|
ref: v,
|
|
2090
|
-
className: ["ds-dropdown", r].filter(Boolean).join(" "),
|
|
2091
|
-
style:
|
|
2092
|
-
...
|
|
2091
|
+
className: ["ds-dropdown", r && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
|
|
2092
|
+
style: l,
|
|
2093
|
+
...d,
|
|
2093
2094
|
children: [
|
|
2094
2095
|
/* @__PURE__ */ e.jsx(
|
|
2095
2096
|
"div",
|
|
2096
2097
|
{
|
|
2097
|
-
ref:
|
|
2098
|
+
ref: E,
|
|
2098
2099
|
className: "ds-dropdown__trigger",
|
|
2099
|
-
onClick:
|
|
2100
|
-
onKeyDown:
|
|
2100
|
+
onClick: K,
|
|
2101
|
+
onKeyDown: G,
|
|
2101
2102
|
children: t
|
|
2102
2103
|
}
|
|
2103
2104
|
),
|
|
2104
|
-
typeof document < "u" && pe.createPortal(
|
|
2105
|
+
typeof document < "u" && pe.createPortal(A, document.body)
|
|
2105
2106
|
]
|
|
2106
2107
|
}
|
|
2107
2108
|
);
|
|
@@ -2114,7 +2115,7 @@ function en({
|
|
|
2114
2115
|
min: o = 2,
|
|
2115
2116
|
animate: r = !0
|
|
2116
2117
|
}) {
|
|
2117
|
-
const i = Math.min(100, Math.max(0, t)), l = Math.max(o, i),
|
|
2118
|
+
const i = Math.min(100, Math.max(0, t)), l = Math.max(o, i), d = n === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : n;
|
|
2118
2119
|
return /* @__PURE__ */ e.jsxs(
|
|
2119
2120
|
"div",
|
|
2120
2121
|
{
|
|
@@ -2131,7 +2132,7 @@ function en({
|
|
|
2131
2132
|
/* @__PURE__ */ e.jsx("div", { className: "ds-progress__track", children: /* @__PURE__ */ e.jsx(
|
|
2132
2133
|
"div",
|
|
2133
2134
|
{
|
|
2134
|
-
className: `ds-progress__fill ds-progress__fill--${
|
|
2135
|
+
className: `ds-progress__fill ds-progress__fill--${d}`,
|
|
2135
2136
|
style: { width: `${l}%` }
|
|
2136
2137
|
}
|
|
2137
2138
|
) }),
|
|
@@ -2145,18 +2146,18 @@ function en({
|
|
|
2145
2146
|
}
|
|
2146
2147
|
const Lt = (t) => 1 - Math.pow(1 - t, 3), Pt = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2147
2148
|
function Mt(t, { duration: s = 600 } = {}) {
|
|
2148
|
-
const [n, a] =
|
|
2149
|
-
return
|
|
2149
|
+
const [n, a] = I(t), o = T(t), r = T(null);
|
|
2150
|
+
return D(() => {
|
|
2150
2151
|
if (Pt()) {
|
|
2151
2152
|
a(t), o.current = t;
|
|
2152
2153
|
return;
|
|
2153
2154
|
}
|
|
2154
2155
|
const i = o.current, l = t - i;
|
|
2155
2156
|
if (l === 0) return;
|
|
2156
|
-
let
|
|
2157
|
+
let d = null;
|
|
2157
2158
|
const c = (m) => {
|
|
2158
|
-
|
|
2159
|
-
const p = Math.min((m -
|
|
2159
|
+
d || (d = m);
|
|
2160
|
+
const p = Math.min((m - d) / s, 1);
|
|
2160
2161
|
a(i + l * Lt(p)), p < 1 ? r.current = requestAnimationFrame(c) : o.current = t;
|
|
2161
2162
|
};
|
|
2162
2163
|
return r.current = requestAnimationFrame(c), () => cancelAnimationFrame(r.current);
|
|
@@ -2173,13 +2174,13 @@ function tn({
|
|
|
2173
2174
|
return `${a}${i}${o}`;
|
|
2174
2175
|
}
|
|
2175
2176
|
function zt({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2176
|
-
const a =
|
|
2177
|
-
return
|
|
2177
|
+
const a = T(null), [o, r] = I(!1);
|
|
2178
|
+
return D(() => {
|
|
2178
2179
|
const i = a.current;
|
|
2179
2180
|
if (!i) return;
|
|
2180
2181
|
const l = new IntersectionObserver(
|
|
2181
|
-
([
|
|
2182
|
-
|
|
2182
|
+
([d]) => {
|
|
2183
|
+
d.isIntersecting ? (r(!0), n && l.disconnect()) : n || r(!1);
|
|
2183
2184
|
},
|
|
2184
2185
|
{ threshold: t, rootMargin: s }
|
|
2185
2186
|
);
|
|
@@ -2196,10 +2197,10 @@ function sn({
|
|
|
2196
2197
|
onLeave: i,
|
|
2197
2198
|
...l
|
|
2198
2199
|
}) {
|
|
2199
|
-
const { ref:
|
|
2200
|
-
return
|
|
2200
|
+
const { ref: d, inView: c } = zt({ threshold: a, rootMargin: o, once: n }), m = T(!1);
|
|
2201
|
+
return D(() => {
|
|
2201
2202
|
c && !m.current && (r == null || r()), !c && m.current && (i == null || i()), m.current = c;
|
|
2202
|
-
}, [c]), /* @__PURE__ */ e.jsx(s, { ref:
|
|
2203
|
+
}, [c]), /* @__PURE__ */ e.jsx(s, { ref: d, ...l, children: typeof t == "function" ? t(c) : t });
|
|
2203
2204
|
}
|
|
2204
2205
|
const Ue = {
|
|
2205
2206
|
default: Ie,
|
|
@@ -2231,8 +2232,8 @@ function nn() {
|
|
|
2231
2232
|
return t.success = (s, n) => t(s, { ...n, type: "success" }), t.error = (s, n) => t(s, { ...n, type: "error" }), t.warning = (s, n) => t(s, { ...n, type: "warning" }), { toast: t };
|
|
2232
2233
|
}
|
|
2233
2234
|
function Ft({ data: t, onDismiss: s }) {
|
|
2234
|
-
const [n, a] =
|
|
2235
|
-
|
|
2235
|
+
const [n, a] = I(!1), o = T(null);
|
|
2236
|
+
D(() => (requestAnimationFrame(() => a(!0)), t.duration > 0 && (o.current = setTimeout(() => r(), t.duration)), () => clearTimeout(o.current)), []);
|
|
2236
2237
|
function r() {
|
|
2237
2238
|
a(!1), setTimeout(() => s(t.id), 250);
|
|
2238
2239
|
}
|
|
@@ -2264,8 +2265,8 @@ function Ft({ data: t, onDismiss: s }) {
|
|
|
2264
2265
|
);
|
|
2265
2266
|
}
|
|
2266
2267
|
function rn({ position: t = "bottom-right" }) {
|
|
2267
|
-
const [s, n] =
|
|
2268
|
-
return
|
|
2268
|
+
const [s, n] = I(() => [...me]);
|
|
2269
|
+
return D(() => (ke.add(n), () => ke.delete(n)), []), !s.length || typeof document > "u" ? null : pe.createPortal(
|
|
2269
2270
|
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((a) => /* @__PURE__ */ e.jsx(Ft, { data: a, onDismiss: Ot }, a.id)) }),
|
|
2270
2271
|
document.body
|
|
2271
2272
|
);
|
|
@@ -2284,7 +2285,7 @@ function an({
|
|
|
2284
2285
|
expanded: r,
|
|
2285
2286
|
onToggle: i,
|
|
2286
2287
|
children: l,
|
|
2287
|
-
className:
|
|
2288
|
+
className: d = "",
|
|
2288
2289
|
...c
|
|
2289
2290
|
}) {
|
|
2290
2291
|
const m = s === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
@@ -2296,7 +2297,7 @@ function an({
|
|
|
2296
2297
|
return l ? /* @__PURE__ */ e.jsx(
|
|
2297
2298
|
"div",
|
|
2298
2299
|
{
|
|
2299
|
-
className: ["ds-tool-card", m && "ds-tool-card--running",
|
|
2300
|
+
className: ["ds-tool-card", m && "ds-tool-card--running", d].filter(Boolean).join(" "),
|
|
2300
2301
|
...c,
|
|
2301
2302
|
children: /* @__PURE__ */ e.jsx(
|
|
2302
2303
|
Be,
|
|
@@ -2313,7 +2314,7 @@ function an({
|
|
|
2313
2314
|
) : /* @__PURE__ */ e.jsx(
|
|
2314
2315
|
"div",
|
|
2315
2316
|
{
|
|
2316
|
-
className: ["ds-tool-card", "ds-tool-card--bubble",
|
|
2317
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", d].filter(Boolean).join(" "),
|
|
2317
2318
|
...c,
|
|
2318
2319
|
children: p
|
|
2319
2320
|
}
|
|
@@ -2326,8 +2327,8 @@ function Ut({
|
|
|
2326
2327
|
"aria-label": a = "Copy to clipboard",
|
|
2327
2328
|
...o
|
|
2328
2329
|
}) {
|
|
2329
|
-
const [r, i] =
|
|
2330
|
-
|
|
2330
|
+
const [r, i] = I(!1), l = (d) => {
|
|
2331
|
+
d.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
|
|
2331
2332
|
i(!0), setTimeout(() => i(!1), n);
|
|
2332
2333
|
});
|
|
2333
2334
|
};
|
|
@@ -2345,8 +2346,8 @@ function Ut({
|
|
|
2345
2346
|
);
|
|
2346
2347
|
}
|
|
2347
2348
|
function on({ content: t, streaming: s = !1, ...n }) {
|
|
2348
|
-
const [a, o] =
|
|
2349
|
-
return
|
|
2349
|
+
const [a, o] = I(s);
|
|
2350
|
+
return D(() => {
|
|
2350
2351
|
o(!!s);
|
|
2351
2352
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2352
2353
|
Be,
|
|
@@ -2377,8 +2378,8 @@ function ln({
|
|
|
2377
2378
|
...l
|
|
2378
2379
|
}) {
|
|
2379
2380
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", r].filter(Boolean).join(" "), ...l, children: [
|
|
2380
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (
|
|
2381
|
-
const m = c === s, p = n.includes(c) && !m, h = a && (c <= s || n.includes(c)),
|
|
2381
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i, children: Array.from({ length: t }, (d, c) => {
|
|
2382
|
+
const m = c === s, p = n.includes(c) && !m, h = a && (c <= s || n.includes(c)), u = [
|
|
2382
2383
|
"ds-step-indicator__dot",
|
|
2383
2384
|
m && "ds-step-indicator__dot--active",
|
|
2384
2385
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2387,7 +2388,7 @@ function ln({
|
|
|
2387
2388
|
"button",
|
|
2388
2389
|
{
|
|
2389
2390
|
type: "button",
|
|
2390
|
-
className:
|
|
2391
|
+
className: u,
|
|
2391
2392
|
role: "tab",
|
|
2392
2393
|
"aria-selected": m,
|
|
2393
2394
|
"aria-label": `Step ${c + 1}`,
|
|
@@ -2413,8 +2414,8 @@ function cn({
|
|
|
2413
2414
|
className: o = "",
|
|
2414
2415
|
...r
|
|
2415
2416
|
}) {
|
|
2416
|
-
const i =
|
|
2417
|
-
return
|
|
2417
|
+
const i = T(t);
|
|
2418
|
+
return D(() => {
|
|
2418
2419
|
t !== i.current && (a == null || a(t), i.current = t);
|
|
2419
2420
|
}, [t, a]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", o].filter(Boolean).join(" "), ...r, children: [
|
|
2420
2421
|
t,
|
|
@@ -2431,17 +2432,17 @@ function dn({
|
|
|
2431
2432
|
className: i = "",
|
|
2432
2433
|
...l
|
|
2433
2434
|
}) {
|
|
2434
|
-
const
|
|
2435
|
+
const d = [
|
|
2435
2436
|
"ds-chat-message",
|
|
2436
2437
|
`ds-chat-message--${t}`,
|
|
2437
2438
|
o && "ds-chat-message--streaming",
|
|
2438
2439
|
i
|
|
2439
2440
|
].filter(Boolean).join(" ");
|
|
2440
|
-
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className:
|
|
2441
|
+
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className: d, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: r }) }) : t === "user" ? /* @__PURE__ */ e.jsxs("div", { className: d, ...l, children: [
|
|
2441
2442
|
a && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: a }),
|
|
2442
2443
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: r }),
|
|
2443
2444
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2444
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
2445
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: d, ...l, children: [
|
|
2445
2446
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: s }),
|
|
2446
2447
|
a && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: a }),
|
|
2447
2448
|
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: r }),
|
|
@@ -2449,8 +2450,8 @@ function dn({
|
|
|
2449
2450
|
] });
|
|
2450
2451
|
}
|
|
2451
2452
|
function un(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2452
|
-
const a =
|
|
2453
|
-
|
|
2453
|
+
const a = T(!1), o = T(0);
|
|
2454
|
+
D(() => {
|
|
2454
2455
|
const r = s == null ? void 0 : s.current;
|
|
2455
2456
|
if (!r) return;
|
|
2456
2457
|
const i = () => {
|
|
@@ -2458,7 +2459,7 @@ function un(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
|
2458
2459
|
!l && r.scrollTop < o.current && (a.current = !0), l && (a.current = !1), o.current = r.scrollTop;
|
|
2459
2460
|
};
|
|
2460
2461
|
return r.addEventListener("scroll", i, { passive: !0 }), () => r.removeEventListener("scroll", i);
|
|
2461
|
-
}, [s]),
|
|
2462
|
+
}, [s]), D(() => {
|
|
2462
2463
|
const r = s == null ? void 0 : s.current;
|
|
2463
2464
|
r && (n && a.current || (r.scrollTop = r.scrollHeight));
|
|
2464
2465
|
}, t);
|
|
@@ -2472,33 +2473,33 @@ function Vt({
|
|
|
2472
2473
|
betweenTime: r = 380,
|
|
2473
2474
|
manualPauseMs: i = 5e3
|
|
2474
2475
|
}) {
|
|
2475
|
-
const [l,
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
}, [l]),
|
|
2479
|
-
if (
|
|
2476
|
+
const [l, d] = I(0), [c, m] = I(""), p = T("typing"), h = T(0), u = T(0), x = T(null), v = T(0);
|
|
2477
|
+
D(() => {
|
|
2478
|
+
u.current = l;
|
|
2479
|
+
}, [l]), D(() => {
|
|
2480
|
+
if (x.current && (clearTimeout(x.current), x.current = null), !s || t.length === 0) {
|
|
2480
2481
|
m(""), h.current = 0, p.current = "typing";
|
|
2481
2482
|
return;
|
|
2482
2483
|
}
|
|
2483
2484
|
const S = () => {
|
|
2484
|
-
const
|
|
2485
|
-
if (
|
|
2486
|
-
|
|
2485
|
+
const L = Date.now();
|
|
2486
|
+
if (v.current > L) {
|
|
2487
|
+
x.current = setTimeout(S, v.current - L);
|
|
2487
2488
|
return;
|
|
2488
2489
|
}
|
|
2489
|
-
const
|
|
2490
|
-
p.current === "typing" ? (h.current += 1, m(
|
|
2490
|
+
const C = t[u.current % t.length] ?? "";
|
|
2491
|
+
p.current === "typing" ? (h.current += 1, m(C.slice(0, h.current)), h.current >= C.length ? (p.current = "holding", x.current = setTimeout(S, o)) : x.current = setTimeout(S, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", x.current = setTimeout(S, a)) : (h.current = Math.max(0, h.current - 1), m(C.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % t.length, d(u.current), x.current = setTimeout(S, r)) : x.current = setTimeout(S, a));
|
|
2491
2492
|
};
|
|
2492
|
-
return
|
|
2493
|
-
|
|
2493
|
+
return x.current = setTimeout(S, 260), () => {
|
|
2494
|
+
x.current && clearTimeout(x.current);
|
|
2494
2495
|
};
|
|
2495
2496
|
}, [s, t, n, a, o, r]);
|
|
2496
|
-
const
|
|
2497
|
+
const j = (S) => {
|
|
2497
2498
|
if (t.length === 0) return;
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2500
|
-
},
|
|
2501
|
-
return { displayed: c, currentPrompt:
|
|
2499
|
+
const L = (S % t.length + t.length) % t.length, C = t[L];
|
|
2500
|
+
u.current = L, h.current = C.length, p.current = "holding", v.current = Date.now() + i, d(L), m(C);
|
|
2501
|
+
}, E = () => j(u.current + 1), g = () => j(u.current - 1), b = t[l % t.length] ?? "";
|
|
2502
|
+
return { displayed: c, currentPrompt: b, index: l, next: E, prev: g };
|
|
2502
2503
|
}
|
|
2503
2504
|
let Yt = 0;
|
|
2504
2505
|
function fn({
|
|
@@ -2510,75 +2511,75 @@ function fn({
|
|
|
2510
2511
|
loading: r = !1,
|
|
2511
2512
|
disabled: i = !1,
|
|
2512
2513
|
placeholder: l = "Let's get things done...",
|
|
2513
|
-
animatedPlaceholders:
|
|
2514
|
+
animatedPlaceholders: d,
|
|
2514
2515
|
attachments: c,
|
|
2515
2516
|
images: m,
|
|
2516
2517
|
onAttachFiles: p,
|
|
2517
2518
|
onAttachImages: h,
|
|
2518
|
-
onRemoveAttachment:
|
|
2519
|
-
onRemoveImage:
|
|
2520
|
-
acceptImage:
|
|
2521
|
-
acceptFile:
|
|
2522
|
-
maxImages:
|
|
2523
|
-
maxImageSize:
|
|
2524
|
-
leftSlot:
|
|
2519
|
+
onRemoveAttachment: u,
|
|
2520
|
+
onRemoveImage: x,
|
|
2521
|
+
acceptImage: v,
|
|
2522
|
+
acceptFile: j,
|
|
2523
|
+
maxImages: E,
|
|
2524
|
+
maxImageSize: g,
|
|
2525
|
+
leftSlot: b,
|
|
2525
2526
|
rightSlot: S,
|
|
2526
|
-
className:
|
|
2527
|
-
...
|
|
2527
|
+
className: L = "",
|
|
2528
|
+
...C
|
|
2528
2529
|
}) {
|
|
2529
|
-
const
|
|
2530
|
-
const
|
|
2531
|
-
|
|
2532
|
-
},
|
|
2533
|
-
const
|
|
2534
|
-
let te = 0, ce =
|
|
2530
|
+
const U = T(null), K = T(null), V = T(0), [w, M] = I(!1), [G, F] = I([]), A = (N) => {
|
|
2531
|
+
const B = ++Yt;
|
|
2532
|
+
F((X) => [...X, { id: B, msg: N }]), setTimeout(() => F((X) => X.filter((J) => J.id !== B)), 6e3);
|
|
2533
|
+
}, _ = (N) => F((B) => B.filter((X) => X.id !== N)), y = (N) => N.type.startsWith("image/"), R = () => !0, O = v ?? y, H = j ?? R, k = (N) => {
|
|
2534
|
+
const B = [], X = [], J = [], Z = [];
|
|
2535
|
+
let te = 0, ce = E != null ? E - ((m == null ? void 0 : m.length) ?? 0) : 1 / 0;
|
|
2535
2536
|
for (const se of N)
|
|
2536
|
-
|
|
2537
|
-
return { imageFiles:
|
|
2537
|
+
O(se) ? g && se.size > g ? J.push(se.name) : ce > 0 ? (B.push(se), ce--) : te++ : H(se) ? X.push(se) : Z.push(se.name);
|
|
2538
|
+
return { imageFiles: B, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te };
|
|
2538
2539
|
}, f = (N) => {
|
|
2539
|
-
const { imageFiles:
|
|
2540
|
-
J.length &&
|
|
2541
|
-
const ce = X.concat(h ? [] :
|
|
2540
|
+
const { imageFiles: B, docFiles: X, tooLarge: J, skipped: Z, limitExceeded: te } = k(N);
|
|
2541
|
+
J.length && A(`File${J.length > 1 ? "s" : ""} too large${g ? ` (max ${g / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && A(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), te && A(`Max ${E} images per message`), h && B.length && h(B);
|
|
2542
|
+
const ce = X.concat(h ? [] : B);
|
|
2542
2543
|
p && ce.length && p(ce);
|
|
2543
2544
|
};
|
|
2544
|
-
|
|
2545
|
-
const N =
|
|
2545
|
+
D(() => {
|
|
2546
|
+
const N = K.current;
|
|
2546
2547
|
N && (N.style.height = "auto", N.style.height = `${Math.min(N.scrollHeight, 200)}px`);
|
|
2547
|
-
}, [t]),
|
|
2548
|
-
const N = (
|
|
2548
|
+
}, [t]), D(() => {
|
|
2549
|
+
const N = (B) => {
|
|
2549
2550
|
var J, Z, te;
|
|
2550
2551
|
if (r || i) return;
|
|
2551
|
-
const X = (J =
|
|
2552
|
-
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z =
|
|
2552
|
+
const X = (J = B.target) == null ? void 0 : J.tagName;
|
|
2553
|
+
X === "INPUT" || X === "TEXTAREA" || X === "SELECT" || (Z = B.target) != null && Z.isContentEditable || B.ctrlKey || B.metaKey || B.altKey || B.key.length !== 1 && B.key !== "Backspace" && B.key !== "Delete" || (te = K.current) == null || te.focus();
|
|
2553
2554
|
};
|
|
2554
2555
|
return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
|
|
2555
2556
|
}, [r, i]);
|
|
2556
2557
|
const $ = (N) => {
|
|
2557
|
-
N.preventDefault(),
|
|
2558
|
+
N.preventDefault(), V.current++, N.dataTransfer.types.includes("Files") && M(!0);
|
|
2558
2559
|
}, z = (N) => {
|
|
2559
|
-
N.preventDefault(),
|
|
2560
|
-
},
|
|
2561
|
-
N.preventDefault(),
|
|
2562
|
-
const
|
|
2563
|
-
|
|
2560
|
+
N.preventDefault(), V.current--, V.current === 0 && M(!1);
|
|
2561
|
+
}, W = (N) => N.preventDefault(), ne = (N) => {
|
|
2562
|
+
N.preventDefault(), V.current = 0, M(!1);
|
|
2563
|
+
const B = Array.from(N.dataTransfer.files);
|
|
2564
|
+
B.length && f(B);
|
|
2564
2565
|
}, oe = (N) => {
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2567
|
-
},
|
|
2566
|
+
const B = Array.from(N.target.files || []);
|
|
2567
|
+
U.current && (U.current.value = ""), B.length && f(B);
|
|
2568
|
+
}, q = (N) => {
|
|
2568
2569
|
var se;
|
|
2569
2570
|
if (!h) return;
|
|
2570
|
-
const
|
|
2571
|
-
if (!
|
|
2571
|
+
const B = (se = N.clipboardData) == null ? void 0 : se.items;
|
|
2572
|
+
if (!B) return;
|
|
2572
2573
|
const X = [];
|
|
2573
|
-
for (const Je of
|
|
2574
|
+
for (const Je of B) {
|
|
2574
2575
|
const Pe = Je.getAsFile();
|
|
2575
2576
|
Pe && X.push(Pe);
|
|
2576
2577
|
}
|
|
2577
2578
|
if (X.length === 0) return;
|
|
2578
|
-
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ce } =
|
|
2579
|
-
Z.length &&
|
|
2580
|
-
}, Q = !r && !i && !!(
|
|
2581
|
-
prompts:
|
|
2579
|
+
const { imageFiles: J, tooLarge: Z, skipped: te, limitExceeded: ce } = k(X);
|
|
2580
|
+
Z.length && A(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), te.length && A(`Skipped unsupported file${te.length > 1 ? "s" : ""}: ${te.join(", ")}`), ce && A(`Max ${E} images per message`), J.length && (N.preventDefault(), h(J));
|
|
2581
|
+
}, Q = !r && !i && !!(d != null && d.length) && t.length === 0, ie = Vt({
|
|
2582
|
+
prompts: d ?? [],
|
|
2582
2583
|
enabled: Q
|
|
2583
2584
|
}), Ne = (N) => {
|
|
2584
2585
|
if (Q) {
|
|
@@ -2597,11 +2598,11 @@ function fn({
|
|
|
2597
2598
|
}
|
|
2598
2599
|
o == null || o(N);
|
|
2599
2600
|
}, Xe = (t.trim() || (m == null ? void 0 : m.length) > 0 || (c == null ? void 0 : c.length) > 0) && !i, Le = p || h;
|
|
2600
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input",
|
|
2601
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", L].filter(Boolean).join(" "), ...C, children: [
|
|
2601
2602
|
Le && /* @__PURE__ */ e.jsx(
|
|
2602
2603
|
"input",
|
|
2603
2604
|
{
|
|
2604
|
-
ref:
|
|
2605
|
+
ref: U,
|
|
2605
2606
|
type: "file",
|
|
2606
2607
|
multiple: !0,
|
|
2607
2608
|
accept: "*/*",
|
|
@@ -2612,21 +2613,21 @@ function fn({
|
|
|
2612
2613
|
/* @__PURE__ */ e.jsxs(
|
|
2613
2614
|
"div",
|
|
2614
2615
|
{
|
|
2615
|
-
className: ["ds-prompt-input__box",
|
|
2616
|
+
className: ["ds-prompt-input__box", w && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
2616
2617
|
onDragEnter: $,
|
|
2617
2618
|
onDragLeave: z,
|
|
2618
|
-
onDragOver:
|
|
2619
|
+
onDragOver: W,
|
|
2619
2620
|
onDrop: ne,
|
|
2620
2621
|
children: [
|
|
2621
|
-
|
|
2622
|
+
w && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: "Drop files here" }),
|
|
2622
2623
|
/* @__PURE__ */ e.jsx(
|
|
2623
2624
|
"textarea",
|
|
2624
2625
|
{
|
|
2625
|
-
ref:
|
|
2626
|
+
ref: K,
|
|
2626
2627
|
value: t,
|
|
2627
2628
|
onChange: (N) => s == null ? void 0 : s(N.target.value),
|
|
2628
2629
|
onKeyDown: Ne,
|
|
2629
|
-
onPaste:
|
|
2630
|
+
onPaste: q,
|
|
2630
2631
|
placeholder: Q ? "" : l,
|
|
2631
2632
|
disabled: r || i,
|
|
2632
2633
|
rows: 1,
|
|
@@ -2637,33 +2638,33 @@ function fn({
|
|
|
2637
2638
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
|
|
2638
2639
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2639
2640
|
] }),
|
|
2640
|
-
m && m.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: m.map((N,
|
|
2641
|
+
m && m.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: m.map((N, B) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2641
2642
|
/* @__PURE__ */ e.jsx("img", { src: N.preview, alt: "" }),
|
|
2642
2643
|
/* @__PURE__ */ e.jsx(
|
|
2643
2644
|
"button",
|
|
2644
2645
|
{
|
|
2645
2646
|
className: "ds-prompt-input__image-remove",
|
|
2646
|
-
onClick: () =>
|
|
2647
|
+
onClick: () => x == null ? void 0 : x(B),
|
|
2647
2648
|
"aria-label": "Remove image",
|
|
2648
2649
|
type: "button",
|
|
2649
2650
|
children: /* @__PURE__ */ e.jsx(ee, { size: 12, strokeWidth: 2 })
|
|
2650
2651
|
}
|
|
2651
2652
|
)
|
|
2652
|
-
] },
|
|
2653
|
-
|
|
2653
|
+
] }, B)) }),
|
|
2654
|
+
G.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: G.map((N) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2654
2655
|
/* @__PURE__ */ e.jsx("span", { children: N.msg }),
|
|
2655
2656
|
/* @__PURE__ */ e.jsx(
|
|
2656
2657
|
"button",
|
|
2657
2658
|
{
|
|
2658
2659
|
type: "button",
|
|
2659
2660
|
className: "ds-prompt-input__warning-close",
|
|
2660
|
-
onClick: () =>
|
|
2661
|
+
onClick: () => _(N.id),
|
|
2661
2662
|
"aria-label": "Dismiss",
|
|
2662
2663
|
children: /* @__PURE__ */ e.jsx(ee, { size: P[1], strokeWidth: 1.5 })
|
|
2663
2664
|
}
|
|
2664
2665
|
)
|
|
2665
2666
|
] }, N.id)) }),
|
|
2666
|
-
c && c.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: c.map((N,
|
|
2667
|
+
c && c.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: c.map((N, B) => /* @__PURE__ */ e.jsx(de, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2667
2668
|
N.uploading ? /* @__PURE__ */ e.jsx(ct, { size: P[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Me, { size: P[1], strokeWidth: 1.5 }),
|
|
2668
2669
|
N.filename,
|
|
2669
2670
|
N.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
@@ -2671,11 +2672,11 @@ function fn({
|
|
|
2671
2672
|
{
|
|
2672
2673
|
type: "button",
|
|
2673
2674
|
className: "ds-prompt-input__remove-btn",
|
|
2674
|
-
onClick: () =>
|
|
2675
|
+
onClick: () => u == null ? void 0 : u(B),
|
|
2675
2676
|
children: /* @__PURE__ */ e.jsx(ee, { size: P[1], strokeWidth: 1.5 })
|
|
2676
2677
|
}
|
|
2677
2678
|
)
|
|
2678
|
-
] }) },
|
|
2679
|
+
] }) }, B)) }),
|
|
2679
2680
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
2680
2681
|
Le && /* @__PURE__ */ e.jsx(
|
|
2681
2682
|
ae,
|
|
@@ -2686,11 +2687,11 @@ function fn({
|
|
|
2686
2687
|
"aria-label": "Attach files",
|
|
2687
2688
|
onClick: () => {
|
|
2688
2689
|
var N;
|
|
2689
|
-
return (N =
|
|
2690
|
+
return (N = U.current) == null ? void 0 : N.click();
|
|
2690
2691
|
}
|
|
2691
2692
|
}
|
|
2692
2693
|
),
|
|
2693
|
-
|
|
2694
|
+
b,
|
|
2694
2695
|
S,
|
|
2695
2696
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2696
2697
|
r ? /* @__PURE__ */ e.jsx(
|
|
@@ -2729,60 +2730,60 @@ function mn({
|
|
|
2729
2730
|
showAutoOption: r = !1,
|
|
2730
2731
|
groupByTier: i = !0,
|
|
2731
2732
|
className: l = "",
|
|
2732
|
-
...
|
|
2733
|
+
...d
|
|
2733
2734
|
}) {
|
|
2734
|
-
const [c, m] =
|
|
2735
|
-
|
|
2735
|
+
const [c, m] = I(!1), p = T(null), h = T(null), u = T(null), [x, v] = I({}), j = t.filter((w) => !o || w.name === "auto" ? !0 : (Ve[w.tier] ?? 1) >= (Ve[o] ?? 1)), E = j.find((w) => w.name === "auto"), g = j.filter((w) => w.name !== "auto"), b = t.find((w) => w.name === s), L = new Set(g.map((w) => w.tier).filter(Boolean)).size > 1;
|
|
2736
|
+
D(() => {
|
|
2736
2737
|
if (!c) return;
|
|
2737
|
-
const
|
|
2738
|
-
var
|
|
2739
|
-
const
|
|
2740
|
-
if (!
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2738
|
+
const w = 320, M = () => {
|
|
2739
|
+
var R;
|
|
2740
|
+
const A = (R = h.current) == null ? void 0 : R.getBoundingClientRect();
|
|
2741
|
+
if (!A) return;
|
|
2742
|
+
const _ = window.innerHeight - A.bottom, y = _ < w + 8 && A.top > _;
|
|
2743
|
+
v({
|
|
2743
2744
|
position: "fixed",
|
|
2744
2745
|
zIndex: "var(--z-dropdown, 500)",
|
|
2745
|
-
left:
|
|
2746
|
-
...
|
|
2746
|
+
left: A.left,
|
|
2747
|
+
...y ? { bottom: window.innerHeight - A.top + 4, top: "auto" } : { top: A.bottom + 4, bottom: "auto" }
|
|
2747
2748
|
});
|
|
2748
2749
|
};
|
|
2749
|
-
|
|
2750
|
-
const
|
|
2751
|
-
var
|
|
2752
|
-
!((
|
|
2753
|
-
},
|
|
2754
|
-
|
|
2750
|
+
M(), window.addEventListener("scroll", M, !0), window.addEventListener("resize", M);
|
|
2751
|
+
const G = (A) => {
|
|
2752
|
+
var _, y;
|
|
2753
|
+
!((_ = p.current) != null && _.contains(A.target)) && !((y = u.current) != null && y.contains(A.target)) && m(!1);
|
|
2754
|
+
}, F = (A) => {
|
|
2755
|
+
A.key === "Escape" && m(!1);
|
|
2755
2756
|
};
|
|
2756
|
-
return document.addEventListener("mousedown",
|
|
2757
|
-
window.removeEventListener("scroll",
|
|
2757
|
+
return document.addEventListener("mousedown", G), document.addEventListener("keydown", F), () => {
|
|
2758
|
+
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M), document.removeEventListener("mousedown", G), document.removeEventListener("keydown", F);
|
|
2758
2759
|
};
|
|
2759
2760
|
}, [c]);
|
|
2760
|
-
const
|
|
2761
|
-
n == null || n(
|
|
2762
|
-
},
|
|
2761
|
+
const C = (w) => {
|
|
2762
|
+
n == null || n(w), m(!1);
|
|
2763
|
+
}, U = (w) => /* @__PURE__ */ e.jsxs(
|
|
2763
2764
|
"button",
|
|
2764
2765
|
{
|
|
2765
2766
|
type: "button",
|
|
2766
2767
|
className: [
|
|
2767
2768
|
"ds-model-picker__item",
|
|
2768
|
-
|
|
2769
|
+
w.name === s && "ds-model-picker__item--active"
|
|
2769
2770
|
].filter(Boolean).join(" "),
|
|
2770
|
-
onClick: () =>
|
|
2771
|
+
onClick: () => C(w.name),
|
|
2771
2772
|
children: [
|
|
2772
|
-
|
|
2773
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
2774
|
-
|
|
2773
|
+
w.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: w.icon }) : /* @__PURE__ */ e.jsx(ze, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2774
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: w.displayName || w.name }),
|
|
2775
|
+
L && w.tier && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Ye[w.tier] || "default", children: w.tier })
|
|
2775
2776
|
]
|
|
2776
2777
|
},
|
|
2777
|
-
|
|
2778
|
-
),
|
|
2779
|
-
const
|
|
2780
|
-
return
|
|
2781
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
2782
|
-
...
|
|
2778
|
+
w.name
|
|
2779
|
+
), K = () => !i || !L ? g.map(U) : ["fast", "standard", "premium"].flatMap((w) => {
|
|
2780
|
+
const M = g.filter((G) => G.tier === w);
|
|
2781
|
+
return M.length ? [
|
|
2782
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": w, children: w.charAt(0).toUpperCase() + w.slice(1) }, `lbl-${w}`),
|
|
2783
|
+
...M.map(U)
|
|
2783
2784
|
] : [];
|
|
2784
|
-
}),
|
|
2785
|
-
r &&
|
|
2785
|
+
}), V = c && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu ds-scrollable", "data-ds-portal": "", style: x, children: [
|
|
2786
|
+
r && E && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2786
2787
|
/* @__PURE__ */ e.jsxs(
|
|
2787
2788
|
"button",
|
|
2788
2789
|
{
|
|
@@ -2792,23 +2793,23 @@ function mn({
|
|
|
2792
2793
|
"ds-model-picker__item--auto",
|
|
2793
2794
|
s === "auto" && "ds-model-picker__item--active"
|
|
2794
2795
|
].filter(Boolean).join(" "),
|
|
2795
|
-
onClick: () =>
|
|
2796
|
+
onClick: () => C("auto"),
|
|
2796
2797
|
children: [
|
|
2797
2798
|
/* @__PURE__ */ e.jsx(ft, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2798
2799
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
2799
2800
|
]
|
|
2800
2801
|
}
|
|
2801
2802
|
),
|
|
2802
|
-
|
|
2803
|
+
g.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
2803
2804
|
] }),
|
|
2804
|
-
|
|
2805
|
+
K()
|
|
2805
2806
|
] });
|
|
2806
2807
|
return /* @__PURE__ */ e.jsxs(
|
|
2807
2808
|
"div",
|
|
2808
2809
|
{
|
|
2809
2810
|
ref: p,
|
|
2810
2811
|
className: ["ds-model-picker", l].filter(Boolean).join(" "),
|
|
2811
|
-
...
|
|
2812
|
+
...d,
|
|
2812
2813
|
children: [
|
|
2813
2814
|
/* @__PURE__ */ e.jsxs(
|
|
2814
2815
|
"button",
|
|
@@ -2816,17 +2817,17 @@ function mn({
|
|
|
2816
2817
|
ref: h,
|
|
2817
2818
|
type: "button",
|
|
2818
2819
|
className: "ds-model-picker__trigger",
|
|
2819
|
-
onClick: () => m((
|
|
2820
|
+
onClick: () => m((w) => !w),
|
|
2820
2821
|
"aria-haspopup": "listbox",
|
|
2821
2822
|
"aria-expanded": c,
|
|
2822
2823
|
children: [
|
|
2823
|
-
|
|
2824
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (
|
|
2825
|
-
|
|
2824
|
+
b != null && b.icon ? /* @__PURE__ */ e.jsx("span", { children: b.icon }) : /* @__PURE__ */ e.jsx(ze, { size: 12, strokeWidth: 1.5 }),
|
|
2825
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (b == null ? void 0 : b.displayName) || (b == null ? void 0 : b.name) || s }),
|
|
2826
|
+
L && (b == null ? void 0 : b.tier) && /* @__PURE__ */ e.jsx(de, { size: "xs", variant: Ye[b.tier] || "default", children: b.tier })
|
|
2826
2827
|
]
|
|
2827
2828
|
}
|
|
2828
2829
|
),
|
|
2829
|
-
typeof document < "u" && pe.createPortal(
|
|
2830
|
+
typeof document < "u" && pe.createPortal(V, document.body)
|
|
2830
2831
|
]
|
|
2831
2832
|
}
|
|
2832
2833
|
);
|
|
@@ -2851,25 +2852,25 @@ function pn({
|
|
|
2851
2852
|
maxVisible: a = 5,
|
|
2852
2853
|
onSourceClick: o
|
|
2853
2854
|
}) {
|
|
2854
|
-
const [r, i] =
|
|
2855
|
+
const [r, i] = I(!1), l = Ht(t), d = l.length > a, c = r ? l : l.slice(0, a), m = t.some((h) => h.snippet), p = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2855
2856
|
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2856
2857
|
c.map((h) => {
|
|
2857
|
-
const
|
|
2858
|
+
const u = h.items.map((v) => v.page).filter(Boolean), x = !!o;
|
|
2858
2859
|
return /* @__PURE__ */ e.jsxs(
|
|
2859
2860
|
"div",
|
|
2860
2861
|
{
|
|
2861
|
-
className: `ds-sources-panel__compact-row${
|
|
2862
|
-
onClick:
|
|
2862
|
+
className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2863
|
+
onClick: x ? () => o(h.items[0]) : void 0,
|
|
2863
2864
|
children: [
|
|
2864
2865
|
/* @__PURE__ */ e.jsx(mt, { size: P[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2865
2866
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2866
|
-
|
|
2867
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ee(u) })
|
|
2867
2868
|
]
|
|
2868
2869
|
},
|
|
2869
2870
|
h.filename
|
|
2870
2871
|
);
|
|
2871
2872
|
}),
|
|
2872
|
-
|
|
2873
|
+
d && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2873
2874
|
"+",
|
|
2874
2875
|
l.length - a,
|
|
2875
2876
|
" more sources"
|
|
@@ -2877,37 +2878,37 @@ function pn({
|
|
|
2877
2878
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2878
2879
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2879
2880
|
c.map((h) => {
|
|
2880
|
-
const
|
|
2881
|
+
const u = h.items.map((v) => v.page).filter(Boolean), x = !!o;
|
|
2881
2882
|
return m ? /* @__PURE__ */ e.jsx(
|
|
2882
2883
|
Be,
|
|
2883
2884
|
{
|
|
2884
|
-
title: /* @__PURE__ */ e.jsx(qt, { filename: h.filename, pages:
|
|
2885
|
+
title: /* @__PURE__ */ e.jsx(qt, { filename: h.filename, pages: u }),
|
|
2885
2886
|
padding: "s",
|
|
2886
|
-
children: h.items.map((
|
|
2887
|
+
children: h.items.map((v, j) => /* @__PURE__ */ e.jsx(
|
|
2887
2888
|
"div",
|
|
2888
2889
|
{
|
|
2889
|
-
className: `ds-sources-panel__snippet${
|
|
2890
|
-
onClick:
|
|
2891
|
-
children:
|
|
2890
|
+
className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2891
|
+
onClick: x ? () => o(v) : void 0,
|
|
2892
|
+
children: v.snippet ?? `p. ${v.page}`
|
|
2892
2893
|
},
|
|
2893
|
-
|
|
2894
|
+
j
|
|
2894
2895
|
))
|
|
2895
2896
|
},
|
|
2896
2897
|
h.filename
|
|
2897
2898
|
) : /* @__PURE__ */ e.jsxs(
|
|
2898
2899
|
"div",
|
|
2899
2900
|
{
|
|
2900
|
-
className: `ds-sources-panel__row${
|
|
2901
|
-
onClick:
|
|
2901
|
+
className: `ds-sources-panel__row${x ? " ds-sources-panel__row--clickable" : ""}`,
|
|
2902
|
+
onClick: x ? () => o(h.items[0]) : void 0,
|
|
2902
2903
|
children: [
|
|
2903
2904
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2904
|
-
|
|
2905
|
+
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: Ee(u) })
|
|
2905
2906
|
]
|
|
2906
2907
|
},
|
|
2907
2908
|
h.filename
|
|
2908
2909
|
);
|
|
2909
2910
|
}),
|
|
2910
|
-
|
|
2911
|
+
d && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => i(!0), children: [
|
|
2911
2912
|
"+",
|
|
2912
2913
|
l.length - a,
|
|
2913
2914
|
" more sources"
|
|
@@ -2926,7 +2927,7 @@ function hn({
|
|
|
2926
2927
|
warningThreshold: r = 0.8,
|
|
2927
2928
|
errorThreshold: i = 1
|
|
2928
2929
|
}) {
|
|
2929
|
-
const l = s > 0 ? t / s : 0,
|
|
2930
|
+
const l = s > 0 ? t / s : 0, d = Math.min(l * 100, 100), c = l >= i ? "error" : l >= r ? "warning" : "normal";
|
|
2930
2931
|
return /* @__PURE__ */ e.jsxs(
|
|
2931
2932
|
"div",
|
|
2932
2933
|
{
|
|
@@ -2939,7 +2940,7 @@ function hn({
|
|
|
2939
2940
|
"div",
|
|
2940
2941
|
{
|
|
2941
2942
|
className: `ds-token-counter__fill ds-token-counter__fill--${c}`,
|
|
2942
|
-
style: { width: `${
|
|
2943
|
+
style: { width: `${d}%` }
|
|
2943
2944
|
}
|
|
2944
2945
|
) }),
|
|
2945
2946
|
(a || o) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${c}`, children: [
|
|
@@ -2974,18 +2975,18 @@ function xn({
|
|
|
2974
2975
|
`ds-confidence-bar--${i}`,
|
|
2975
2976
|
a === "block" && "ds-confidence-bar--block"
|
|
2976
2977
|
].filter(Boolean).join(" "), children: [
|
|
2977
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: He }, (l,
|
|
2978
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: He }, (l, d) => /* @__PURE__ */ e.jsx(
|
|
2978
2979
|
"div",
|
|
2979
2980
|
{
|
|
2980
|
-
className: `ds-confidence-bar__seg${
|
|
2981
|
+
className: `ds-confidence-bar__seg${d < r ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2981
2982
|
},
|
|
2982
|
-
|
|
2983
|
+
d
|
|
2983
2984
|
)) }),
|
|
2984
2985
|
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
2985
2986
|
] });
|
|
2986
2987
|
}
|
|
2987
2988
|
const Gt = { add: "+", remove: "-", context: " " };
|
|
2988
|
-
function
|
|
2989
|
+
function we({ line: t, lineNumbers: s }) {
|
|
2989
2990
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${t.type}`, children: [
|
|
2990
2991
|
s && t.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: t.lineNo }),
|
|
2991
2992
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Gt[t.type] }),
|
|
@@ -3006,18 +3007,18 @@ function vn({
|
|
|
3006
3007
|
n && "ds-diff-view--wrap"
|
|
3007
3008
|
].filter(Boolean).join(" "), l = o ? { maxHeight: o, overflowY: "auto" } : void 0;
|
|
3008
3009
|
if (s === "split") {
|
|
3009
|
-
const
|
|
3010
|
+
const d = t.filter((m) => m.type === "remove" || m.type === "context"), c = t.filter((m) => m.type === "add" || m.type === "context");
|
|
3010
3011
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3011
3012
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
3012
3013
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
|
|
3013
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children:
|
|
3014
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((m, p) => /* @__PURE__ */ e.jsx(
|
|
3014
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: d.map((m, p) => /* @__PURE__ */ e.jsx(we, { line: m, lineNumbers: a }, p)) }),
|
|
3015
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((m, p) => /* @__PURE__ */ e.jsx(we, { line: m, lineNumbers: a }, p)) })
|
|
3015
3016
|
] })
|
|
3016
3017
|
] });
|
|
3017
3018
|
}
|
|
3018
3019
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3019
3020
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
3020
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((
|
|
3021
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((d, c) => /* @__PURE__ */ e.jsx(we, { line: d, lineNumbers: a }, c)) })
|
|
3021
3022
|
] });
|
|
3022
3023
|
}
|
|
3023
3024
|
function Xt({
|
|
@@ -3103,15 +3104,15 @@ function _n({
|
|
|
3103
3104
|
className: i = "",
|
|
3104
3105
|
...l
|
|
3105
3106
|
}) {
|
|
3106
|
-
const
|
|
3107
|
-
return !
|
|
3107
|
+
const d = t === "assistant" && (o || r), c = !!s, m = n ? Jt(n) : null;
|
|
3108
|
+
return !d && !c && !m ? null : /* @__PURE__ */ e.jsxs(
|
|
3108
3109
|
"div",
|
|
3109
3110
|
{
|
|
3110
3111
|
className: ["ds-message-footer", `ds-message-footer--${t}`, i].filter(Boolean).join(" "),
|
|
3111
3112
|
...l,
|
|
3112
3113
|
children: [
|
|
3113
3114
|
t === "user" && m && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: m }),
|
|
3114
|
-
|
|
3115
|
+
d && /* @__PURE__ */ e.jsx(Xt, { className: "ds-message-action", value: a, onLike: o, onDislike: r }),
|
|
3115
3116
|
c && /* @__PURE__ */ e.jsx(Ut, { className: "ds-message-action", text: s }),
|
|
3116
3117
|
t === "assistant" && m && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: m })
|
|
3117
3118
|
]
|
|
@@ -3125,7 +3126,7 @@ function bn({ label: t, className: s = "", ...n }) {
|
|
|
3125
3126
|
] });
|
|
3126
3127
|
}
|
|
3127
3128
|
function jn({ variant: t = "light", glow: s, mask: n = !0, style: a, ...o }) {
|
|
3128
|
-
const r = t === "dark", i = s ?? r, l = r ? "rgba(255,250,250,0.05)" : "var(--color-border-light)",
|
|
3129
|
+
const r = t === "dark", i = s ?? r, l = r ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", d = r ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
3129
3130
|
return /* @__PURE__ */ e.jsx(
|
|
3130
3131
|
"div",
|
|
3131
3132
|
{
|
|
@@ -3150,8 +3151,8 @@ function jn({ variant: t = "light", glow: s, mask: n = !0, style: a, ...o }) {
|
|
|
3150
3151
|
backgroundImage: [
|
|
3151
3152
|
`linear-gradient(${l} 1px, transparent 1px)`,
|
|
3152
3153
|
`linear-gradient(90deg, ${l} 1px, transparent 1px)`,
|
|
3153
|
-
`linear-gradient(${
|
|
3154
|
-
`linear-gradient(90deg, ${
|
|
3154
|
+
`linear-gradient(${d} 1px, transparent 1px)`,
|
|
3155
|
+
`linear-gradient(90deg, ${d} 1px, transparent 1px)`
|
|
3155
3156
|
].join(", "),
|
|
3156
3157
|
backgroundSize: "80px 80px, 80px 80px, 16px 16px, 16px 16px",
|
|
3157
3158
|
backgroundPosition: "-1px -1px, -1px -1px, -1px -1px, -1px -1px",
|
|
@@ -3177,7 +3178,7 @@ function Nn({ children: t, axis: s = "y", style: n, className: a = "", ...o }) {
|
|
|
3177
3178
|
}
|
|
3178
3179
|
);
|
|
3179
3180
|
}
|
|
3180
|
-
const
|
|
3181
|
+
const ge = 280, Zt = 22, Qt = 14, le = 8, be = 6, es = 200;
|
|
3181
3182
|
function ts(t) {
|
|
3182
3183
|
return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
|
|
3183
3184
|
}
|
|
@@ -3192,24 +3193,24 @@ function ss(t, s, n, a) {
|
|
|
3192
3193
|
}
|
|
3193
3194
|
function ns(t, s, n, a, o) {
|
|
3194
3195
|
const r = window.innerWidth, i = window.innerHeight;
|
|
3195
|
-
let l,
|
|
3196
|
+
let l, d;
|
|
3196
3197
|
switch (t) {
|
|
3197
3198
|
case "top":
|
|
3198
|
-
l = s.top - n - o,
|
|
3199
|
+
l = s.top - n - o, d = s.left + s.width / 2 - a / 2;
|
|
3199
3200
|
break;
|
|
3200
3201
|
case "bottom":
|
|
3201
|
-
l = s.bottom + o,
|
|
3202
|
+
l = s.bottom + o, d = s.left + s.width / 2 - a / 2;
|
|
3202
3203
|
break;
|
|
3203
3204
|
case "left":
|
|
3204
|
-
l = s.top + s.height / 2 - n / 2,
|
|
3205
|
+
l = s.top + s.height / 2 - n / 2, d = s.left - a - o;
|
|
3205
3206
|
break;
|
|
3206
3207
|
default:
|
|
3207
|
-
l = s.top + s.height / 2 - n / 2,
|
|
3208
|
+
l = s.top + s.height / 2 - n / 2, d = s.right + o;
|
|
3208
3209
|
}
|
|
3209
|
-
const c = Math.max(le, Math.min(r - a - le,
|
|
3210
|
-
return { top: Math.max(le, Math.min(i - n - le, l)), left: c, arrowOffset:
|
|
3210
|
+
const c = Math.max(le, Math.min(r - a - le, d));
|
|
3211
|
+
return { top: Math.max(le, Math.min(i - n - le, l)), left: c, arrowOffset: d - c };
|
|
3211
3212
|
}
|
|
3212
|
-
function
|
|
3213
|
+
function wn({
|
|
3213
3214
|
steps: t,
|
|
3214
3215
|
currentStep: s,
|
|
3215
3216
|
onNext: n,
|
|
@@ -3218,99 +3219,99 @@ function gn({
|
|
|
3218
3219
|
onFinish: r,
|
|
3219
3220
|
overlay: i = !0,
|
|
3220
3221
|
ring: l = !0,
|
|
3221
|
-
labelNext:
|
|
3222
|
+
labelNext: d = "Next",
|
|
3222
3223
|
labelBack: c = "Back",
|
|
3223
3224
|
labelSkip: m = "Skip tour",
|
|
3224
3225
|
labelFinish: p = "Done",
|
|
3225
3226
|
statePrimary: h = "idle",
|
|
3226
|
-
stateBack:
|
|
3227
|
+
stateBack: u = "idle"
|
|
3227
3228
|
}) {
|
|
3228
|
-
const
|
|
3229
|
-
|
|
3230
|
-
const [
|
|
3231
|
-
const
|
|
3232
|
-
if (!
|
|
3233
|
-
const
|
|
3234
|
-
if (!
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3229
|
+
const x = T(null), v = T(t), j = T(s), E = T(l);
|
|
3230
|
+
v.current = t, j.current = s, E.current = l;
|
|
3231
|
+
const [g, b] = I(!1), [S, L] = I({ position: "fixed", visibility: "hidden", width: ge }), [C, U] = I("bottom"), [K, V] = I(null), w = T(!1), M = t[s], G = s === t.length - 1, F = $e(() => {
|
|
3232
|
+
const A = v.current[j.current];
|
|
3233
|
+
if (!A || !x.current) return;
|
|
3234
|
+
const _ = ts(A.target);
|
|
3235
|
+
if (!_) return;
|
|
3236
|
+
const y = _.getBoundingClientRect(), O = x.current.getBoundingClientRect().height || 160, H = ge, k = E.current ? Zt : Qt, f = A.position || ss(y, O, H, k), { top: $, left: z, arrowOffset: W } = ns(f, y, O, H, k);
|
|
3237
|
+
U(f), L({
|
|
3237
3238
|
position: "fixed",
|
|
3238
3239
|
top: $,
|
|
3239
3240
|
left: z,
|
|
3240
|
-
width:
|
|
3241
|
+
width: ge,
|
|
3241
3242
|
visibility: "visible",
|
|
3242
|
-
"--arrow-offset": `${
|
|
3243
|
-
}),
|
|
3244
|
-
top:
|
|
3245
|
-
left:
|
|
3246
|
-
width:
|
|
3247
|
-
height:
|
|
3243
|
+
"--arrow-offset": `${W}px`
|
|
3244
|
+
}), V({
|
|
3245
|
+
top: y.top - be,
|
|
3246
|
+
left: y.left - be,
|
|
3247
|
+
width: y.width + be * 2,
|
|
3248
|
+
height: y.height + be * 2
|
|
3248
3249
|
});
|
|
3249
3250
|
}, []);
|
|
3250
|
-
return
|
|
3251
|
-
window.addEventListener("scroll",
|
|
3252
|
-
const
|
|
3253
|
-
|
|
3251
|
+
return D(() => {
|
|
3252
|
+
window.addEventListener("scroll", F, !0), window.addEventListener("resize", F);
|
|
3253
|
+
const A = requestAnimationFrame(() => {
|
|
3254
|
+
F(), b(!0), w.current = !0;
|
|
3254
3255
|
});
|
|
3255
3256
|
return () => {
|
|
3256
|
-
cancelAnimationFrame(
|
|
3257
|
+
cancelAnimationFrame(A), window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
3257
3258
|
};
|
|
3258
|
-
}, []),
|
|
3259
|
-
if (!
|
|
3260
|
-
|
|
3261
|
-
const
|
|
3262
|
-
|
|
3263
|
-
|
|
3259
|
+
}, []), D(() => {
|
|
3260
|
+
if (!w.current) return;
|
|
3261
|
+
b(!1);
|
|
3262
|
+
const A = setTimeout(() => {
|
|
3263
|
+
L((_) => ({ ..._, visibility: "hidden" })), requestAnimationFrame(() => {
|
|
3264
|
+
F(), b(!0);
|
|
3264
3265
|
});
|
|
3265
3266
|
}, es + 20);
|
|
3266
|
-
return () => clearTimeout(
|
|
3267
|
-
}, [s]),
|
|
3268
|
-
|
|
3269
|
-
}, [
|
|
3270
|
-
const
|
|
3271
|
-
|
|
3267
|
+
return () => clearTimeout(A);
|
|
3268
|
+
}, [s]), D(() => {
|
|
3269
|
+
g && x.current && x.current.focus({ preventScroll: !0 });
|
|
3270
|
+
}, [g]), D(() => {
|
|
3271
|
+
const A = (_) => {
|
|
3272
|
+
_.key === "Escape" && o();
|
|
3272
3273
|
};
|
|
3273
|
-
return document.addEventListener("keydown",
|
|
3274
|
-
}, [o]),
|
|
3275
|
-
if (!
|
|
3276
|
-
const
|
|
3277
|
-
if (
|
|
3278
|
-
const
|
|
3279
|
-
|
|
3274
|
+
return document.addEventListener("keydown", A), () => document.removeEventListener("keydown", A);
|
|
3275
|
+
}, [o]), D(() => {
|
|
3276
|
+
if (!g) return;
|
|
3277
|
+
const A = (_) => {
|
|
3278
|
+
if (_.key !== "Tab" || !x.current) return;
|
|
3279
|
+
const y = Array.from(
|
|
3280
|
+
x.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
|
|
3280
3281
|
);
|
|
3281
|
-
if (!
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3282
|
+
if (!y.length) return;
|
|
3283
|
+
const R = y[0], O = y[y.length - 1];
|
|
3284
|
+
_.shiftKey && document.activeElement === R ? (_.preventDefault(), O.focus()) : !_.shiftKey && document.activeElement === O && (_.preventDefault(), R.focus());
|
|
3284
3285
|
};
|
|
3285
|
-
return document.addEventListener("keydown",
|
|
3286
|
-
}, [
|
|
3286
|
+
return document.addEventListener("keydown", A), () => document.removeEventListener("keydown", A);
|
|
3287
|
+
}, [g]), !M || typeof document > "u" ? null : pe.createPortal(
|
|
3287
3288
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3288
|
-
|
|
3289
|
+
K && /* @__PURE__ */ e.jsx(
|
|
3289
3290
|
"div",
|
|
3290
3291
|
{
|
|
3291
3292
|
className: [
|
|
3292
3293
|
"ds-coachmark__spotlight",
|
|
3293
3294
|
i && "ds-coachmark__spotlight--overlay",
|
|
3294
3295
|
!l && "ds-coachmark__spotlight--no-ring",
|
|
3295
|
-
|
|
3296
|
+
g && "ds-coachmark__spotlight--visible"
|
|
3296
3297
|
].filter(Boolean).join(" "),
|
|
3297
|
-
style:
|
|
3298
|
+
style: K,
|
|
3298
3299
|
"aria-hidden": "true"
|
|
3299
3300
|
}
|
|
3300
3301
|
),
|
|
3301
3302
|
/* @__PURE__ */ e.jsxs(
|
|
3302
3303
|
"div",
|
|
3303
3304
|
{
|
|
3304
|
-
ref:
|
|
3305
|
+
ref: x,
|
|
3305
3306
|
"data-ds-portal": "",
|
|
3306
3307
|
role: "dialog",
|
|
3307
3308
|
"aria-modal": "false",
|
|
3308
3309
|
"aria-live": "polite",
|
|
3309
|
-
"aria-label":
|
|
3310
|
+
"aria-label": M.title ?? `Step ${s + 1} of ${t.length}`,
|
|
3310
3311
|
className: [
|
|
3311
3312
|
"ds-coachmark__bubble",
|
|
3312
|
-
`ds-coachmark__bubble--${
|
|
3313
|
-
|
|
3313
|
+
`ds-coachmark__bubble--${C}`,
|
|
3314
|
+
g && "ds-coachmark__bubble--visible"
|
|
3314
3315
|
].filter(Boolean).join(" "),
|
|
3315
3316
|
style: S,
|
|
3316
3317
|
tabIndex: -1,
|
|
@@ -3325,8 +3326,8 @@ function gn({
|
|
|
3325
3326
|
children: /* @__PURE__ */ e.jsx(ee, { size: 16, strokeWidth: 2 })
|
|
3326
3327
|
}
|
|
3327
3328
|
),
|
|
3328
|
-
|
|
3329
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children:
|
|
3329
|
+
M.title && /* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__title", children: M.title }),
|
|
3330
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children: M.content }),
|
|
3330
3331
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer", children: [
|
|
3331
3332
|
t.length > 1 && /* @__PURE__ */ e.jsxs("span", { className: "ds-coachmark__counter", children: [
|
|
3332
3333
|
s + 1,
|
|
@@ -3334,8 +3335,8 @@ function gn({
|
|
|
3334
3335
|
t.length
|
|
3335
3336
|
] }),
|
|
3336
3337
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
|
|
3337
|
-
s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state:
|
|
3338
|
-
/* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick:
|
|
3338
|
+
s > 0 && /* @__PURE__ */ e.jsx(ae, { variant: "secondary", size: "s", state: u, onClick: a, children: c }),
|
|
3339
|
+
/* @__PURE__ */ e.jsx(ae, { variant: "primary", size: "s", state: h, onClick: G ? r : n, children: G ? p : d })
|
|
3339
3340
|
] })
|
|
3340
3341
|
] })
|
|
3341
3342
|
]
|
|
@@ -3345,8 +3346,8 @@ function gn({
|
|
|
3345
3346
|
document.body
|
|
3346
3347
|
);
|
|
3347
3348
|
}
|
|
3348
|
-
function
|
|
3349
|
-
const { storageKey: n } = s, [a, o] =
|
|
3349
|
+
function gn(t, s = {}) {
|
|
3350
|
+
const { storageKey: n } = s, [a, o] = I(0), [r, i] = I(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", d = $e(() => {
|
|
3350
3351
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3351
3352
|
}, [n]);
|
|
3352
3353
|
return {
|
|
@@ -3357,12 +3358,12 @@ function wn(t, s = {}) {
|
|
|
3357
3358
|
},
|
|
3358
3359
|
next: () => o((c) => Math.min(c + 1, t.length - 1)),
|
|
3359
3360
|
back: () => o((c) => Math.max(c - 1, 0)),
|
|
3360
|
-
skip:
|
|
3361
|
-
finish:
|
|
3361
|
+
skip: d,
|
|
3362
|
+
finish: d
|
|
3362
3363
|
};
|
|
3363
3364
|
}
|
|
3364
3365
|
function yn() {
|
|
3365
|
-
const t =
|
|
3366
|
+
const t = T(null), s = $e(() => {
|
|
3366
3367
|
const n = t.current;
|
|
3367
3368
|
if (!n) return;
|
|
3368
3369
|
n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
|
|
@@ -3386,7 +3387,7 @@ export {
|
|
|
3386
3387
|
us as Card,
|
|
3387
3388
|
dn as ChatMessage,
|
|
3388
3389
|
Es as Checkbox,
|
|
3389
|
-
|
|
3390
|
+
wn as Coachmark,
|
|
3390
3391
|
js as Code,
|
|
3391
3392
|
yt as CodeAccordion,
|
|
3392
3393
|
xn as ConfidenceBar,
|
|
@@ -3439,13 +3440,13 @@ export {
|
|
|
3439
3440
|
ln as StepIndicator,
|
|
3440
3441
|
ds as Stepper,
|
|
3441
3442
|
cn as StreamingText,
|
|
3442
|
-
|
|
3443
|
+
gs as Tab,
|
|
3443
3444
|
Rs as Table,
|
|
3444
3445
|
As as TableBody,
|
|
3445
3446
|
Ss as TableHead,
|
|
3446
3447
|
Is as TableRow,
|
|
3447
3448
|
Bs as TableSubheaderRow,
|
|
3448
|
-
|
|
3449
|
+
ws as Tabs,
|
|
3449
3450
|
Ls as Td,
|
|
3450
3451
|
ls as Textarea,
|
|
3451
3452
|
Ds as Th,
|
|
@@ -3459,7 +3460,7 @@ export {
|
|
|
3459
3460
|
P as iconSizes,
|
|
3460
3461
|
Mt as useAnimatedNumber,
|
|
3461
3462
|
Vt as useAnimatedPlaceholder,
|
|
3462
|
-
|
|
3463
|
+
gn as useCoachmark,
|
|
3463
3464
|
zt as useInView,
|
|
3464
3465
|
yn as useShake,
|
|
3465
3466
|
un as useStreamScroll,
|