@donkit-ai/design-system 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +400 -400
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import A, { useState as
|
|
1
|
+
import A, { useState as T, useRef as L, useEffect as B } from "react";
|
|
2
2
|
import C from "react-dom";
|
|
3
3
|
import { ChevronDown as K, Minus as ve, Plus as je, XCircle as fe, AlertTriangle as me, CheckCircle as pe, Info as be, X as se, Check as _e, ChevronUp as we, ChevronsUpDown as Ne } from "lucide-react";
|
|
4
|
-
const
|
|
4
|
+
const S = {
|
|
5
5
|
1: 16,
|
|
6
6
|
2: 20,
|
|
7
7
|
3: 24,
|
|
@@ -22,23 +22,23 @@ var le;
|
|
|
22
22
|
function ye() {
|
|
23
23
|
if (le) return G;
|
|
24
24
|
le = 1;
|
|
25
|
-
var
|
|
26
|
-
function
|
|
27
|
-
var
|
|
28
|
-
if (a !== void 0 && (
|
|
25
|
+
var s = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
26
|
+
function r(c, n, a) {
|
|
27
|
+
var i = null;
|
|
28
|
+
if (a !== void 0 && (i = "" + a), n.key !== void 0 && (i = "" + n.key), "key" in n) {
|
|
29
29
|
a = {};
|
|
30
|
-
for (var
|
|
31
|
-
|
|
30
|
+
for (var l in n)
|
|
31
|
+
l !== "key" && (a[l] = n[l]);
|
|
32
32
|
} else a = n;
|
|
33
33
|
return n = a.ref, {
|
|
34
|
-
$$typeof:
|
|
34
|
+
$$typeof: s,
|
|
35
35
|
type: c,
|
|
36
|
-
key:
|
|
36
|
+
key: i,
|
|
37
37
|
ref: n !== void 0 ? n : null,
|
|
38
38
|
props: a
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return G.Fragment = e, G.jsx =
|
|
41
|
+
return G.Fragment = e, G.jsx = r, G.jsxs = r, G;
|
|
42
42
|
}
|
|
43
43
|
var q = {};
|
|
44
44
|
/**
|
|
@@ -53,7 +53,7 @@ var q = {};
|
|
|
53
53
|
var ie;
|
|
54
54
|
function Ee() {
|
|
55
55
|
return ie || (ie = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
|
-
function
|
|
56
|
+
function s(o) {
|
|
57
57
|
if (o == null) return null;
|
|
58
58
|
if (typeof o == "function")
|
|
59
59
|
return o.$$typeof === D ? null : o.displayName || o.name || null;
|
|
@@ -61,11 +61,11 @@ function Ee() {
|
|
|
61
61
|
switch (o) {
|
|
62
62
|
case k:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case g:
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case $:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case I:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case P:
|
|
71
71
|
return "SuspenseList";
|
|
@@ -86,11 +86,11 @@ function Ee() {
|
|
|
86
86
|
var h = o.render;
|
|
87
87
|
return o = o.displayName, o || (o = h.displayName || h.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
88
88
|
case M:
|
|
89
|
-
return h = o.displayName || null, h !== null ? h :
|
|
89
|
+
return h = o.displayName || null, h !== null ? h : s(o.type) || "Memo";
|
|
90
90
|
case U:
|
|
91
91
|
h = o._payload, o = o._init;
|
|
92
92
|
try {
|
|
93
|
-
return
|
|
93
|
+
return s(o(h));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -99,7 +99,7 @@ function Ee() {
|
|
|
99
99
|
function e(o) {
|
|
100
100
|
return "" + o;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function r(o) {
|
|
103
103
|
try {
|
|
104
104
|
e(o);
|
|
105
105
|
var h = !1;
|
|
@@ -121,7 +121,7 @@ function Ee() {
|
|
|
121
121
|
if (typeof o == "object" && o !== null && o.$$typeof === U)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
|
-
var h =
|
|
124
|
+
var h = s(o);
|
|
125
125
|
return h ? "<" + h + ">" : "<...>";
|
|
126
126
|
} catch {
|
|
127
127
|
return "<...>";
|
|
@@ -134,14 +134,14 @@ function Ee() {
|
|
|
134
134
|
function a() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function i(o) {
|
|
138
138
|
if (X.call(o, "key")) {
|
|
139
139
|
var h = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
140
140
|
if (h && h.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return o.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function l(o, h) {
|
|
145
145
|
function N() {
|
|
146
146
|
H || (H = !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)",
|
|
@@ -154,7 +154,7 @@ function Ee() {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
function p() {
|
|
157
|
-
var o =
|
|
157
|
+
var o = s(this.type);
|
|
158
158
|
return ne[o] || (ne[o] = !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
|
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
@@ -206,7 +206,7 @@ function Ee() {
|
|
|
206
206
|
);
|
|
207
207
|
else u(E);
|
|
208
208
|
if (X.call(h, "key")) {
|
|
209
|
-
E =
|
|
209
|
+
E = s(o);
|
|
210
210
|
var Y = Object.keys(h).filter(function(xe) {
|
|
211
211
|
return xe !== "key";
|
|
212
212
|
});
|
|
@@ -223,12 +223,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
E
|
|
224
224
|
), ce[E + y] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (E = null, N !== void 0 && (
|
|
226
|
+
if (E = null, N !== void 0 && (r(N), E = "" + N), i(h) && (r(h.key), E = "" + h.key), "key" in h) {
|
|
227
227
|
N = {};
|
|
228
228
|
for (var Q in h)
|
|
229
229
|
Q !== "key" && (N[Q] = h[Q]);
|
|
230
230
|
} else N = h;
|
|
231
|
-
return E &&
|
|
231
|
+
return E && l(
|
|
232
232
|
N,
|
|
233
233
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
234
234
|
), f(
|
|
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
function x(o) {
|
|
247
247
|
return typeof o == "object" && o !== null && o.$$typeof === j;
|
|
248
248
|
}
|
|
249
|
-
var b = A, j = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"),
|
|
249
|
+
var b = A, j = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), m = Symbol.for("react.consumer"), _ = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), P = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), F = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, re = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
b = {
|
|
@@ -282,30 +282,30 @@ React keys must be passed directly to JSX without using spread:
|
|
|
282
282
|
}()), q;
|
|
283
283
|
}
|
|
284
284
|
process.env.NODE_ENV === "production" ? ee.exports = ye() : ee.exports = Ee();
|
|
285
|
-
var
|
|
285
|
+
var t = ee.exports;
|
|
286
286
|
function ke({
|
|
287
|
-
children:
|
|
287
|
+
children: s,
|
|
288
288
|
variant: e = "primary",
|
|
289
|
-
size:
|
|
289
|
+
size: r = "m",
|
|
290
290
|
fullWidth: c = !1,
|
|
291
291
|
icon: n,
|
|
292
292
|
disabled: a = !1,
|
|
293
|
-
onClick:
|
|
294
|
-
type:
|
|
293
|
+
onClick: i,
|
|
294
|
+
type: l = "button",
|
|
295
295
|
href: p,
|
|
296
296
|
"aria-label": f,
|
|
297
297
|
...d
|
|
298
298
|
}) {
|
|
299
|
-
const u = n && !
|
|
299
|
+
const u = n && !s, x = [
|
|
300
300
|
"ds-button",
|
|
301
301
|
`ds-button--${e}`,
|
|
302
|
-
`ds-button--${
|
|
302
|
+
`ds-button--${r}`,
|
|
303
303
|
c && "ds-button--full",
|
|
304
304
|
u && "ds-button--icon-only"
|
|
305
|
-
].filter(Boolean).join(" "), b = /* @__PURE__ */
|
|
306
|
-
n && !u && /* @__PURE__ */
|
|
307
|
-
|
|
308
|
-
u && /* @__PURE__ */
|
|
305
|
+
].filter(Boolean).join(" "), b = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
306
|
+
n && !u && /* @__PURE__ */ t.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n }),
|
|
307
|
+
s,
|
|
308
|
+
u && /* @__PURE__ */ t.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n })
|
|
309
309
|
] });
|
|
310
310
|
if (p) {
|
|
311
311
|
const j = (v) => {
|
|
@@ -313,9 +313,9 @@ function ke({
|
|
|
313
313
|
v.preventDefault();
|
|
314
314
|
return;
|
|
315
315
|
}
|
|
316
|
-
v.metaKey || v.ctrlKey || v.button === 1 || (v.preventDefault(),
|
|
316
|
+
v.metaKey || v.ctrlKey || v.button === 1 || (v.preventDefault(), i == null || i(v));
|
|
317
317
|
};
|
|
318
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ t.jsx(
|
|
319
319
|
"a",
|
|
320
320
|
{
|
|
321
321
|
className: x,
|
|
@@ -328,13 +328,13 @@ function ke({
|
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
330
|
}
|
|
331
|
-
return /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ t.jsx(
|
|
332
332
|
"button",
|
|
333
333
|
{
|
|
334
|
-
type:
|
|
334
|
+
type: l,
|
|
335
335
|
className: x,
|
|
336
336
|
disabled: a,
|
|
337
|
-
onClick:
|
|
337
|
+
onClick: i,
|
|
338
338
|
"aria-label": f,
|
|
339
339
|
...d,
|
|
340
340
|
children: b
|
|
@@ -342,70 +342,70 @@ function ke({
|
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
344
|
function De({
|
|
345
|
-
label:
|
|
345
|
+
label: s,
|
|
346
346
|
error: e,
|
|
347
|
-
hint:
|
|
347
|
+
hint: r,
|
|
348
348
|
fullWidth: c = !0,
|
|
349
349
|
icon: n,
|
|
350
350
|
iconRight: a,
|
|
351
|
-
onIconRightClick:
|
|
352
|
-
size:
|
|
351
|
+
onIconRightClick: i,
|
|
352
|
+
size: l = "m",
|
|
353
353
|
disabled: p,
|
|
354
354
|
id: f,
|
|
355
355
|
...d
|
|
356
356
|
}) {
|
|
357
|
-
const u = f || `input-${A.useId()}`, x =
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
n && /* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
357
|
+
const u = f || `input-${A.useId()}`, x = r ? `${u}-hint` : void 0, b = e ? `${u}-error` : void 0, j = b || x;
|
|
358
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-input-wrapper ${c ? "ds-input-wrapper--full" : ""} ${p ? "ds-input-wrapper--disabled" : ""}`, children: [
|
|
359
|
+
s && /* @__PURE__ */ t.jsx("label", { className: "ds-input-label", htmlFor: u, children: s }),
|
|
360
|
+
/* @__PURE__ */ t.jsxs("div", { className: "ds-input-container", children: [
|
|
361
|
+
n && /* @__PURE__ */ t.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: n }),
|
|
362
|
+
/* @__PURE__ */ t.jsx(
|
|
363
363
|
"input",
|
|
364
364
|
{
|
|
365
365
|
id: u,
|
|
366
|
-
className: `ds-input ds-input--${
|
|
366
|
+
className: `ds-input ds-input--${l} ${n ? "ds-input--with-icon" : ""} ${a ? "ds-input--with-icon-right" : ""} ${e ? "ds-input--error" : ""}`,
|
|
367
367
|
disabled: p,
|
|
368
368
|
"aria-invalid": e ? "true" : "false",
|
|
369
369
|
"aria-describedby": j,
|
|
370
370
|
...d
|
|
371
371
|
}
|
|
372
372
|
),
|
|
373
|
-
a && /* @__PURE__ */
|
|
373
|
+
a && /* @__PURE__ */ t.jsx(
|
|
374
374
|
"button",
|
|
375
375
|
{
|
|
376
376
|
type: "button",
|
|
377
|
-
className: `ds-input-icon-right ds-input-icon-right--${
|
|
378
|
-
onClick:
|
|
377
|
+
className: `ds-input-icon-right ds-input-icon-right--${l}`,
|
|
378
|
+
onClick: i,
|
|
379
379
|
tabIndex: -1,
|
|
380
380
|
"aria-label": "Toggle visibility",
|
|
381
381
|
children: a
|
|
382
382
|
}
|
|
383
383
|
)
|
|
384
384
|
] }),
|
|
385
|
-
|
|
386
|
-
e && /* @__PURE__ */
|
|
385
|
+
r && !e && /* @__PURE__ */ t.jsx("span", { id: x, className: "ds-input-hint", children: r }),
|
|
386
|
+
e && /* @__PURE__ */ t.jsx("span", { id: b, className: "ds-input-error", role: "alert", children: e })
|
|
387
387
|
] });
|
|
388
388
|
}
|
|
389
389
|
function Me({
|
|
390
|
-
label:
|
|
390
|
+
label: s,
|
|
391
391
|
error: e,
|
|
392
|
-
hint:
|
|
392
|
+
hint: r,
|
|
393
393
|
fullWidth: c = !0,
|
|
394
394
|
size: n = "m",
|
|
395
395
|
disabled: a,
|
|
396
|
-
id:
|
|
397
|
-
resize:
|
|
396
|
+
id: i,
|
|
397
|
+
resize: l = !0,
|
|
398
398
|
rows: p = 3,
|
|
399
399
|
...f
|
|
400
400
|
}) {
|
|
401
|
-
const d =
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
|
|
404
|
-
/* @__PURE__ */
|
|
401
|
+
const d = i || `textarea-${A.useId()}`, u = r ? `${d}-hint` : void 0, x = e ? `${d}-error` : void 0, b = x || u;
|
|
402
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-textarea-wrapper ${c ? "ds-textarea-wrapper--full" : ""} ${a ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
403
|
+
s && /* @__PURE__ */ t.jsx("label", { className: "ds-textarea-label", htmlFor: d, children: s }),
|
|
404
|
+
/* @__PURE__ */ t.jsx(
|
|
405
405
|
"textarea",
|
|
406
406
|
{
|
|
407
407
|
id: d,
|
|
408
|
-
className: `ds-textarea ds-textarea--${n} ${e ? "ds-textarea--error" : ""} ${
|
|
408
|
+
className: `ds-textarea ds-textarea--${n} ${e ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
409
409
|
disabled: a,
|
|
410
410
|
"aria-invalid": e ? "true" : "false",
|
|
411
411
|
"aria-describedby": b,
|
|
@@ -413,24 +413,24 @@ function Me({
|
|
|
413
413
|
...f
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
|
-
|
|
417
|
-
e && /* @__PURE__ */
|
|
416
|
+
r && !e && /* @__PURE__ */ t.jsx("span", { id: u, className: "ds-textarea-hint", children: r }),
|
|
417
|
+
e && /* @__PURE__ */ t.jsx("span", { id: x, className: "ds-textarea-error", role: "alert", children: e })
|
|
418
418
|
] });
|
|
419
419
|
}
|
|
420
420
|
function Fe({
|
|
421
|
-
label:
|
|
421
|
+
label: s,
|
|
422
422
|
value: e,
|
|
423
|
-
onChange:
|
|
423
|
+
onChange: r,
|
|
424
424
|
options: c = [],
|
|
425
425
|
placeholder: n = "Select option",
|
|
426
426
|
error: a,
|
|
427
|
-
fullWidth:
|
|
428
|
-
size:
|
|
427
|
+
fullWidth: i = !0,
|
|
428
|
+
size: l = "m",
|
|
429
429
|
disabled: p = !1,
|
|
430
430
|
id: f,
|
|
431
431
|
...d
|
|
432
432
|
}) {
|
|
433
|
-
const [u, x] =
|
|
433
|
+
const [u, x] = T(!1), [b, j] = T({}), [v, k] = T("down"), $ = L(null), g = L(null), m = f || `select-${A.useId()}`, _ = `${m}-label`, R = a ? `${m}-error` : void 0, I = () => {
|
|
434
434
|
var H;
|
|
435
435
|
const w = (H = $.current) == null ? void 0 : H.getBoundingClientRect();
|
|
436
436
|
if (!w) return;
|
|
@@ -441,32 +441,32 @@ function Fe({
|
|
|
441
441
|
};
|
|
442
442
|
B(() => {
|
|
443
443
|
if (u)
|
|
444
|
-
return
|
|
445
|
-
window.removeEventListener("scroll",
|
|
444
|
+
return I(), window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
|
|
445
|
+
window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
|
|
446
446
|
};
|
|
447
447
|
}, [u]), B(() => {
|
|
448
448
|
const w = (D) => {
|
|
449
|
-
$.current && !$.current.contains(D.target) &&
|
|
449
|
+
$.current && !$.current.contains(D.target) && g.current && !g.current.contains(D.target) && x(!1);
|
|
450
450
|
};
|
|
451
451
|
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
452
452
|
}, []);
|
|
453
|
-
const P = c.find((w) => w.value === e), M =
|
|
453
|
+
const P = c.find((w) => w.value === e), M = l === "xs" ? S[1] : l === "small" ? S[2] : S[3], U = u && /* @__PURE__ */ t.jsx(
|
|
454
454
|
"div",
|
|
455
455
|
{
|
|
456
|
-
ref:
|
|
456
|
+
ref: g,
|
|
457
457
|
role: "listbox",
|
|
458
|
-
"aria-labelledby":
|
|
459
|
-
className: `ds-select-dropdown ds-select-dropdown--${
|
|
458
|
+
"aria-labelledby": s ? _ : void 0,
|
|
459
|
+
className: `ds-select-dropdown ds-select-dropdown--${l} ds-select-dropdown--${v}`,
|
|
460
460
|
style: b,
|
|
461
|
-
children: c.map((w) => /* @__PURE__ */
|
|
461
|
+
children: c.map((w) => /* @__PURE__ */ t.jsx(
|
|
462
462
|
"button",
|
|
463
463
|
{
|
|
464
464
|
type: "button",
|
|
465
465
|
role: "option",
|
|
466
466
|
"aria-selected": e === w.value,
|
|
467
|
-
className: `ds-select-option ds-select-option--${
|
|
467
|
+
className: `ds-select-option ds-select-option--${l} ${e === w.value ? "ds-select-option--selected" : ""}`,
|
|
468
468
|
onClick: () => {
|
|
469
|
-
|
|
469
|
+
r == null || r(w.value), x(!1);
|
|
470
470
|
},
|
|
471
471
|
children: w.label
|
|
472
472
|
},
|
|
@@ -474,9 +474,9 @@ function Fe({
|
|
|
474
474
|
))
|
|
475
475
|
}
|
|
476
476
|
);
|
|
477
|
-
return /* @__PURE__ */
|
|
478
|
-
|
|
479
|
-
/* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${p ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
478
|
+
s && /* @__PURE__ */ t.jsx("label", { id: _, className: "ds-select-label", children: s }),
|
|
479
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-select-container", ref: $, children: /* @__PURE__ */ t.jsxs(
|
|
480
480
|
"button",
|
|
481
481
|
{
|
|
482
482
|
type: "button",
|
|
@@ -484,16 +484,16 @@ function Fe({
|
|
|
484
484
|
role: "combobox",
|
|
485
485
|
"aria-haspopup": "listbox",
|
|
486
486
|
"aria-expanded": u,
|
|
487
|
-
"aria-labelledby":
|
|
487
|
+
"aria-labelledby": s ? _ : void 0,
|
|
488
488
|
"aria-invalid": a ? "true" : "false",
|
|
489
489
|
"aria-describedby": R,
|
|
490
|
-
className: `ds-select-trigger ds-select-trigger--${
|
|
490
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${a ? "ds-select-trigger--error" : ""}`,
|
|
491
491
|
onClick: () => !p && x(!u),
|
|
492
492
|
disabled: p,
|
|
493
493
|
...d,
|
|
494
494
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ t.jsx("span", { className: P ? "" : "ds-select-placeholder", children: (P == null ? void 0 : P.label) || n }),
|
|
496
|
+
/* @__PURE__ */ t.jsx(
|
|
497
497
|
K,
|
|
498
498
|
{
|
|
499
499
|
size: M,
|
|
@@ -505,67 +505,67 @@ function Fe({
|
|
|
505
505
|
]
|
|
506
506
|
}
|
|
507
507
|
) }),
|
|
508
|
-
a && /* @__PURE__ */
|
|
508
|
+
a && /* @__PURE__ */ t.jsx("span", { id: R, className: "ds-select-error", role: "alert", children: a }),
|
|
509
509
|
typeof document < "u" && C.createPortal(U, document.body)
|
|
510
510
|
] });
|
|
511
511
|
}
|
|
512
512
|
function We({
|
|
513
|
-
label:
|
|
513
|
+
label: s,
|
|
514
514
|
value: e = 0,
|
|
515
|
-
onChange:
|
|
515
|
+
onChange: r,
|
|
516
516
|
min: c = 0,
|
|
517
517
|
max: n = 100,
|
|
518
518
|
step: a = 1,
|
|
519
|
-
size:
|
|
520
|
-
disabled:
|
|
519
|
+
size: i = "m",
|
|
520
|
+
disabled: l = !1,
|
|
521
521
|
hint: p,
|
|
522
522
|
error: f,
|
|
523
523
|
...d
|
|
524
524
|
}) {
|
|
525
525
|
const u = () => {
|
|
526
|
-
if (
|
|
526
|
+
if (l) return;
|
|
527
527
|
const $ = Math.min(Number(e) + a, n);
|
|
528
|
-
|
|
528
|
+
r == null || r($);
|
|
529
529
|
}, x = () => {
|
|
530
|
-
if (
|
|
530
|
+
if (l) return;
|
|
531
531
|
const $ = Math.max(Number(e) - a, c);
|
|
532
|
-
|
|
532
|
+
r == null || r($);
|
|
533
533
|
}, b = ($) => {
|
|
534
|
-
if (
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
|
|
534
|
+
if (l) return;
|
|
535
|
+
const g = $.target.value;
|
|
536
|
+
if (g === "") {
|
|
537
|
+
r == null || r(c);
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
|
-
const m = Number(
|
|
540
|
+
const m = Number(g);
|
|
541
541
|
if (!isNaN(m)) {
|
|
542
542
|
const _ = Math.min(Math.max(m, c), n);
|
|
543
|
-
|
|
543
|
+
r == null || r(_);
|
|
544
544
|
}
|
|
545
545
|
}, j = [
|
|
546
546
|
"ds-stepper-wrapper",
|
|
547
|
-
|
|
547
|
+
l && "ds-stepper-wrapper--disabled",
|
|
548
548
|
f && "ds-stepper-wrapper--error"
|
|
549
549
|
].filter(Boolean).join(" "), v = [
|
|
550
550
|
"ds-stepper",
|
|
551
|
-
`ds-stepper--${
|
|
552
|
-
|
|
553
|
-
].filter(Boolean).join(" "), k =
|
|
554
|
-
return /* @__PURE__ */
|
|
555
|
-
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
551
|
+
`ds-stepper--${i}`,
|
|
552
|
+
l && "ds-stepper--disabled"
|
|
553
|
+
].filter(Boolean).join(" "), k = i === "xs" ? S[1] : i === "small" ? S[2] : S[3];
|
|
554
|
+
return /* @__PURE__ */ t.jsxs("div", { className: j, children: [
|
|
555
|
+
s && /* @__PURE__ */ t.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
556
|
+
/* @__PURE__ */ t.jsxs("div", { className: v, children: [
|
|
557
|
+
/* @__PURE__ */ t.jsx(
|
|
558
558
|
"button",
|
|
559
559
|
{
|
|
560
560
|
type: "button",
|
|
561
561
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
562
562
|
onClick: x,
|
|
563
|
-
disabled:
|
|
563
|
+
disabled: l || e <= c,
|
|
564
564
|
"aria-label": "Decrease",
|
|
565
|
-
children: /* @__PURE__ */
|
|
565
|
+
children: /* @__PURE__ */ t.jsx(ve, { size: k, strokeWidth: 1.5 })
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ t.jsx(
|
|
569
569
|
"input",
|
|
570
570
|
{
|
|
571
571
|
type: "number",
|
|
@@ -575,112 +575,112 @@ function We({
|
|
|
575
575
|
min: c,
|
|
576
576
|
max: n,
|
|
577
577
|
step: a,
|
|
578
|
-
disabled:
|
|
578
|
+
disabled: l,
|
|
579
579
|
...d
|
|
580
580
|
}
|
|
581
581
|
),
|
|
582
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ t.jsx(
|
|
583
583
|
"button",
|
|
584
584
|
{
|
|
585
585
|
type: "button",
|
|
586
586
|
className: "ds-stepper-button ds-stepper-button--plus",
|
|
587
587
|
onClick: u,
|
|
588
|
-
disabled:
|
|
588
|
+
disabled: l || e >= n,
|
|
589
589
|
"aria-label": "Increase",
|
|
590
|
-
children: /* @__PURE__ */
|
|
590
|
+
children: /* @__PURE__ */ t.jsx(je, { size: k, strokeWidth: 1.5 })
|
|
591
591
|
}
|
|
592
592
|
)
|
|
593
593
|
] }),
|
|
594
|
-
p && !f && /* @__PURE__ */
|
|
595
|
-
f && /* @__PURE__ */
|
|
594
|
+
p && !f && /* @__PURE__ */ t.jsx("div", { className: "ds-stepper-hint", children: p }),
|
|
595
|
+
f && /* @__PURE__ */ t.jsx("div", { className: "ds-stepper-error", children: f })
|
|
596
596
|
] });
|
|
597
597
|
}
|
|
598
598
|
function Ye({
|
|
599
|
-
children:
|
|
599
|
+
children: s,
|
|
600
600
|
padding: e = "m",
|
|
601
|
-
variant:
|
|
601
|
+
variant: r = "info",
|
|
602
602
|
hover: c = !1,
|
|
603
603
|
// deprecated, use variant="interactive"
|
|
604
604
|
onClick: n,
|
|
605
605
|
href: a,
|
|
606
|
-
disabled:
|
|
607
|
-
...
|
|
606
|
+
disabled: i = !1,
|
|
607
|
+
...l
|
|
608
608
|
}) {
|
|
609
|
-
const f = (c ? "interactive" :
|
|
609
|
+
const f = (c ? "interactive" : r) === "interactive" || n || a, d = [
|
|
610
610
|
"ds-card",
|
|
611
611
|
`ds-card--${e}`,
|
|
612
612
|
f && "ds-card--interactive"
|
|
613
613
|
].filter(Boolean).join(" ");
|
|
614
614
|
if (a) {
|
|
615
615
|
const b = (j) => {
|
|
616
|
-
if (
|
|
616
|
+
if (i) {
|
|
617
617
|
j.preventDefault();
|
|
618
618
|
return;
|
|
619
619
|
}
|
|
620
620
|
j.metaKey || j.ctrlKey || j.button === 1 || (j.preventDefault(), n == null || n(j));
|
|
621
621
|
};
|
|
622
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ t.jsx(
|
|
623
623
|
"a",
|
|
624
624
|
{
|
|
625
625
|
className: d,
|
|
626
|
-
href:
|
|
626
|
+
href: i ? void 0 : a,
|
|
627
627
|
onClick: b,
|
|
628
|
-
"aria-disabled":
|
|
629
|
-
...
|
|
630
|
-
children:
|
|
628
|
+
"aria-disabled": i ? "true" : void 0,
|
|
629
|
+
...l,
|
|
630
|
+
children: s
|
|
631
631
|
}
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
634
|
const u = f && n ? "button" : "div", x = f && n ? {
|
|
635
635
|
type: "button",
|
|
636
636
|
onClick: n,
|
|
637
|
-
disabled:
|
|
637
|
+
disabled: i
|
|
638
638
|
} : {};
|
|
639
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ t.jsx(
|
|
640
640
|
u,
|
|
641
641
|
{
|
|
642
642
|
className: d,
|
|
643
643
|
role: f && !n ? "article" : void 0,
|
|
644
644
|
...x,
|
|
645
|
-
...
|
|
646
|
-
children:
|
|
645
|
+
...l,
|
|
646
|
+
children: s
|
|
647
647
|
}
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
|
-
function ze({ children:
|
|
651
|
-
return /* @__PURE__ */
|
|
650
|
+
function ze({ children: s, ...e }) {
|
|
651
|
+
return /* @__PURE__ */ t.jsx("h1", { className: "ds-h1", ...e, children: s });
|
|
652
652
|
}
|
|
653
|
-
function Ve({ children:
|
|
654
|
-
return /* @__PURE__ */
|
|
653
|
+
function Ve({ children: s, ...e }) {
|
|
654
|
+
return /* @__PURE__ */ t.jsx("h2", { className: "ds-h2", ...e, children: s });
|
|
655
655
|
}
|
|
656
|
-
function Ue({ children:
|
|
657
|
-
return /* @__PURE__ */
|
|
656
|
+
function Ue({ children: s, ...e }) {
|
|
657
|
+
return /* @__PURE__ */ t.jsx("h3", { className: "ds-h3", ...e, children: s });
|
|
658
658
|
}
|
|
659
|
-
function He({ children:
|
|
660
|
-
return /* @__PURE__ */
|
|
659
|
+
function He({ children: s, ...e }) {
|
|
660
|
+
return /* @__PURE__ */ t.jsx("h4", { className: "ds-h4", ...e, children: s });
|
|
661
661
|
}
|
|
662
|
-
function Ge({ children:
|
|
663
|
-
return /* @__PURE__ */
|
|
662
|
+
function Ge({ children: s, secondary: e = !1, ...r }) {
|
|
663
|
+
return /* @__PURE__ */ t.jsx("p", { className: `ds-p1 ${e ? "ds-p1--secondary" : ""}`, ...r, children: s });
|
|
664
664
|
}
|
|
665
|
-
function qe({ children:
|
|
666
|
-
return /* @__PURE__ */
|
|
665
|
+
function qe({ children: s, secondary: e = !1, ...r }) {
|
|
666
|
+
return /* @__PURE__ */ t.jsx("p", { className: `ds-p2 ${e ? "ds-p2--secondary" : ""}`, ...r, children: s });
|
|
667
667
|
}
|
|
668
|
-
function Xe({ children:
|
|
669
|
-
return /* @__PURE__ */
|
|
668
|
+
function Xe({ children: s, secondary: e = !1, ...r }) {
|
|
669
|
+
return /* @__PURE__ */ t.jsx("p", { className: `ds-p3 ${e ? "ds-p3--secondary" : ""}`, ...r, children: s });
|
|
670
670
|
}
|
|
671
671
|
function Je({
|
|
672
|
-
children:
|
|
672
|
+
children: s,
|
|
673
673
|
variant: e = "default",
|
|
674
|
-
size:
|
|
674
|
+
size: r = "m",
|
|
675
675
|
role: c,
|
|
676
676
|
...n
|
|
677
677
|
}) {
|
|
678
678
|
const a = [
|
|
679
679
|
"ds-badge",
|
|
680
680
|
`ds-badge--${e}`,
|
|
681
|
-
`ds-badge--${
|
|
682
|
-
].filter(Boolean).join(" "),
|
|
683
|
-
return /* @__PURE__ */
|
|
681
|
+
`ds-badge--${r}`
|
|
682
|
+
].filter(Boolean).join(" "), i = c || (["info", "success", "warning", "error"].includes(e) ? "status" : void 0);
|
|
683
|
+
return /* @__PURE__ */ t.jsx("span", { className: a, role: i, ...n, children: s });
|
|
684
684
|
}
|
|
685
685
|
const $e = {
|
|
686
686
|
info: be,
|
|
@@ -689,101 +689,101 @@ const $e = {
|
|
|
689
689
|
error: fe
|
|
690
690
|
};
|
|
691
691
|
function Ce({
|
|
692
|
-
children:
|
|
692
|
+
children: s,
|
|
693
693
|
variant: e = "info",
|
|
694
|
-
title:
|
|
694
|
+
title: r,
|
|
695
695
|
onClose: c,
|
|
696
696
|
role: n,
|
|
697
697
|
...a
|
|
698
698
|
}) {
|
|
699
|
-
const
|
|
700
|
-
return /* @__PURE__ */
|
|
701
|
-
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
|
|
704
|
-
|
|
699
|
+
const i = $e[e], l = n || (e === "error" ? "alert" : "status");
|
|
700
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-alert ds-alert--${e} ${r ? "" : "ds-alert--no-title"}`, role: l, ...a, children: [
|
|
701
|
+
i && /* @__PURE__ */ t.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ t.jsx(i, { size: S[3], strokeWidth: 1.5 }) }),
|
|
702
|
+
/* @__PURE__ */ t.jsxs("div", { className: "ds-alert__content", children: [
|
|
703
|
+
r && /* @__PURE__ */ t.jsx("div", { className: "ds-alert__title", children: r }),
|
|
704
|
+
s && /* @__PURE__ */ t.jsx("div", { className: "ds-alert__message", children: s })
|
|
705
705
|
] }),
|
|
706
|
-
c && /* @__PURE__ */
|
|
706
|
+
c && /* @__PURE__ */ t.jsx(
|
|
707
707
|
"button",
|
|
708
708
|
{
|
|
709
709
|
type: "button",
|
|
710
710
|
className: "ds-alert__close",
|
|
711
711
|
onClick: c,
|
|
712
712
|
"aria-label": "Close alert",
|
|
713
|
-
children: /* @__PURE__ */
|
|
713
|
+
children: /* @__PURE__ */ t.jsx(se, { size: S[3], strokeWidth: 1.5 })
|
|
714
714
|
}
|
|
715
715
|
)
|
|
716
716
|
] });
|
|
717
717
|
}
|
|
718
718
|
function Ke({
|
|
719
|
-
children:
|
|
719
|
+
children: s,
|
|
720
720
|
title: e,
|
|
721
|
-
onClose:
|
|
721
|
+
onClose: r,
|
|
722
722
|
size: c = "m",
|
|
723
723
|
...n
|
|
724
724
|
}) {
|
|
725
|
-
const a = L(null),
|
|
725
|
+
const a = L(null), i = A.useId();
|
|
726
726
|
B(() => {
|
|
727
727
|
const d = (x) => {
|
|
728
|
-
x.key === "Escape" && (
|
|
728
|
+
x.key === "Escape" && (r == null || r());
|
|
729
729
|
}, u = (x) => {
|
|
730
|
-
a.current && !a.current.contains(x.target) && (
|
|
730
|
+
a.current && !a.current.contains(x.target) && (r == null || r());
|
|
731
731
|
};
|
|
732
732
|
return document.addEventListener("keydown", d), document.addEventListener("mousedown", u), () => {
|
|
733
733
|
document.removeEventListener("keydown", d), document.removeEventListener("mousedown", u);
|
|
734
734
|
};
|
|
735
|
-
}, [
|
|
736
|
-
const
|
|
737
|
-
return /* @__PURE__ */
|
|
735
|
+
}, [r]);
|
|
736
|
+
const l = A.Children.toArray(s), p = l.find((d) => (d == null ? void 0 : d.type) === de), f = l.filter((d) => (d == null ? void 0 : d.type) !== de);
|
|
737
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-modal-overlay", ...n, children: /* @__PURE__ */ t.jsxs(
|
|
738
738
|
"div",
|
|
739
739
|
{
|
|
740
740
|
className: `ds-modal ds-modal--${c}`,
|
|
741
741
|
ref: a,
|
|
742
742
|
role: "dialog",
|
|
743
743
|
"aria-modal": "true",
|
|
744
|
-
"aria-labelledby": e ?
|
|
744
|
+
"aria-labelledby": e ? i : void 0,
|
|
745
745
|
children: [
|
|
746
|
-
(e ||
|
|
747
|
-
e && /* @__PURE__ */
|
|
748
|
-
|
|
746
|
+
(e || r) && /* @__PURE__ */ t.jsxs("div", { className: "ds-modal__header", children: [
|
|
747
|
+
e && /* @__PURE__ */ t.jsx("h3", { id: i, className: "ds-modal__title", children: e }),
|
|
748
|
+
r && /* @__PURE__ */ t.jsx(
|
|
749
749
|
ke,
|
|
750
750
|
{
|
|
751
751
|
variant: "ghost",
|
|
752
752
|
size: "small",
|
|
753
|
-
icon: /* @__PURE__ */
|
|
754
|
-
onClick:
|
|
753
|
+
icon: /* @__PURE__ */ t.jsx(se, { size: S[2], strokeWidth: 1.5 }),
|
|
754
|
+
onClick: r,
|
|
755
755
|
"aria-label": "Close modal"
|
|
756
756
|
}
|
|
757
757
|
)
|
|
758
758
|
] }),
|
|
759
|
-
/* @__PURE__ */
|
|
759
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-modal__body", children: f }),
|
|
760
760
|
p
|
|
761
761
|
]
|
|
762
762
|
}
|
|
763
763
|
) });
|
|
764
764
|
}
|
|
765
|
-
function de({ children:
|
|
766
|
-
return /* @__PURE__ */
|
|
765
|
+
function de({ children: s }) {
|
|
766
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-modal__footer", children: s });
|
|
767
767
|
}
|
|
768
768
|
function Re({
|
|
769
|
-
children:
|
|
769
|
+
children: s,
|
|
770
770
|
title: e = "Code",
|
|
771
|
-
defaultExpanded:
|
|
771
|
+
defaultExpanded: r = !1,
|
|
772
772
|
expanded: c,
|
|
773
773
|
onToggle: n,
|
|
774
774
|
padding: a = "s",
|
|
775
|
-
className:
|
|
776
|
-
...
|
|
775
|
+
className: i = "",
|
|
776
|
+
...l
|
|
777
777
|
}) {
|
|
778
|
-
const [p, f] =
|
|
778
|
+
const [p, f] = T(r), d = c !== void 0, u = d ? c : p, x = () => {
|
|
779
779
|
d ? n == null || n(!c) : f((j) => !j);
|
|
780
780
|
}, b = [
|
|
781
781
|
"ds-code-accordion",
|
|
782
782
|
`ds-code-accordion--${a}`,
|
|
783
|
-
|
|
783
|
+
i
|
|
784
784
|
].filter(Boolean).join(" ");
|
|
785
|
-
return /* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ t.jsxs("div", { className: b, ...l, children: [
|
|
786
|
+
/* @__PURE__ */ t.jsxs(
|
|
787
787
|
"button",
|
|
788
788
|
{
|
|
789
789
|
type: "button",
|
|
@@ -791,11 +791,11 @@ function Re({
|
|
|
791
791
|
onClick: x,
|
|
792
792
|
"aria-expanded": u,
|
|
793
793
|
children: [
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-code-accordion__title", children: e }),
|
|
795
|
+
/* @__PURE__ */ t.jsx(
|
|
796
796
|
K,
|
|
797
797
|
{
|
|
798
|
-
size:
|
|
798
|
+
size: S[2],
|
|
799
799
|
strokeWidth: 1.5,
|
|
800
800
|
className: `ds-code-accordion__icon ${u ? "ds-code-accordion__icon--expanded" : ""}`
|
|
801
801
|
}
|
|
@@ -803,70 +803,70 @@ function Re({
|
|
|
803
803
|
]
|
|
804
804
|
}
|
|
805
805
|
),
|
|
806
|
-
u && /* @__PURE__ */
|
|
806
|
+
u && /* @__PURE__ */ t.jsx("pre", { className: "ds-code-accordion__content", children: /* @__PURE__ */ t.jsx("code", { children: s }) })
|
|
807
807
|
] });
|
|
808
808
|
}
|
|
809
|
-
function Ze({ children:
|
|
810
|
-
return e ?
|
|
809
|
+
function Ze({ children: s, block: e = !1, collapsible: r = !1, title: c = "Code", defaultExpanded: n = !1, ...a }) {
|
|
810
|
+
return e ? r ? /* @__PURE__ */ t.jsx(Re, { title: c, defaultExpanded: n, ...a, children: s }) : /* @__PURE__ */ t.jsx("pre", { className: "ds-code-block", ...a, children: /* @__PURE__ */ t.jsx("code", { children: s }) }) : /* @__PURE__ */ t.jsx("code", { className: "ds-code-inline", ...a, children: s });
|
|
811
811
|
}
|
|
812
|
-
function Qe({ href:
|
|
813
|
-
const
|
|
814
|
-
return /* @__PURE__ */
|
|
812
|
+
function Qe({ href: s, children: e, onClick: r, target: c, rel: n, ...a }) {
|
|
813
|
+
const l = c === "_blank" ? n ? `${n} noopener noreferrer` : "noopener noreferrer" : n;
|
|
814
|
+
return /* @__PURE__ */ t.jsx(
|
|
815
815
|
"a",
|
|
816
816
|
{
|
|
817
|
-
href:
|
|
817
|
+
href: s,
|
|
818
818
|
className: "ds-link",
|
|
819
|
-
onClick:
|
|
819
|
+
onClick: r,
|
|
820
820
|
target: c,
|
|
821
|
-
rel:
|
|
821
|
+
rel: l,
|
|
822
822
|
...a,
|
|
823
823
|
children: e
|
|
824
824
|
}
|
|
825
825
|
);
|
|
826
826
|
}
|
|
827
|
-
function et({ children:
|
|
828
|
-
return /* @__PURE__ */
|
|
827
|
+
function et({ children: s, size: e = "m", variant: r = "ghost", ...c }) {
|
|
828
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-tabs", role: "tablist", ...c, children: A.Children.map(s, (n) => A.isValidElement(n) ? A.cloneElement(n, { size: e, variant: r }) : n) });
|
|
829
829
|
}
|
|
830
|
-
function tt({ children:
|
|
831
|
-
const f =
|
|
830
|
+
function tt({ children: s, selected: e = !1, onClick: r, size: c = "m", variant: n = "ghost", disabled: a = !1, icon: i, href: l, ...p }) {
|
|
831
|
+
const f = i && !s, d = [
|
|
832
832
|
"ds-tab",
|
|
833
833
|
`ds-tab--${c}`,
|
|
834
834
|
`ds-tab--${n}`,
|
|
835
835
|
e && "ds-tab--selected",
|
|
836
836
|
f && "ds-tab--icon-only"
|
|
837
|
-
].filter(Boolean).join(" "), u = /* @__PURE__ */
|
|
838
|
-
|
|
839
|
-
|
|
837
|
+
].filter(Boolean).join(" "), u = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
838
|
+
i && /* @__PURE__ */ t.jsx("span", { className: "ds-tab-icon", children: i }),
|
|
839
|
+
s
|
|
840
840
|
] });
|
|
841
|
-
if (
|
|
841
|
+
if (l) {
|
|
842
842
|
const x = (b) => {
|
|
843
843
|
if (a) {
|
|
844
844
|
b.preventDefault();
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
|
-
b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(),
|
|
847
|
+
b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(), r == null || r(b));
|
|
848
848
|
};
|
|
849
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ t.jsx(
|
|
850
850
|
"a",
|
|
851
851
|
{
|
|
852
852
|
role: "tab",
|
|
853
853
|
"aria-current": e ? "page" : void 0,
|
|
854
854
|
"aria-disabled": a ? "true" : void 0,
|
|
855
855
|
className: d,
|
|
856
|
-
href: a ? void 0 :
|
|
856
|
+
href: a ? void 0 : l,
|
|
857
857
|
onClick: x,
|
|
858
858
|
...p,
|
|
859
859
|
children: u
|
|
860
860
|
}
|
|
861
861
|
);
|
|
862
862
|
}
|
|
863
|
-
return /* @__PURE__ */
|
|
863
|
+
return /* @__PURE__ */ t.jsx(
|
|
864
864
|
"button",
|
|
865
865
|
{
|
|
866
866
|
role: "tab",
|
|
867
867
|
"aria-selected": e,
|
|
868
868
|
className: d,
|
|
869
|
-
onClick:
|
|
869
|
+
onClick: r,
|
|
870
870
|
disabled: a,
|
|
871
871
|
...p,
|
|
872
872
|
children: u
|
|
@@ -874,22 +874,22 @@ function tt({ children: t, selected: e = !1, onClick: s, size: c = "m", variant:
|
|
|
874
874
|
);
|
|
875
875
|
}
|
|
876
876
|
function st({
|
|
877
|
-
children:
|
|
877
|
+
children: s,
|
|
878
878
|
title: e,
|
|
879
|
-
defaultExpanded:
|
|
879
|
+
defaultExpanded: r = !1,
|
|
880
880
|
expanded: c,
|
|
881
881
|
onToggle: n,
|
|
882
882
|
padding: a = "m",
|
|
883
|
-
...
|
|
883
|
+
...i
|
|
884
884
|
}) {
|
|
885
|
-
const [
|
|
885
|
+
const [l, p] = T(r), f = c !== void 0, d = f ? c : l, u = () => {
|
|
886
886
|
f ? n == null || n(!c) : p((b) => !b);
|
|
887
887
|
}, x = [
|
|
888
888
|
"ds-accordion",
|
|
889
889
|
`ds-accordion--${a}`
|
|
890
890
|
].filter(Boolean).join(" ");
|
|
891
|
-
return /* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ t.jsxs("div", { className: x, ...i, children: [
|
|
892
|
+
/* @__PURE__ */ t.jsxs(
|
|
893
893
|
"button",
|
|
894
894
|
{
|
|
895
895
|
type: "button",
|
|
@@ -897,11 +897,11 @@ function st({
|
|
|
897
897
|
onClick: u,
|
|
898
898
|
"aria-expanded": d,
|
|
899
899
|
children: [
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-accordion__title", children: e }),
|
|
901
|
+
/* @__PURE__ */ t.jsx(
|
|
902
902
|
K,
|
|
903
903
|
{
|
|
904
|
-
size:
|
|
904
|
+
size: S[2],
|
|
905
905
|
strokeWidth: 1.5,
|
|
906
906
|
className: `ds-accordion__icon ${d ? "ds-accordion__icon--expanded" : ""}`
|
|
907
907
|
}
|
|
@@ -909,48 +909,48 @@ function st({
|
|
|
909
909
|
]
|
|
910
910
|
}
|
|
911
911
|
),
|
|
912
|
-
d && /* @__PURE__ */
|
|
912
|
+
d && /* @__PURE__ */ t.jsx("div", { className: "ds-accordion__content", children: s })
|
|
913
913
|
] });
|
|
914
914
|
}
|
|
915
915
|
const O = 8, z = 8;
|
|
916
|
-
function Te(
|
|
916
|
+
function Te(s, e, r) {
|
|
917
917
|
const c = window.innerWidth;
|
|
918
918
|
let n, a;
|
|
919
|
-
switch (
|
|
919
|
+
switch (s) {
|
|
920
920
|
case "top":
|
|
921
|
-
n = e.top -
|
|
921
|
+
n = e.top - r.height - O, a = e.left + e.width / 2 - r.width / 2;
|
|
922
922
|
break;
|
|
923
923
|
case "bottom":
|
|
924
|
-
n = e.bottom + O, a = e.left + e.width / 2 -
|
|
924
|
+
n = e.bottom + O, a = e.left + e.width / 2 - r.width / 2;
|
|
925
925
|
break;
|
|
926
926
|
case "left":
|
|
927
|
-
n = e.top + e.height / 2 -
|
|
927
|
+
n = e.top + e.height / 2 - r.height / 2, a = e.left - r.width - O;
|
|
928
928
|
break;
|
|
929
929
|
case "right":
|
|
930
|
-
n = e.top + e.height / 2 -
|
|
930
|
+
n = e.top + e.height / 2 - r.height / 2, a = e.right + O;
|
|
931
931
|
break;
|
|
932
932
|
default:
|
|
933
933
|
n = e.bottom + O, a = e.left;
|
|
934
934
|
}
|
|
935
|
-
const
|
|
936
|
-
return { top: n, left:
|
|
935
|
+
const i = Math.max(z, Math.min(c - r.width - z, a)), l = a - i;
|
|
936
|
+
return { top: n, left: i, arrowOffset: l };
|
|
937
937
|
}
|
|
938
|
-
function Se(
|
|
938
|
+
function Se(s, e, r) {
|
|
939
939
|
const c = window.innerWidth, n = window.innerHeight;
|
|
940
|
-
if (
|
|
941
|
-
if (n -
|
|
942
|
-
if (c -
|
|
943
|
-
if (
|
|
944
|
-
const a = Math.max(
|
|
945
|
-
return a ===
|
|
940
|
+
if (s.top >= e + O + z) return "top";
|
|
941
|
+
if (n - s.bottom >= e + O + z) return "bottom";
|
|
942
|
+
if (c - s.right >= r + O + z) return "right";
|
|
943
|
+
if (s.left >= r + O + z) return "left";
|
|
944
|
+
const a = Math.max(s.top, n - s.bottom, s.left, c - s.right);
|
|
945
|
+
return a === s.top ? "top" : a === n - s.bottom ? "bottom" : a === c - s.right ? "right" : "left";
|
|
946
946
|
}
|
|
947
|
-
function rt({ children:
|
|
948
|
-
const [n, a] =
|
|
947
|
+
function rt({ children: s, content: e, position: r, ...c }) {
|
|
948
|
+
const [n, a] = T(!1), [i, l] = T({ visibility: "hidden" }), [p, f] = T(r || "top"), d = L(null), u = L(null), x = L(!1), b = () => {
|
|
949
949
|
if (!d.current || !u.current) return;
|
|
950
|
-
const v = d.current.getBoundingClientRect(), k = u.current.getBoundingClientRect(), $ =
|
|
951
|
-
f($),
|
|
950
|
+
const v = d.current.getBoundingClientRect(), k = u.current.getBoundingClientRect(), $ = r || Se(v, k.height, k.width), { top: g, left: m, arrowOffset: _ } = Te($, v, k);
|
|
951
|
+
f($), l({
|
|
952
952
|
position: "fixed",
|
|
953
|
-
top:
|
|
953
|
+
top: g,
|
|
954
954
|
left: m,
|
|
955
955
|
visibility: "visible",
|
|
956
956
|
"--arrow-offset": `${_}px`
|
|
@@ -958,29 +958,29 @@ function rt({ children: t, content: e, position: s, ...c }) {
|
|
|
958
958
|
};
|
|
959
959
|
if (B(() => {
|
|
960
960
|
if (!n) return;
|
|
961
|
-
|
|
961
|
+
l({ position: "fixed", visibility: "hidden" });
|
|
962
962
|
const v = requestAnimationFrame(b);
|
|
963
963
|
return window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
|
|
964
964
|
cancelAnimationFrame(v), window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
|
|
965
965
|
};
|
|
966
|
-
}, [n,
|
|
966
|
+
}, [n, r]), B(() => {
|
|
967
967
|
if (!n) return;
|
|
968
968
|
const v = (k) => {
|
|
969
969
|
d.current && !d.current.contains(k.target) && a(!1);
|
|
970
970
|
};
|
|
971
971
|
return document.addEventListener("touchstart", v), () => document.removeEventListener("touchstart", v);
|
|
972
|
-
}, [n]), !e) return
|
|
973
|
-
const j = n && /* @__PURE__ */
|
|
972
|
+
}, [n]), !e) return s;
|
|
973
|
+
const j = n && /* @__PURE__ */ t.jsx(
|
|
974
974
|
"div",
|
|
975
975
|
{
|
|
976
976
|
ref: u,
|
|
977
977
|
className: `ds-tooltip ds-tooltip--${p}`,
|
|
978
978
|
role: "tooltip",
|
|
979
|
-
style:
|
|
979
|
+
style: i,
|
|
980
980
|
children: e
|
|
981
981
|
}
|
|
982
982
|
);
|
|
983
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ t.jsxs(
|
|
984
984
|
"div",
|
|
985
985
|
{
|
|
986
986
|
ref: d,
|
|
@@ -996,71 +996,71 @@ function rt({ children: t, content: e, position: s, ...c }) {
|
|
|
996
996
|
},
|
|
997
997
|
...c,
|
|
998
998
|
children: [
|
|
999
|
-
|
|
999
|
+
s,
|
|
1000
1000
|
typeof document < "u" && C.createPortal(j, document.body)
|
|
1001
1001
|
]
|
|
1002
1002
|
}
|
|
1003
1003
|
);
|
|
1004
1004
|
}
|
|
1005
1005
|
function nt({
|
|
1006
|
-
checked:
|
|
1006
|
+
checked: s = !1,
|
|
1007
1007
|
onChange: e,
|
|
1008
|
-
size:
|
|
1008
|
+
size: r = "m",
|
|
1009
1009
|
disabled: c = !1,
|
|
1010
1010
|
label: n,
|
|
1011
1011
|
id: a,
|
|
1012
|
-
...
|
|
1012
|
+
...i
|
|
1013
1013
|
}) {
|
|
1014
|
-
const
|
|
1014
|
+
const l = a || `toggle-${A.useId()}`, p = [
|
|
1015
1015
|
"ds-toggle",
|
|
1016
|
-
`ds-toggle--${
|
|
1016
|
+
`ds-toggle--${r}`,
|
|
1017
1017
|
c && "ds-toggle--disabled"
|
|
1018
1018
|
].filter(Boolean).join(" ");
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1019
|
+
return /* @__PURE__ */ t.jsxs("label", { className: p, htmlFor: l, children: [
|
|
1020
|
+
/* @__PURE__ */ t.jsx(
|
|
1021
1021
|
"input",
|
|
1022
1022
|
{
|
|
1023
1023
|
type: "checkbox",
|
|
1024
|
-
id:
|
|
1024
|
+
id: l,
|
|
1025
1025
|
className: "ds-toggle__input",
|
|
1026
|
-
checked:
|
|
1026
|
+
checked: s,
|
|
1027
1027
|
onChange: (f) => e == null ? void 0 : e(f.target.checked),
|
|
1028
1028
|
disabled: c,
|
|
1029
|
-
...
|
|
1029
|
+
...i
|
|
1030
1030
|
}
|
|
1031
1031
|
),
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
n && /* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-toggle__track", children: /* @__PURE__ */ t.jsx("span", { className: "ds-toggle__thumb" }) }),
|
|
1033
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "ds-toggle__label", children: n })
|
|
1034
1034
|
] });
|
|
1035
1035
|
}
|
|
1036
1036
|
function at({
|
|
1037
|
-
checked:
|
|
1037
|
+
checked: s = !1,
|
|
1038
1038
|
onChange: e,
|
|
1039
|
-
size:
|
|
1039
|
+
size: r = "m",
|
|
1040
1040
|
disabled: c = !1,
|
|
1041
1041
|
label: n,
|
|
1042
1042
|
id: a,
|
|
1043
|
-
...
|
|
1043
|
+
...i
|
|
1044
1044
|
}) {
|
|
1045
|
-
const
|
|
1045
|
+
const l = a || `checkbox-${A.useId()}`, p = [
|
|
1046
1046
|
"ds-checkbox",
|
|
1047
|
-
`ds-checkbox--${
|
|
1047
|
+
`ds-checkbox--${r}`,
|
|
1048
1048
|
c && "ds-checkbox--disabled"
|
|
1049
|
-
].filter(Boolean).join(" "), f =
|
|
1050
|
-
return /* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1049
|
+
].filter(Boolean).join(" "), f = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1050
|
+
return /* @__PURE__ */ t.jsxs("label", { className: p, htmlFor: l, children: [
|
|
1051
|
+
/* @__PURE__ */ t.jsx(
|
|
1052
1052
|
"input",
|
|
1053
1053
|
{
|
|
1054
1054
|
type: "checkbox",
|
|
1055
|
-
id:
|
|
1055
|
+
id: l,
|
|
1056
1056
|
className: "ds-checkbox__input",
|
|
1057
|
-
checked:
|
|
1057
|
+
checked: s,
|
|
1058
1058
|
onChange: (d) => e == null ? void 0 : e(d.target.checked),
|
|
1059
1059
|
disabled: c,
|
|
1060
|
-
...
|
|
1060
|
+
...i
|
|
1061
1061
|
}
|
|
1062
1062
|
),
|
|
1063
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ t.jsx(
|
|
1064
1064
|
_e,
|
|
1065
1065
|
{
|
|
1066
1066
|
size: f,
|
|
@@ -1068,211 +1068,211 @@ function at({
|
|
|
1068
1068
|
className: "ds-checkbox__icon"
|
|
1069
1069
|
}
|
|
1070
1070
|
) }),
|
|
1071
|
-
n && /* @__PURE__ */
|
|
1071
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "ds-checkbox__label", children: n })
|
|
1072
1072
|
] });
|
|
1073
1073
|
}
|
|
1074
1074
|
function ot({
|
|
1075
|
-
checked:
|
|
1075
|
+
checked: s = !1,
|
|
1076
1076
|
onChange: e,
|
|
1077
|
-
size:
|
|
1077
|
+
size: r = "m",
|
|
1078
1078
|
disabled: c = !1,
|
|
1079
1079
|
label: n,
|
|
1080
1080
|
name: a,
|
|
1081
|
-
value:
|
|
1082
|
-
id:
|
|
1081
|
+
value: i,
|
|
1082
|
+
id: l,
|
|
1083
1083
|
...p
|
|
1084
1084
|
}) {
|
|
1085
|
-
const f =
|
|
1085
|
+
const f = l || `radio-${A.useId()}`, d = [
|
|
1086
1086
|
"ds-radio",
|
|
1087
|
-
`ds-radio--${
|
|
1087
|
+
`ds-radio--${r}`,
|
|
1088
1088
|
c && "ds-radio--disabled"
|
|
1089
1089
|
].filter(Boolean).join(" ");
|
|
1090
|
-
return /* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ t.jsxs("label", { className: d, htmlFor: f, children: [
|
|
1091
|
+
/* @__PURE__ */ t.jsx(
|
|
1092
1092
|
"input",
|
|
1093
1093
|
{
|
|
1094
1094
|
type: "radio",
|
|
1095
1095
|
id: f,
|
|
1096
1096
|
className: "ds-radio__input",
|
|
1097
|
-
checked:
|
|
1097
|
+
checked: s,
|
|
1098
1098
|
onChange: (u) => e == null ? void 0 : e(u.target.checked),
|
|
1099
1099
|
disabled: c,
|
|
1100
1100
|
name: a,
|
|
1101
|
-
value:
|
|
1101
|
+
value: i,
|
|
1102
1102
|
...p
|
|
1103
1103
|
}
|
|
1104
1104
|
),
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
n && /* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ t.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1106
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "ds-radio__label", children: n })
|
|
1107
1107
|
] });
|
|
1108
1108
|
}
|
|
1109
|
-
function ct({ size:
|
|
1110
|
-
return /* @__PURE__ */
|
|
1109
|
+
function ct({ size: s = "m", color: e = "default", className: r = "", ...c }) {
|
|
1110
|
+
return /* @__PURE__ */ t.jsx(
|
|
1111
1111
|
"span",
|
|
1112
1112
|
{
|
|
1113
|
-
className: ["ds-spinner", `ds-spinner--${
|
|
1113
|
+
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${e}`, r].filter(Boolean).join(" "),
|
|
1114
1114
|
role: "status",
|
|
1115
1115
|
"aria-label": "Loading",
|
|
1116
1116
|
...c
|
|
1117
1117
|
}
|
|
1118
1118
|
);
|
|
1119
1119
|
}
|
|
1120
|
-
function lt({ width:
|
|
1121
|
-
return /* @__PURE__ */
|
|
1120
|
+
function lt({ width: s, height: e, shape: r = "rect", className: c = "", style: n = {}, ...a }) {
|
|
1121
|
+
return /* @__PURE__ */ t.jsx(
|
|
1122
1122
|
"span",
|
|
1123
1123
|
{
|
|
1124
|
-
className: ["ds-skeleton", `ds-skeleton--${
|
|
1125
|
-
style: { width:
|
|
1124
|
+
className: ["ds-skeleton", `ds-skeleton--${r}`, c].filter(Boolean).join(" "),
|
|
1125
|
+
style: { width: s, height: e, ...n },
|
|
1126
1126
|
"aria-hidden": "true",
|
|
1127
1127
|
...a
|
|
1128
1128
|
}
|
|
1129
1129
|
);
|
|
1130
1130
|
}
|
|
1131
|
-
function ge(
|
|
1131
|
+
function ge(s) {
|
|
1132
1132
|
let e = 2166136261;
|
|
1133
|
-
for (let
|
|
1134
|
-
e ^=
|
|
1133
|
+
for (let r = 0; r < s.length; r++)
|
|
1134
|
+
e ^= s.charCodeAt(r), e = Math.imul(e, 16777619) >>> 0;
|
|
1135
1135
|
return e % 360;
|
|
1136
1136
|
}
|
|
1137
|
-
function it({ seed:
|
|
1138
|
-
const l = ge(
|
|
1139
|
-
return /* @__PURE__ */
|
|
1137
|
+
function it({ seed: s, icon: e, src: r, size: c = 32, className: n = "", style: a = {}, ...i }) {
|
|
1138
|
+
const l = ge(s ?? ""), [p, f] = T(!1);
|
|
1139
|
+
return /* @__PURE__ */ t.jsx(
|
|
1140
1140
|
"div",
|
|
1141
1141
|
{
|
|
1142
|
-
className: ["ds-avatar",
|
|
1143
|
-
style: { width:
|
|
1142
|
+
className: ["ds-avatar", n].filter(Boolean).join(" "),
|
|
1143
|
+
style: { width: c, height: c, "--ds-avatar-h": l, ...a },
|
|
1144
1144
|
"aria-hidden": "true",
|
|
1145
|
-
...
|
|
1146
|
-
children: e
|
|
1145
|
+
...i,
|
|
1146
|
+
children: r && !p ? /* @__PURE__ */ t.jsx("img", { src: r, alt: "", onError: () => f(!0) }) : e
|
|
1147
1147
|
}
|
|
1148
1148
|
);
|
|
1149
1149
|
}
|
|
1150
1150
|
function dt({
|
|
1151
|
-
children:
|
|
1151
|
+
children: s,
|
|
1152
1152
|
size: e = "compact",
|
|
1153
|
-
stickyTop:
|
|
1153
|
+
stickyTop: r,
|
|
1154
1154
|
maxHeight: c,
|
|
1155
1155
|
className: n = "",
|
|
1156
1156
|
style: a = {},
|
|
1157
|
-
...
|
|
1157
|
+
...i
|
|
1158
1158
|
}) {
|
|
1159
|
-
const
|
|
1159
|
+
const l = {
|
|
1160
1160
|
...c ? { maxHeight: c } : {},
|
|
1161
|
-
...
|
|
1161
|
+
...r !== void 0 ? { "--ds-table-sticky-top": typeof r == "number" ? `${r}px` : r } : {},
|
|
1162
1162
|
...a
|
|
1163
1163
|
};
|
|
1164
|
-
return /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ t.jsx(
|
|
1165
1165
|
"div",
|
|
1166
1166
|
{
|
|
1167
1167
|
className: ["ds-table-wrap", c ? "ds-table-wrap--scroll" : ""].filter(Boolean).join(" "),
|
|
1168
|
-
style:
|
|
1169
|
-
children: /* @__PURE__ */
|
|
1168
|
+
style: l,
|
|
1169
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1170
1170
|
"table",
|
|
1171
1171
|
{
|
|
1172
1172
|
className: ["ds-table", `ds-table--${e}`, n].filter(Boolean).join(" "),
|
|
1173
|
-
...
|
|
1174
|
-
children:
|
|
1173
|
+
...i,
|
|
1174
|
+
children: s
|
|
1175
1175
|
}
|
|
1176
1176
|
)
|
|
1177
1177
|
}
|
|
1178
1178
|
);
|
|
1179
1179
|
}
|
|
1180
|
-
function ut({ children:
|
|
1181
|
-
return /* @__PURE__ */
|
|
1180
|
+
function ut({ children: s, ...e }) {
|
|
1181
|
+
return /* @__PURE__ */ t.jsx("thead", { ...e, children: s });
|
|
1182
1182
|
}
|
|
1183
|
-
function ft({ children:
|
|
1184
|
-
return /* @__PURE__ */
|
|
1183
|
+
function ft({ children: s, ...e }) {
|
|
1184
|
+
return /* @__PURE__ */ t.jsx("tbody", { ...e, children: s });
|
|
1185
1185
|
}
|
|
1186
|
-
function mt({ children:
|
|
1187
|
-
return /* @__PURE__ */
|
|
1186
|
+
function mt({ children: s, interactive: e, selected: r, className: c = "", onClick: n, ...a }) {
|
|
1187
|
+
return /* @__PURE__ */ t.jsx(
|
|
1188
1188
|
"tr",
|
|
1189
1189
|
{
|
|
1190
1190
|
className: [
|
|
1191
1191
|
"ds-table-row",
|
|
1192
1192
|
e || n ? "ds-table-row--interactive" : "",
|
|
1193
|
-
|
|
1193
|
+
r ? "ds-table-row--selected" : "",
|
|
1194
1194
|
c
|
|
1195
1195
|
].filter(Boolean).join(" "),
|
|
1196
1196
|
onClick: n,
|
|
1197
1197
|
...a,
|
|
1198
|
-
children:
|
|
1198
|
+
children: s
|
|
1199
1199
|
}
|
|
1200
1200
|
);
|
|
1201
1201
|
}
|
|
1202
|
-
function pt({ children:
|
|
1203
|
-
const p = !!c ||
|
|
1204
|
-
return /* @__PURE__ */
|
|
1202
|
+
function pt({ children: s, align: e = "left", sortDir: r, onSort: c, width: n, className: a = "", style: i = {}, ...l }) {
|
|
1203
|
+
const p = !!c || r !== void 0, f = r === "asc" ? we : r === "desc" ? K : Ne;
|
|
1204
|
+
return /* @__PURE__ */ t.jsx(
|
|
1205
1205
|
"th",
|
|
1206
1206
|
{
|
|
1207
1207
|
className: [
|
|
1208
1208
|
"ds-th",
|
|
1209
1209
|
p ? "ds-th--sortable" : "",
|
|
1210
|
-
|
|
1210
|
+
r ? "ds-th--sorted" : "",
|
|
1211
1211
|
e !== "left" ? `ds-table-cell--${e}` : "",
|
|
1212
1212
|
a
|
|
1213
1213
|
].filter(Boolean).join(" "),
|
|
1214
1214
|
onClick: c,
|
|
1215
|
-
style: { width: n, ...
|
|
1216
|
-
...
|
|
1217
|
-
children: p ? /* @__PURE__ */
|
|
1218
|
-
|
|
1219
|
-
/* @__PURE__ */
|
|
1220
|
-
] }) :
|
|
1215
|
+
style: { width: n, ...i },
|
|
1216
|
+
...l,
|
|
1217
|
+
children: p ? /* @__PURE__ */ t.jsxs("span", { className: "ds-th__inner", children: [
|
|
1218
|
+
s,
|
|
1219
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ t.jsx(f, { size: 11, strokeWidth: 2.5 }) })
|
|
1220
|
+
] }) : s
|
|
1221
1221
|
}
|
|
1222
1222
|
);
|
|
1223
1223
|
}
|
|
1224
|
-
function bt({ children:
|
|
1225
|
-
return /* @__PURE__ */
|
|
1224
|
+
function bt({ children: s, align: e = "left", secondary: r, muted: c, truncate: n, nowrap: a, className: i = "", ...l }) {
|
|
1225
|
+
return /* @__PURE__ */ t.jsx(
|
|
1226
1226
|
"td",
|
|
1227
1227
|
{
|
|
1228
1228
|
className: [
|
|
1229
1229
|
"ds-td",
|
|
1230
1230
|
e !== "left" ? `ds-table-cell--${e}` : "",
|
|
1231
|
-
|
|
1231
|
+
r ? "ds-table-cell--secondary" : "",
|
|
1232
1232
|
c ? "ds-table-cell--muted" : "",
|
|
1233
1233
|
n ? "ds-table-cell--truncate" : "",
|
|
1234
1234
|
a ? "ds-table-cell--nowrap" : "",
|
|
1235
|
-
|
|
1235
|
+
i
|
|
1236
1236
|
].filter(Boolean).join(" "),
|
|
1237
|
-
...
|
|
1238
|
-
children:
|
|
1237
|
+
...l,
|
|
1238
|
+
children: s
|
|
1239
1239
|
}
|
|
1240
1240
|
);
|
|
1241
1241
|
}
|
|
1242
1242
|
function ht({
|
|
1243
|
-
icon:
|
|
1243
|
+
icon: s,
|
|
1244
1244
|
title: e,
|
|
1245
|
-
description:
|
|
1245
|
+
description: r,
|
|
1246
1246
|
action: c,
|
|
1247
1247
|
size: n = "m",
|
|
1248
1248
|
className: a = "",
|
|
1249
|
-
...
|
|
1249
|
+
...i
|
|
1250
1250
|
}) {
|
|
1251
|
-
return /* @__PURE__ */
|
|
1251
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1252
1252
|
"div",
|
|
1253
1253
|
{
|
|
1254
1254
|
className: ["ds-empty-state", `ds-empty-state--${n}`, a].filter(Boolean).join(" "),
|
|
1255
|
-
...
|
|
1255
|
+
...i,
|
|
1256
1256
|
children: [
|
|
1257
|
-
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
|
|
1260
|
-
c && /* @__PURE__ */
|
|
1257
|
+
s && /* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1258
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__title", children: e }),
|
|
1259
|
+
r && /* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__description", children: r }),
|
|
1260
|
+
c && /* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__action", children: c })
|
|
1261
1261
|
]
|
|
1262
1262
|
}
|
|
1263
1263
|
);
|
|
1264
1264
|
}
|
|
1265
1265
|
function xt({
|
|
1266
|
-
trigger:
|
|
1266
|
+
trigger: s,
|
|
1267
1267
|
items: e = [],
|
|
1268
|
-
open:
|
|
1268
|
+
open: r,
|
|
1269
1269
|
onOpenChange: c,
|
|
1270
1270
|
align: n = "left",
|
|
1271
1271
|
className: a = "",
|
|
1272
|
-
style:
|
|
1273
|
-
...
|
|
1272
|
+
style: i,
|
|
1273
|
+
...l
|
|
1274
1274
|
}) {
|
|
1275
|
-
const [p, f] =
|
|
1275
|
+
const [p, f] = T(!1), d = r !== void 0, u = d ? r : p, x = L(null), b = L(null), [j, v] = T({}), k = () => {
|
|
1276
1276
|
d ? c == null || c(!1) : f(!1);
|
|
1277
1277
|
}, $ = () => {
|
|
1278
1278
|
const m = !u;
|
|
@@ -1293,8 +1293,8 @@ function xt({
|
|
|
1293
1293
|
}, [u, n]), B(() => {
|
|
1294
1294
|
if (!u) return;
|
|
1295
1295
|
const m = (R) => {
|
|
1296
|
-
var
|
|
1297
|
-
!((
|
|
1296
|
+
var I, P;
|
|
1297
|
+
!((I = x.current) != null && I.contains(R.target)) && !((P = b.current) != null && P.contains(R.target)) && k();
|
|
1298
1298
|
}, _ = (R) => {
|
|
1299
1299
|
R.key === "Escape" && k();
|
|
1300
1300
|
};
|
|
@@ -1302,7 +1302,7 @@ function xt({
|
|
|
1302
1302
|
document.removeEventListener("mousedown", m), document.removeEventListener("keydown", _);
|
|
1303
1303
|
};
|
|
1304
1304
|
}, [u]);
|
|
1305
|
-
const
|
|
1305
|
+
const g = u && /* @__PURE__ */ t.jsx(
|
|
1306
1306
|
"div",
|
|
1307
1307
|
{
|
|
1308
1308
|
ref: b,
|
|
@@ -1310,15 +1310,15 @@ function xt({
|
|
|
1310
1310
|
style: j,
|
|
1311
1311
|
children: e.map((m, _) => {
|
|
1312
1312
|
if (m.separator)
|
|
1313
|
-
return /* @__PURE__ */
|
|
1313
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__separator" }, _);
|
|
1314
1314
|
if (m.type === "section")
|
|
1315
|
-
return /* @__PURE__ */
|
|
1316
|
-
m.label && /* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1315
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
1316
|
+
m.label && /* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__section-label", children: m.label }),
|
|
1317
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__section-content", children: m.content })
|
|
1318
1318
|
] }, _);
|
|
1319
|
-
const R = !!m.href,
|
|
1320
|
-
return /* @__PURE__ */
|
|
1321
|
-
|
|
1319
|
+
const R = !!m.href, I = R ? "a" : "button", P = R ? { href: m.disabled ? void 0 : m.href, "aria-disabled": m.disabled ? "true" : void 0 } : { type: "button", disabled: m.disabled };
|
|
1320
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1321
|
+
I,
|
|
1322
1322
|
{
|
|
1323
1323
|
className: [
|
|
1324
1324
|
"ds-dropdown__item",
|
|
@@ -1330,9 +1330,9 @@ function xt({
|
|
|
1330
1330
|
(M = m.onClick) == null || M.call(m), k();
|
|
1331
1331
|
},
|
|
1332
1332
|
children: [
|
|
1333
|
-
m.icon && /* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
m.shortcut && /* @__PURE__ */
|
|
1333
|
+
m.icon && /* @__PURE__ */ t.jsx("span", { className: "ds-dropdown__item-icon", children: m.icon }),
|
|
1334
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-dropdown__item-label", children: m.label }),
|
|
1335
|
+
m.shortcut && /* @__PURE__ */ t.jsx("span", { className: "ds-dropdown__item-shortcut", children: m.shortcut })
|
|
1336
1336
|
]
|
|
1337
1337
|
},
|
|
1338
1338
|
_
|
|
@@ -1340,16 +1340,16 @@ function xt({
|
|
|
1340
1340
|
})
|
|
1341
1341
|
}
|
|
1342
1342
|
);
|
|
1343
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1344
1344
|
"div",
|
|
1345
1345
|
{
|
|
1346
1346
|
ref: x,
|
|
1347
1347
|
className: ["ds-dropdown", a].filter(Boolean).join(" "),
|
|
1348
|
-
style:
|
|
1349
|
-
...
|
|
1348
|
+
style: i,
|
|
1349
|
+
...l,
|
|
1350
1350
|
children: [
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
typeof document < "u" && C.createPortal(
|
|
1351
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__trigger", onClick: $, children: s }),
|
|
1352
|
+
typeof document < "u" && C.createPortal(g, document.body)
|
|
1353
1353
|
]
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
@@ -1363,63 +1363,63 @@ const ue = {
|
|
|
1363
1363
|
let V = [];
|
|
1364
1364
|
const te = /* @__PURE__ */ new Set();
|
|
1365
1365
|
function he() {
|
|
1366
|
-
te.forEach((
|
|
1366
|
+
te.forEach((s) => s([...V]));
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1369
|
-
V = [...V,
|
|
1368
|
+
function Ie(s) {
|
|
1369
|
+
V = [...V, s], he();
|
|
1370
1370
|
}
|
|
1371
|
-
function
|
|
1372
|
-
V = V.filter((e) => e.id !==
|
|
1371
|
+
function Ae(s) {
|
|
1372
|
+
V = V.filter((e) => e.id !== s), he();
|
|
1373
1373
|
}
|
|
1374
1374
|
function vt() {
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1375
|
+
const s = (e, r = {}) => {
|
|
1376
|
+
Ie({
|
|
1377
1377
|
id: `${Date.now()}-${Math.random()}`,
|
|
1378
1378
|
message: e,
|
|
1379
1379
|
type: "default",
|
|
1380
1380
|
duration: 4e3,
|
|
1381
|
-
...
|
|
1381
|
+
...r
|
|
1382
1382
|
});
|
|
1383
1383
|
};
|
|
1384
|
-
return
|
|
1384
|
+
return s.success = (e, r) => s(e, { ...r, type: "success" }), s.error = (e, r) => s(e, { ...r, type: "error" }), s.warning = (e, r) => s(e, { ...r, type: "warning" }), { toast: s };
|
|
1385
1385
|
}
|
|
1386
|
-
function Pe({ data:
|
|
1387
|
-
const [
|
|
1388
|
-
B(() => (requestAnimationFrame(() => c(!0)),
|
|
1386
|
+
function Pe({ data: s, onDismiss: e }) {
|
|
1387
|
+
const [r, c] = T(!1), n = L(null);
|
|
1388
|
+
B(() => (requestAnimationFrame(() => c(!0)), s.duration > 0 && (n.current = setTimeout(() => a(), s.duration)), () => clearTimeout(n.current)), []);
|
|
1389
1389
|
function a() {
|
|
1390
|
-
c(!1), setTimeout(() => e(
|
|
1390
|
+
c(!1), setTimeout(() => e(s.id), 250);
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1393
|
-
return /* @__PURE__ */
|
|
1392
|
+
const i = ue[s.type] ?? ue.default;
|
|
1393
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1394
1394
|
"div",
|
|
1395
1395
|
{
|
|
1396
1396
|
className: [
|
|
1397
1397
|
"ds-toast",
|
|
1398
|
-
`ds-toast--${
|
|
1399
|
-
|
|
1398
|
+
`ds-toast--${s.type}`,
|
|
1399
|
+
r && "ds-toast--visible"
|
|
1400
1400
|
].filter(Boolean).join(" "),
|
|
1401
|
-
role:
|
|
1401
|
+
role: s.type === "error" ? "alert" : "status",
|
|
1402
1402
|
"aria-live": "polite",
|
|
1403
1403
|
children: [
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ t.jsx(i, { size: S[3], strokeWidth: 1.5 }) }),
|
|
1405
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-toast__message", children: s.message }),
|
|
1406
|
+
/* @__PURE__ */ t.jsx(
|
|
1407
1407
|
"button",
|
|
1408
1408
|
{
|
|
1409
1409
|
className: "ds-toast__close",
|
|
1410
1410
|
onClick: a,
|
|
1411
1411
|
"aria-label": "Закрыть",
|
|
1412
|
-
children: /* @__PURE__ */
|
|
1412
|
+
children: /* @__PURE__ */ t.jsx(se, { size: S[3], strokeWidth: 1.5 })
|
|
1413
1413
|
}
|
|
1414
1414
|
)
|
|
1415
1415
|
]
|
|
1416
1416
|
}
|
|
1417
1417
|
);
|
|
1418
1418
|
}
|
|
1419
|
-
function jt({ position:
|
|
1420
|
-
const [e,
|
|
1421
|
-
return B(() => (te.add(
|
|
1422
|
-
/* @__PURE__ */
|
|
1419
|
+
function jt({ position: s = "bottom-right" }) {
|
|
1420
|
+
const [e, r] = T(() => [...V]);
|
|
1421
|
+
return B(() => (te.add(r), () => te.delete(r)), []), !e.length || typeof document > "u" ? null : C.createPortal(
|
|
1422
|
+
/* @__PURE__ */ t.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: e.map((c) => /* @__PURE__ */ t.jsx(Pe, { data: c, onDismiss: Ae }, c.id)) }),
|
|
1423
1423
|
document.body
|
|
1424
1424
|
);
|
|
1425
1425
|
}
|
|
@@ -1463,6 +1463,6 @@ export {
|
|
|
1463
1463
|
jt as ToastContainer,
|
|
1464
1464
|
nt as Toggle,
|
|
1465
1465
|
rt as Tooltip,
|
|
1466
|
-
|
|
1466
|
+
S as iconSizes,
|
|
1467
1467
|
vt as useToast
|
|
1468
1468
|
};
|