@donkit-ai/design-system 1.1.18 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.d.ts +18 -0
- package/dist/index.es.js +796 -696
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
const
|
|
1
|
+
import B, { useState as S, useRef as A, useEffect as L, useLayoutEffect as ve } from "react";
|
|
2
|
+
import Q from "react-dom";
|
|
3
|
+
import { ChevronDown as ee, Minus as je, Plus as _e, XCircle as fe, AlertTriangle as me, CheckCircle as pe, Info as he, X as le, Check as we, ChevronUp as Ne, ChevronsUpDown as ye } from "lucide-react";
|
|
4
|
+
const P = {
|
|
5
5
|
1: 16,
|
|
6
6
|
2: 20,
|
|
7
7
|
3: 24,
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var ae = { exports: {} }, G = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -19,28 +19,28 @@ var ee = { exports: {} }, G = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var ce;
|
|
22
|
-
function
|
|
22
|
+
function Ee() {
|
|
23
23
|
if (ce) return G;
|
|
24
24
|
ce = 1;
|
|
25
|
-
var
|
|
25
|
+
var s = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
26
26
|
function r(l, n, a) {
|
|
27
|
-
var
|
|
28
|
-
if (a !== void 0 && (
|
|
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 d in n)
|
|
31
|
+
d !== "key" && (a[d] = n[d]);
|
|
32
32
|
} else a = n;
|
|
33
33
|
return n = a.ref, {
|
|
34
|
-
$$typeof:
|
|
34
|
+
$$typeof: s,
|
|
35
35
|
type: l,
|
|
36
|
-
key:
|
|
36
|
+
key: i,
|
|
37
37
|
ref: n !== void 0 ? n : null,
|
|
38
38
|
props: a
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
return G.Fragment = e, G.jsx = r, G.jsxs = r, G;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var X = {};
|
|
44
44
|
/**
|
|
45
45
|
* @license React
|
|
46
46
|
* react-jsx-runtime.development.js
|
|
@@ -51,46 +51,46 @@ var q = {};
|
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
53
|
var ie;
|
|
54
|
-
function
|
|
54
|
+
function Re() {
|
|
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
|
-
return o.$$typeof ===
|
|
59
|
+
return o.$$typeof === O ? null : o.displayName || o.name || null;
|
|
60
60
|
if (typeof o == "string") return o;
|
|
61
61
|
switch (o) {
|
|
62
|
-
case
|
|
62
|
+
case y:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case g:
|
|
65
|
-
return "Profiler";
|
|
66
64
|
case $:
|
|
65
|
+
return "Profiler";
|
|
66
|
+
case E:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case z:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case
|
|
70
|
+
case x:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case C:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof o == "object")
|
|
76
76
|
switch (typeof o.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
|
), o.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case j:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case
|
|
81
|
+
case g:
|
|
82
82
|
return o.displayName || "Context";
|
|
83
|
-
case
|
|
83
|
+
case w:
|
|
84
84
|
return (o._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case
|
|
86
|
-
var
|
|
87
|
-
return o = o.displayName, o || (o =
|
|
88
|
-
case
|
|
89
|
-
return
|
|
90
|
-
case
|
|
91
|
-
|
|
85
|
+
case W:
|
|
86
|
+
var b = o.render;
|
|
87
|
+
return o = o.displayName, o || (o = b.displayName || b.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
88
|
+
case T:
|
|
89
|
+
return b = o.displayName || null, b !== null ? b : s(o.type) || "Memo";
|
|
90
|
+
case I:
|
|
91
|
+
b = o._payload, o = o._init;
|
|
92
92
|
try {
|
|
93
|
-
return
|
|
93
|
+
return s(o(b));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -102,50 +102,50 @@ function Ee() {
|
|
|
102
102
|
function r(o) {
|
|
103
103
|
try {
|
|
104
104
|
e(o);
|
|
105
|
-
var
|
|
105
|
+
var b = !1;
|
|
106
106
|
} catch {
|
|
107
|
-
|
|
107
|
+
b = !0;
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
var N =
|
|
109
|
+
if (b) {
|
|
110
|
+
b = console;
|
|
111
|
+
var N = b.error, R = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
112
112
|
return N.call(
|
|
113
|
-
|
|
113
|
+
b,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
|
-
|
|
115
|
+
R
|
|
116
116
|
), e(o);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function l(o) {
|
|
120
|
-
if (o ===
|
|
121
|
-
if (typeof o == "object" && o !== null && o.$$typeof ===
|
|
120
|
+
if (o === y) return "<>";
|
|
121
|
+
if (typeof o == "object" && o !== null && o.$$typeof === I)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
124
|
+
var b = s(o);
|
|
125
|
+
return b ? "<" + b + ">" : "<...>";
|
|
126
126
|
} catch {
|
|
127
127
|
return "<...>";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function n() {
|
|
131
|
-
var o =
|
|
131
|
+
var o = D.A;
|
|
132
132
|
return o === null ? null : o.getOwner();
|
|
133
133
|
}
|
|
134
134
|
function a() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
if (
|
|
139
|
-
var
|
|
140
|
-
if (
|
|
137
|
+
function i(o) {
|
|
138
|
+
if (J.call(o, "key")) {
|
|
139
|
+
var b = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
140
|
+
if (b && b.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return o.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function d(o, b) {
|
|
145
145
|
function N() {
|
|
146
|
-
|
|
146
|
+
F || (F = !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
|
+
b
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
151
|
N.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
@@ -154,20 +154,20 @@ function Ee() {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
function p() {
|
|
157
|
-
var o =
|
|
158
|
-
return
|
|
157
|
+
var o = s(this.type);
|
|
158
|
+
return q[o] || (q[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;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
var
|
|
162
|
+
function u(o, b, N, R, Z, re) {
|
|
163
|
+
var k = N.ref;
|
|
164
164
|
return o = {
|
|
165
|
-
$$typeof:
|
|
165
|
+
$$typeof: v,
|
|
166
166
|
type: o,
|
|
167
|
-
key:
|
|
167
|
+
key: b,
|
|
168
168
|
props: N,
|
|
169
|
-
_owner:
|
|
170
|
-
}, (
|
|
169
|
+
_owner: R
|
|
170
|
+
}, (k !== void 0 ? k : null) !== null ? Object.defineProperty(o, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
get: p
|
|
173
173
|
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
@@ -184,492 +184,522 @@ function Ee() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: Z
|
|
188
188
|
}), Object.defineProperty(o, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
191
191
|
writable: !0,
|
|
192
|
-
value:
|
|
192
|
+
value: re
|
|
193
193
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (
|
|
200
|
-
for (
|
|
201
|
-
|
|
202
|
-
Object.freeze && Object.freeze(
|
|
195
|
+
function f(o, b, N, R, Z, re) {
|
|
196
|
+
var k = b.children;
|
|
197
|
+
if (k !== void 0)
|
|
198
|
+
if (R)
|
|
199
|
+
if (te(k)) {
|
|
200
|
+
for (R = 0; R < k.length; R++)
|
|
201
|
+
m(k[R]);
|
|
202
|
+
Object.freeze && Object.freeze(k);
|
|
203
203
|
} else
|
|
204
204
|
console.error(
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
|
-
else
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
var
|
|
207
|
+
else m(k);
|
|
208
|
+
if (J.call(b, "key")) {
|
|
209
|
+
k = s(o);
|
|
210
|
+
var V = Object.keys(b).filter(function(xe) {
|
|
211
211
|
return xe !== "key";
|
|
212
212
|
});
|
|
213
|
-
|
|
213
|
+
R = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", H[k + R] || (V = 0 < V.length ? "{" + V.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
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
),
|
|
220
|
+
R,
|
|
221
|
+
k,
|
|
222
|
+
V,
|
|
223
|
+
k
|
|
224
|
+
), H[k + R] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (
|
|
226
|
+
if (k = null, N !== void 0 && (r(N), k = "" + N), i(b) && (r(b.key), k = "" + b.key), "key" in b) {
|
|
227
227
|
N = {};
|
|
228
|
-
for (var
|
|
229
|
-
|
|
230
|
-
} else N =
|
|
231
|
-
return
|
|
228
|
+
for (var ne in b)
|
|
229
|
+
ne !== "key" && (N[ne] = b[ne]);
|
|
230
|
+
} else N = b;
|
|
231
|
+
return k && d(
|
|
232
232
|
N,
|
|
233
233
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
234
|
-
),
|
|
234
|
+
), u(
|
|
235
235
|
o,
|
|
236
|
-
|
|
236
|
+
k,
|
|
237
237
|
N,
|
|
238
238
|
n(),
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
Z,
|
|
240
|
+
re
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
243
|
+
function m(o) {
|
|
244
|
+
h(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === I && (o._payload.status === "fulfilled" ? h(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
return typeof o == "object" && o !== null && o.$$typeof ===
|
|
246
|
+
function h(o) {
|
|
247
|
+
return typeof o == "object" && o !== null && o.$$typeof === v;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
249
|
+
var c = B, v = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), $ = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), g = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), D = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, J = Object.prototype.hasOwnProperty, te = Array.isArray, _ = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
c = {
|
|
253
253
|
react_stack_bottom_frame: function(o) {
|
|
254
254
|
return o();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
258
|
-
|
|
257
|
+
var F, q = {}, K = c.react_stack_bottom_frame.bind(
|
|
258
|
+
c,
|
|
259
259
|
a
|
|
260
|
-
)(),
|
|
261
|
-
|
|
262
|
-
var
|
|
263
|
-
return
|
|
260
|
+
)(), se = _(l(a)), H = {};
|
|
261
|
+
X.Fragment = y, X.jsx = function(o, b, N) {
|
|
262
|
+
var R = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
263
|
+
return f(
|
|
264
264
|
o,
|
|
265
|
-
|
|
265
|
+
b,
|
|
266
266
|
N,
|
|
267
267
|
!1,
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
R ? Error("react-stack-top-frame") : K,
|
|
269
|
+
R ? _(l(o)) : se
|
|
270
270
|
);
|
|
271
|
-
},
|
|
272
|
-
var
|
|
273
|
-
return
|
|
271
|
+
}, X.jsxs = function(o, b, N) {
|
|
272
|
+
var R = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
273
|
+
return f(
|
|
274
274
|
o,
|
|
275
|
-
|
|
275
|
+
b,
|
|
276
276
|
N,
|
|
277
277
|
!0,
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
R ? Error("react-stack-top-frame") : K,
|
|
279
|
+
R ? _(l(o)) : se
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
|
-
}()),
|
|
282
|
+
}()), X;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var
|
|
286
|
-
function ke({
|
|
287
|
-
|
|
284
|
+
process.env.NODE_ENV === "production" ? ae.exports = Ee() : ae.exports = Re();
|
|
285
|
+
var t = ae.exports;
|
|
286
|
+
function ke({ size: s = "m", color: e = "default", className: r = "", ...l }) {
|
|
287
|
+
return /* @__PURE__ */ t.jsx(
|
|
288
|
+
"span",
|
|
289
|
+
{
|
|
290
|
+
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${e}`, r].filter(Boolean).join(" "),
|
|
291
|
+
role: "status",
|
|
292
|
+
"aria-label": "Loading",
|
|
293
|
+
...l
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
function $e({
|
|
298
|
+
children: s,
|
|
288
299
|
variant: e = "primary",
|
|
289
300
|
size: r = "m",
|
|
290
301
|
fullWidth: l = !1,
|
|
291
302
|
icon: n,
|
|
292
303
|
disabled: a = !1,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
304
|
+
state: i = "idle",
|
|
305
|
+
onClick: d,
|
|
306
|
+
type: p = "button",
|
|
307
|
+
href: u,
|
|
296
308
|
"aria-label": f,
|
|
297
|
-
...
|
|
309
|
+
...m
|
|
298
310
|
}) {
|
|
299
|
-
const
|
|
311
|
+
const h = n && !s, c = i === "loading", v = r === "l" ? "s" : "xs", j = [
|
|
300
312
|
"ds-button",
|
|
301
313
|
`ds-button--${e}`,
|
|
302
314
|
`ds-button--${r}`,
|
|
303
315
|
l && "ds-button--full",
|
|
304
|
-
|
|
305
|
-
].filter(Boolean).join(" "),
|
|
306
|
-
|
|
307
|
-
t,
|
|
308
|
-
|
|
316
|
+
h && "ds-button--icon-only"
|
|
317
|
+
].filter(Boolean).join(" "), y = i !== "idle" ? i : void 0, E = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
318
|
+
c && /* @__PURE__ */ t.jsx(ke, { size: v }),
|
|
319
|
+
!c && n && !h && /* @__PURE__ */ t.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n }),
|
|
320
|
+
s,
|
|
321
|
+
!c && h && /* @__PURE__ */ t.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n })
|
|
309
322
|
] });
|
|
310
|
-
if (
|
|
311
|
-
const
|
|
312
|
-
if (a) {
|
|
313
|
-
|
|
323
|
+
if (u) {
|
|
324
|
+
const $ = (w) => {
|
|
325
|
+
if (a || c) {
|
|
326
|
+
w.preventDefault();
|
|
314
327
|
return;
|
|
315
328
|
}
|
|
316
|
-
|
|
329
|
+
w.metaKey || w.ctrlKey || w.button === 1 || (w.preventDefault(), d == null || d(w));
|
|
317
330
|
};
|
|
318
|
-
return /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ t.jsx(
|
|
319
332
|
"a",
|
|
320
333
|
{
|
|
321
|
-
className:
|
|
322
|
-
href: a ? void 0 :
|
|
323
|
-
onClick:
|
|
334
|
+
className: j,
|
|
335
|
+
href: a || c ? void 0 : u,
|
|
336
|
+
onClick: $,
|
|
324
337
|
"aria-label": f,
|
|
325
|
-
"aria-disabled": a ? "true" : void 0,
|
|
326
|
-
|
|
327
|
-
|
|
338
|
+
"aria-disabled": a || c ? "true" : void 0,
|
|
339
|
+
"aria-busy": c ? "true" : void 0,
|
|
340
|
+
"data-state": y,
|
|
341
|
+
...m,
|
|
342
|
+
children: E
|
|
328
343
|
}
|
|
329
344
|
);
|
|
330
345
|
}
|
|
331
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ t.jsx(
|
|
332
347
|
"button",
|
|
333
348
|
{
|
|
334
|
-
type:
|
|
335
|
-
className:
|
|
349
|
+
type: p,
|
|
350
|
+
className: j,
|
|
336
351
|
disabled: a,
|
|
337
|
-
onClick: c,
|
|
352
|
+
onClick: c ? void 0 : d,
|
|
338
353
|
"aria-label": f,
|
|
339
|
-
|
|
340
|
-
|
|
354
|
+
"aria-busy": c ? "true" : void 0,
|
|
355
|
+
"data-state": y,
|
|
356
|
+
...m,
|
|
357
|
+
children: E
|
|
341
358
|
}
|
|
342
359
|
);
|
|
343
360
|
}
|
|
344
|
-
function
|
|
345
|
-
label:
|
|
361
|
+
function We({
|
|
362
|
+
label: s,
|
|
346
363
|
error: e,
|
|
347
364
|
hint: r,
|
|
348
365
|
fullWidth: l = !0,
|
|
349
366
|
icon: n,
|
|
350
367
|
iconRight: a,
|
|
351
|
-
onIconRightClick:
|
|
352
|
-
size:
|
|
368
|
+
onIconRightClick: i,
|
|
369
|
+
size: d = "m",
|
|
353
370
|
disabled: p,
|
|
354
|
-
id:
|
|
355
|
-
...
|
|
371
|
+
id: u,
|
|
372
|
+
...f
|
|
356
373
|
}) {
|
|
357
|
-
const
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
n && /* @__PURE__ */
|
|
362
|
-
/* @__PURE__ */
|
|
374
|
+
const m = u || `input-${B.useId()}`, h = r ? `${m}-hint` : void 0, c = e ? `${m}-error` : void 0, v = c || h;
|
|
375
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-input-wrapper ${l ? "ds-input-wrapper--full" : ""} ${p ? "ds-input-wrapper--disabled" : ""} ${e ? "ds-input-wrapper--error" : ""}`, children: [
|
|
376
|
+
s && /* @__PURE__ */ t.jsx("label", { className: "ds-input-label", htmlFor: m, children: s }),
|
|
377
|
+
/* @__PURE__ */ t.jsxs("div", { className: "ds-input-container", children: [
|
|
378
|
+
n && /* @__PURE__ */ t.jsx("span", { className: `ds-input-icon ds-input-icon--${d}`, "aria-hidden": "true", children: n }),
|
|
379
|
+
/* @__PURE__ */ t.jsx(
|
|
363
380
|
"input",
|
|
364
381
|
{
|
|
365
|
-
id:
|
|
366
|
-
className: `ds-input ds-input--${
|
|
382
|
+
id: m,
|
|
383
|
+
className: `ds-input ds-input--${d} ${n ? "ds-input--with-icon" : ""} ${a ? "ds-input--with-icon-right" : ""} ${e ? "ds-input--error" : ""}`,
|
|
367
384
|
disabled: p,
|
|
368
385
|
"aria-invalid": e ? "true" : "false",
|
|
369
|
-
"aria-describedby":
|
|
370
|
-
...
|
|
386
|
+
"aria-describedby": v,
|
|
387
|
+
...f
|
|
371
388
|
}
|
|
372
389
|
),
|
|
373
|
-
a && /* @__PURE__ */
|
|
390
|
+
a && /* @__PURE__ */ t.jsx(
|
|
374
391
|
"button",
|
|
375
392
|
{
|
|
376
393
|
type: "button",
|
|
377
|
-
className: `ds-input-icon-right ds-input-icon-right--${
|
|
378
|
-
onClick:
|
|
394
|
+
className: `ds-input-icon-right ds-input-icon-right--${d}`,
|
|
395
|
+
onClick: i,
|
|
379
396
|
tabIndex: -1,
|
|
380
397
|
"aria-label": "Toggle visibility",
|
|
381
398
|
children: a
|
|
382
399
|
}
|
|
383
400
|
)
|
|
384
401
|
] }),
|
|
385
|
-
r && !e && /* @__PURE__ */
|
|
386
|
-
e && /* @__PURE__ */
|
|
402
|
+
r && !e && /* @__PURE__ */ t.jsx("span", { id: h, className: "ds-input-hint", children: r }),
|
|
403
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ t.jsx("div", { className: "ds-input-error-inner", children: e && /* @__PURE__ */ t.jsx("span", { id: c, className: "ds-input-error", role: "alert", children: e }) }) })
|
|
387
404
|
] });
|
|
388
405
|
}
|
|
389
|
-
function
|
|
390
|
-
label:
|
|
406
|
+
function ze({
|
|
407
|
+
label: s,
|
|
391
408
|
error: e,
|
|
392
409
|
hint: r,
|
|
393
410
|
fullWidth: l = !0,
|
|
394
411
|
size: n = "m",
|
|
395
412
|
disabled: a,
|
|
396
|
-
id:
|
|
397
|
-
resize:
|
|
413
|
+
id: i,
|
|
414
|
+
resize: d = !0,
|
|
398
415
|
rows: p = 3,
|
|
399
|
-
...
|
|
416
|
+
...u
|
|
400
417
|
}) {
|
|
401
|
-
const
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
|
|
404
|
-
/* @__PURE__ */
|
|
418
|
+
const f = i || `textarea-${B.useId()}`, m = r ? `${f}-hint` : void 0, h = e ? `${f}-error` : void 0, c = h || m;
|
|
419
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-textarea-wrapper ${l ? "ds-textarea-wrapper--full" : ""} ${a ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
420
|
+
s && /* @__PURE__ */ t.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
|
|
421
|
+
/* @__PURE__ */ t.jsx(
|
|
405
422
|
"textarea",
|
|
406
423
|
{
|
|
407
|
-
id:
|
|
408
|
-
className: `ds-textarea ds-textarea--${n} ${e ? "ds-textarea--error" : ""} ${
|
|
424
|
+
id: f,
|
|
425
|
+
className: `ds-textarea ds-textarea--${n} ${e ? "ds-textarea--error" : ""} ${d ? "" : "ds-textarea--no-resize"}`,
|
|
409
426
|
disabled: a,
|
|
410
427
|
"aria-invalid": e ? "true" : "false",
|
|
411
|
-
"aria-describedby":
|
|
428
|
+
"aria-describedby": c,
|
|
412
429
|
rows: p,
|
|
413
|
-
...
|
|
430
|
+
...u
|
|
414
431
|
}
|
|
415
432
|
),
|
|
416
|
-
r && !e && /* @__PURE__ */
|
|
417
|
-
e && /* @__PURE__ */
|
|
433
|
+
r && !e && /* @__PURE__ */ t.jsx("span", { id: m, className: "ds-textarea-hint", children: r }),
|
|
434
|
+
e && /* @__PURE__ */ t.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: e })
|
|
418
435
|
] });
|
|
419
436
|
}
|
|
420
|
-
function
|
|
421
|
-
label:
|
|
437
|
+
function Ve({
|
|
438
|
+
label: s,
|
|
422
439
|
value: e,
|
|
423
440
|
onChange: r,
|
|
424
441
|
options: l = [],
|
|
425
442
|
placeholder: n = "Select option",
|
|
426
443
|
error: a,
|
|
427
|
-
fullWidth:
|
|
428
|
-
size:
|
|
444
|
+
fullWidth: i = !0,
|
|
445
|
+
size: d = "m",
|
|
429
446
|
disabled: p = !1,
|
|
430
|
-
id:
|
|
431
|
-
...
|
|
447
|
+
id: u,
|
|
448
|
+
...f
|
|
432
449
|
}) {
|
|
433
|
-
const [
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
450
|
+
const [m, h] = S(!1), [c, v] = S(!1), [j, y] = S({}), [E, $] = S("down"), w = A(null), g = A(null), W = A(null), z = u || `select-${B.useId()}`, x = `${z}-label`, T = a ? `${z}-error` : void 0, I = 150, C = () => {
|
|
451
|
+
c || (v(!0), W.current = setTimeout(() => {
|
|
452
|
+
h(!1), v(!1);
|
|
453
|
+
}, I));
|
|
454
|
+
};
|
|
455
|
+
L(() => () => clearTimeout(W.current), []);
|
|
456
|
+
const O = () => {
|
|
457
|
+
var o;
|
|
458
|
+
const _ = (o = w.current) == null ? void 0 : o.getBoundingClientRect();
|
|
459
|
+
if (!_) return;
|
|
460
|
+
const F = window.innerHeight, q = F - _.bottom, K = _.top, H = q < 300 && K > q;
|
|
461
|
+
$(H ? "up" : "down"), y(
|
|
462
|
+
H ? { bottom: F - _.top + 4, left: _.left, width: _.width } : { top: _.bottom + 4, left: _.left, width: _.width }
|
|
440
463
|
);
|
|
441
464
|
};
|
|
442
|
-
|
|
443
|
-
if (
|
|
444
|
-
return
|
|
445
|
-
window.removeEventListener("scroll",
|
|
465
|
+
L(() => {
|
|
466
|
+
if (m)
|
|
467
|
+
return O(), window.addEventListener("scroll", O, !0), window.addEventListener("resize", O), () => {
|
|
468
|
+
window.removeEventListener("scroll", O, !0), window.removeEventListener("resize", O);
|
|
446
469
|
};
|
|
447
|
-
}, [
|
|
448
|
-
const
|
|
449
|
-
|
|
470
|
+
}, [m]), L(() => {
|
|
471
|
+
const _ = (F) => {
|
|
472
|
+
w.current && !w.current.contains(F.target) && g.current && !g.current.contains(F.target) && C();
|
|
450
473
|
};
|
|
451
|
-
return document.addEventListener("mousedown",
|
|
452
|
-
}, []);
|
|
453
|
-
const
|
|
474
|
+
return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
|
|
475
|
+
}, [c]);
|
|
476
|
+
const D = l.find((_) => _.value === e), J = d === "xs" ? P[1] : d === "small" ? P[2] : P[3], te = m && /* @__PURE__ */ t.jsx(
|
|
454
477
|
"div",
|
|
455
478
|
{
|
|
456
479
|
ref: g,
|
|
457
480
|
role: "listbox",
|
|
458
|
-
"aria-labelledby":
|
|
459
|
-
className:
|
|
460
|
-
|
|
461
|
-
|
|
481
|
+
"aria-labelledby": s ? x : void 0,
|
|
482
|
+
className: [
|
|
483
|
+
"ds-select-dropdown",
|
|
484
|
+
`ds-select-dropdown--${d}`,
|
|
485
|
+
`ds-select-dropdown--${E}`,
|
|
486
|
+
c && "ds-select-dropdown--closing"
|
|
487
|
+
].filter(Boolean).join(" "),
|
|
488
|
+
style: j,
|
|
489
|
+
children: l.map((_) => /* @__PURE__ */ t.jsx(
|
|
462
490
|
"button",
|
|
463
491
|
{
|
|
464
492
|
type: "button",
|
|
465
493
|
role: "option",
|
|
466
|
-
"aria-selected": e ===
|
|
467
|
-
className: `ds-select-option ds-select-option--${
|
|
494
|
+
"aria-selected": e === _.value,
|
|
495
|
+
className: `ds-select-option ds-select-option--${d} ${e === _.value ? "ds-select-option--selected" : ""}`,
|
|
468
496
|
onClick: () => {
|
|
469
|
-
r == null || r(
|
|
497
|
+
r == null || r(_.value), C();
|
|
470
498
|
},
|
|
471
|
-
children:
|
|
499
|
+
children: _.label
|
|
472
500
|
},
|
|
473
|
-
|
|
501
|
+
_.value
|
|
474
502
|
))
|
|
475
503
|
}
|
|
476
504
|
);
|
|
477
|
-
return /* @__PURE__ */
|
|
478
|
-
|
|
479
|
-
/* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${p ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
506
|
+
s && /* @__PURE__ */ t.jsx("label", { id: x, className: "ds-select-label", children: s }),
|
|
507
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-select-container", ref: w, children: /* @__PURE__ */ t.jsxs(
|
|
480
508
|
"button",
|
|
481
509
|
{
|
|
482
510
|
type: "button",
|
|
483
|
-
id:
|
|
511
|
+
id: z,
|
|
484
512
|
role: "combobox",
|
|
485
513
|
"aria-haspopup": "listbox",
|
|
486
|
-
"aria-expanded":
|
|
487
|
-
"aria-labelledby":
|
|
514
|
+
"aria-expanded": m,
|
|
515
|
+
"aria-labelledby": s ? x : void 0,
|
|
488
516
|
"aria-invalid": a ? "true" : "false",
|
|
489
|
-
"aria-describedby":
|
|
490
|
-
className: `ds-select-trigger ds-select-trigger--${
|
|
491
|
-
onClick: () =>
|
|
517
|
+
"aria-describedby": T,
|
|
518
|
+
className: `ds-select-trigger ds-select-trigger--${d} ${a ? "ds-select-trigger--error" : ""}`,
|
|
519
|
+
onClick: () => {
|
|
520
|
+
p || (m ? C() : (clearTimeout(W.current), v(!1), h(!0)));
|
|
521
|
+
},
|
|
492
522
|
disabled: p,
|
|
493
|
-
...
|
|
523
|
+
...f,
|
|
494
524
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
|
|
525
|
+
/* @__PURE__ */ t.jsx("span", { className: D ? "" : "ds-select-placeholder", children: (D == null ? void 0 : D.label) || n }),
|
|
526
|
+
/* @__PURE__ */ t.jsx(
|
|
527
|
+
ee,
|
|
498
528
|
{
|
|
499
|
-
size:
|
|
529
|
+
size: J,
|
|
500
530
|
strokeWidth: 1.5,
|
|
501
|
-
className: `ds-select-icon ${
|
|
531
|
+
className: `ds-select-icon ${m && E === "down" ? "ds-select-icon--open" : ""} ${m && E === "up" ? "ds-select-icon--up" : ""}`,
|
|
502
532
|
"aria-hidden": "true"
|
|
503
533
|
}
|
|
504
534
|
)
|
|
505
535
|
]
|
|
506
536
|
}
|
|
507
537
|
) }),
|
|
508
|
-
a && /* @__PURE__ */
|
|
509
|
-
typeof document < "u" &&
|
|
538
|
+
a && /* @__PURE__ */ t.jsx("span", { id: T, className: "ds-select-error", role: "alert", children: a }),
|
|
539
|
+
typeof document < "u" && Q.createPortal(te, document.body)
|
|
510
540
|
] });
|
|
511
541
|
}
|
|
512
542
|
function Ye({
|
|
513
|
-
label:
|
|
543
|
+
label: s,
|
|
514
544
|
value: e = 0,
|
|
515
545
|
onChange: r,
|
|
516
546
|
min: l = 0,
|
|
517
547
|
max: n = 100,
|
|
518
548
|
step: a = 1,
|
|
519
|
-
size:
|
|
520
|
-
disabled:
|
|
549
|
+
size: i = "m",
|
|
550
|
+
disabled: d = !1,
|
|
521
551
|
hint: p,
|
|
522
|
-
error:
|
|
523
|
-
...
|
|
552
|
+
error: u,
|
|
553
|
+
...f
|
|
524
554
|
}) {
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
r == null || r(
|
|
529
|
-
},
|
|
530
|
-
if (
|
|
531
|
-
const
|
|
532
|
-
r == null || r(
|
|
533
|
-
},
|
|
534
|
-
if (
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
555
|
+
const m = () => {
|
|
556
|
+
if (d) return;
|
|
557
|
+
const E = Math.min(Number(e) + a, n);
|
|
558
|
+
r == null || r(E);
|
|
559
|
+
}, h = () => {
|
|
560
|
+
if (d) return;
|
|
561
|
+
const E = Math.max(Number(e) - a, l);
|
|
562
|
+
r == null || r(E);
|
|
563
|
+
}, c = (E) => {
|
|
564
|
+
if (d) return;
|
|
565
|
+
const $ = E.target.value;
|
|
566
|
+
if ($ === "") {
|
|
537
567
|
r == null || r(l);
|
|
538
568
|
return;
|
|
539
569
|
}
|
|
540
|
-
const
|
|
541
|
-
if (!isNaN(
|
|
542
|
-
const
|
|
543
|
-
r == null || r(
|
|
570
|
+
const w = Number($);
|
|
571
|
+
if (!isNaN(w)) {
|
|
572
|
+
const g = Math.min(Math.max(w, l), n);
|
|
573
|
+
r == null || r(g);
|
|
544
574
|
}
|
|
545
|
-
},
|
|
575
|
+
}, v = [
|
|
546
576
|
"ds-stepper-wrapper",
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
].filter(Boolean).join(" "),
|
|
577
|
+
d && "ds-stepper-wrapper--disabled",
|
|
578
|
+
u && "ds-stepper-wrapper--error"
|
|
579
|
+
].filter(Boolean).join(" "), j = [
|
|
550
580
|
"ds-stepper",
|
|
551
|
-
`ds-stepper--${
|
|
552
|
-
|
|
553
|
-
].filter(Boolean).join(" "),
|
|
554
|
-
return /* @__PURE__ */
|
|
555
|
-
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
581
|
+
`ds-stepper--${i}`,
|
|
582
|
+
d && "ds-stepper--disabled"
|
|
583
|
+
].filter(Boolean).join(" "), y = i === "xs" ? P[1] : i === "small" ? P[2] : P[3];
|
|
584
|
+
return /* @__PURE__ */ t.jsxs("div", { className: v, children: [
|
|
585
|
+
s && /* @__PURE__ */ t.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
586
|
+
/* @__PURE__ */ t.jsxs("div", { className: j, children: [
|
|
587
|
+
/* @__PURE__ */ t.jsx(
|
|
558
588
|
"button",
|
|
559
589
|
{
|
|
560
590
|
type: "button",
|
|
561
591
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
592
|
+
onClick: h,
|
|
593
|
+
disabled: d || e <= l,
|
|
564
594
|
"aria-label": "Decrease",
|
|
565
|
-
children: /* @__PURE__ */
|
|
595
|
+
children: /* @__PURE__ */ t.jsx(je, { size: y, strokeWidth: 1.5 })
|
|
566
596
|
}
|
|
567
597
|
),
|
|
568
|
-
/* @__PURE__ */
|
|
598
|
+
/* @__PURE__ */ t.jsx(
|
|
569
599
|
"input",
|
|
570
600
|
{
|
|
571
601
|
type: "number",
|
|
572
602
|
className: "ds-stepper-input",
|
|
573
603
|
value: e,
|
|
574
|
-
onChange:
|
|
604
|
+
onChange: c,
|
|
575
605
|
min: l,
|
|
576
606
|
max: n,
|
|
577
607
|
step: a,
|
|
578
|
-
disabled:
|
|
579
|
-
...
|
|
608
|
+
disabled: d,
|
|
609
|
+
...f
|
|
580
610
|
}
|
|
581
611
|
),
|
|
582
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ t.jsx(
|
|
583
613
|
"button",
|
|
584
614
|
{
|
|
585
615
|
type: "button",
|
|
586
616
|
className: "ds-stepper-button ds-stepper-button--plus",
|
|
587
|
-
onClick:
|
|
588
|
-
disabled:
|
|
617
|
+
onClick: m,
|
|
618
|
+
disabled: d || e >= n,
|
|
589
619
|
"aria-label": "Increase",
|
|
590
|
-
children: /* @__PURE__ */
|
|
620
|
+
children: /* @__PURE__ */ t.jsx(_e, { size: y, strokeWidth: 1.5 })
|
|
591
621
|
}
|
|
592
622
|
)
|
|
593
623
|
] }),
|
|
594
|
-
p && !
|
|
595
|
-
|
|
624
|
+
p && !u && /* @__PURE__ */ t.jsx("div", { className: "ds-stepper-hint", children: p }),
|
|
625
|
+
u && /* @__PURE__ */ t.jsx("div", { className: "ds-stepper-error", children: u })
|
|
596
626
|
] });
|
|
597
627
|
}
|
|
598
|
-
function
|
|
599
|
-
children:
|
|
628
|
+
function Ue({
|
|
629
|
+
children: s,
|
|
600
630
|
padding: e = "m",
|
|
601
631
|
variant: r = "info",
|
|
602
632
|
hover: l = !1,
|
|
603
633
|
// deprecated, use variant="interactive"
|
|
604
634
|
onClick: n,
|
|
605
635
|
href: a,
|
|
606
|
-
disabled:
|
|
607
|
-
...
|
|
636
|
+
disabled: i = !1,
|
|
637
|
+
...d
|
|
608
638
|
}) {
|
|
609
|
-
const
|
|
639
|
+
const u = (l ? "interactive" : r) === "interactive" || n || a, f = [
|
|
610
640
|
"ds-card",
|
|
611
641
|
`ds-card--${e}`,
|
|
612
|
-
|
|
642
|
+
u && "ds-card--interactive"
|
|
613
643
|
].filter(Boolean).join(" ");
|
|
614
644
|
if (a) {
|
|
615
|
-
const
|
|
616
|
-
if (
|
|
617
|
-
|
|
645
|
+
const c = (v) => {
|
|
646
|
+
if (i) {
|
|
647
|
+
v.preventDefault();
|
|
618
648
|
return;
|
|
619
649
|
}
|
|
620
|
-
|
|
650
|
+
v.metaKey || v.ctrlKey || v.button === 1 || (v.preventDefault(), n == null || n(v));
|
|
621
651
|
};
|
|
622
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ t.jsx(
|
|
623
653
|
"a",
|
|
624
654
|
{
|
|
625
|
-
className:
|
|
626
|
-
href:
|
|
627
|
-
onClick:
|
|
628
|
-
"aria-disabled":
|
|
629
|
-
...
|
|
630
|
-
children:
|
|
655
|
+
className: f,
|
|
656
|
+
href: i ? void 0 : a,
|
|
657
|
+
onClick: c,
|
|
658
|
+
"aria-disabled": i ? "true" : void 0,
|
|
659
|
+
...d,
|
|
660
|
+
children: s
|
|
631
661
|
}
|
|
632
662
|
);
|
|
633
663
|
}
|
|
634
|
-
const
|
|
664
|
+
const m = u && n ? "button" : "div", h = u && n ? {
|
|
635
665
|
type: "button",
|
|
636
666
|
onClick: n,
|
|
637
|
-
disabled:
|
|
667
|
+
disabled: i
|
|
638
668
|
} : {};
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
|
|
669
|
+
return /* @__PURE__ */ t.jsx(
|
|
670
|
+
m,
|
|
641
671
|
{
|
|
642
|
-
className:
|
|
643
|
-
role:
|
|
644
|
-
...
|
|
645
|
-
...
|
|
646
|
-
children:
|
|
672
|
+
className: f,
|
|
673
|
+
role: u && !n ? "article" : void 0,
|
|
674
|
+
...h,
|
|
675
|
+
...d,
|
|
676
|
+
children: s
|
|
647
677
|
}
|
|
648
678
|
);
|
|
649
679
|
}
|
|
650
|
-
function
|
|
651
|
-
return /* @__PURE__ */
|
|
680
|
+
function qe({ children: s, ...e }) {
|
|
681
|
+
return /* @__PURE__ */ t.jsx("h1", { className: "ds-h1", ...e, children: s });
|
|
652
682
|
}
|
|
653
|
-
function
|
|
654
|
-
return /* @__PURE__ */
|
|
683
|
+
function He({ children: s, ...e }) {
|
|
684
|
+
return /* @__PURE__ */ t.jsx("h2", { className: "ds-h2", ...e, children: s });
|
|
655
685
|
}
|
|
656
|
-
function
|
|
657
|
-
return /* @__PURE__ */
|
|
686
|
+
function Ge({ children: s, ...e }) {
|
|
687
|
+
return /* @__PURE__ */ t.jsx("h3", { className: "ds-h3", ...e, children: s });
|
|
658
688
|
}
|
|
659
|
-
function
|
|
660
|
-
return /* @__PURE__ */
|
|
689
|
+
function Xe({ children: s, ...e }) {
|
|
690
|
+
return /* @__PURE__ */ t.jsx("h4", { className: "ds-h4", ...e, children: s });
|
|
661
691
|
}
|
|
662
|
-
function
|
|
663
|
-
return /* @__PURE__ */
|
|
692
|
+
function Je({ children: s, secondary: e = !1, ...r }) {
|
|
693
|
+
return /* @__PURE__ */ t.jsx("p", { className: `ds-p1 ${e ? "ds-p1--secondary" : ""}`, ...r, children: s });
|
|
664
694
|
}
|
|
665
|
-
function
|
|
666
|
-
return /* @__PURE__ */
|
|
695
|
+
function Ke({ children: s, secondary: e = !1, ...r }) {
|
|
696
|
+
return /* @__PURE__ */ t.jsx("p", { className: `ds-p2 ${e ? "ds-p2--secondary" : ""}`, ...r, children: s });
|
|
667
697
|
}
|
|
668
|
-
function
|
|
669
|
-
return /* @__PURE__ */
|
|
698
|
+
function Ze({ children: s, secondary: e = !1, ...r }) {
|
|
699
|
+
return /* @__PURE__ */ t.jsx("p", { className: `ds-p3 ${e ? "ds-p3--secondary" : ""}`, ...r, children: s });
|
|
670
700
|
}
|
|
671
|
-
function
|
|
672
|
-
children:
|
|
701
|
+
function Qe({
|
|
702
|
+
children: s,
|
|
673
703
|
variant: e = "default",
|
|
674
704
|
size: r = "m",
|
|
675
705
|
role: l,
|
|
@@ -679,517 +709,575 @@ function Je({
|
|
|
679
709
|
"ds-badge",
|
|
680
710
|
`ds-badge--${e}`,
|
|
681
711
|
`ds-badge--${r}`
|
|
682
|
-
].filter(Boolean).join(" "),
|
|
683
|
-
return /* @__PURE__ */
|
|
712
|
+
].filter(Boolean).join(" "), i = l || (["info", "success", "warning", "error"].includes(e) ? "status" : void 0);
|
|
713
|
+
return /* @__PURE__ */ t.jsx("span", { className: a, role: i, ...n, children: s });
|
|
684
714
|
}
|
|
685
|
-
const
|
|
686
|
-
info:
|
|
715
|
+
const ge = {
|
|
716
|
+
info: he,
|
|
687
717
|
success: pe,
|
|
688
718
|
warning: me,
|
|
689
719
|
error: fe
|
|
690
720
|
};
|
|
691
|
-
function
|
|
692
|
-
children:
|
|
721
|
+
function et({
|
|
722
|
+
children: s,
|
|
693
723
|
variant: e = "info",
|
|
694
724
|
title: r,
|
|
695
725
|
onClose: l,
|
|
696
726
|
role: n,
|
|
697
727
|
...a
|
|
698
728
|
}) {
|
|
699
|
-
const
|
|
700
|
-
return /* @__PURE__ */
|
|
701
|
-
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
r && /* @__PURE__ */
|
|
704
|
-
|
|
729
|
+
const i = ge[e], d = n || (e === "error" ? "alert" : "status");
|
|
730
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `ds-alert ds-alert--${e} ${r ? "" : "ds-alert--no-title"}`, role: d, ...a, children: [
|
|
731
|
+
i && /* @__PURE__ */ t.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ t.jsx(i, { size: P[3], strokeWidth: 1.5 }) }),
|
|
732
|
+
/* @__PURE__ */ t.jsxs("div", { className: "ds-alert__content", children: [
|
|
733
|
+
r && /* @__PURE__ */ t.jsx("div", { className: "ds-alert__title", children: r }),
|
|
734
|
+
s && /* @__PURE__ */ t.jsx("div", { className: "ds-alert__message", children: s })
|
|
705
735
|
] }),
|
|
706
|
-
l && /* @__PURE__ */
|
|
736
|
+
l && /* @__PURE__ */ t.jsx(
|
|
707
737
|
"button",
|
|
708
738
|
{
|
|
709
739
|
type: "button",
|
|
710
740
|
className: "ds-alert__close",
|
|
711
741
|
onClick: l,
|
|
712
742
|
"aria-label": "Close alert",
|
|
713
|
-
children: /* @__PURE__ */
|
|
743
|
+
children: /* @__PURE__ */ t.jsx(le, { size: P[3], strokeWidth: 1.5 })
|
|
714
744
|
}
|
|
715
745
|
)
|
|
716
746
|
] });
|
|
717
747
|
}
|
|
718
|
-
|
|
719
|
-
|
|
748
|
+
const Te = 200;
|
|
749
|
+
function tt({
|
|
750
|
+
children: s,
|
|
720
751
|
title: e,
|
|
721
752
|
onClose: r,
|
|
722
753
|
size: l = "m",
|
|
723
754
|
...n
|
|
724
755
|
}) {
|
|
725
|
-
const a =
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
756
|
+
const a = A(null), i = B.useId(), [d, p] = S(!1), u = () => {
|
|
757
|
+
!r || d || (p(!0), setTimeout(() => {
|
|
758
|
+
p(!1), r();
|
|
759
|
+
}, Te));
|
|
760
|
+
};
|
|
761
|
+
L(() => {
|
|
762
|
+
const c = (j) => {
|
|
763
|
+
j.key === "Escape" && u();
|
|
764
|
+
}, v = (j) => {
|
|
765
|
+
a.current && !a.current.contains(j.target) && u();
|
|
731
766
|
};
|
|
732
|
-
return document.addEventListener("keydown",
|
|
733
|
-
document.removeEventListener("keydown",
|
|
767
|
+
return document.addEventListener("keydown", c), document.addEventListener("mousedown", v), () => {
|
|
768
|
+
document.removeEventListener("keydown", c), document.removeEventListener("mousedown", v);
|
|
734
769
|
};
|
|
735
|
-
}, [r]);
|
|
736
|
-
const
|
|
737
|
-
return /* @__PURE__ */
|
|
770
|
+
}, [r, d]);
|
|
771
|
+
const f = B.Children.toArray(s), m = f.find((c) => (c == null ? void 0 : c.type) === de), h = f.filter((c) => (c == null ? void 0 : c.type) !== de);
|
|
772
|
+
return /* @__PURE__ */ t.jsx("div", { className: ["ds-modal-overlay", d && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...n, children: /* @__PURE__ */ t.jsxs(
|
|
738
773
|
"div",
|
|
739
774
|
{
|
|
740
775
|
className: `ds-modal ds-modal--${l}`,
|
|
741
776
|
ref: a,
|
|
742
777
|
role: "dialog",
|
|
743
778
|
"aria-modal": "true",
|
|
744
|
-
"aria-labelledby": e ?
|
|
779
|
+
"aria-labelledby": e ? i : void 0,
|
|
745
780
|
children: [
|
|
746
|
-
(e || r) && /* @__PURE__ */
|
|
747
|
-
e && /* @__PURE__ */
|
|
748
|
-
r && /* @__PURE__ */
|
|
749
|
-
|
|
781
|
+
(e || r) && /* @__PURE__ */ t.jsxs("div", { className: "ds-modal__header", children: [
|
|
782
|
+
e && /* @__PURE__ */ t.jsx("h3", { id: i, className: "ds-modal__title", children: e }),
|
|
783
|
+
r && /* @__PURE__ */ t.jsx(
|
|
784
|
+
$e,
|
|
750
785
|
{
|
|
751
786
|
variant: "ghost",
|
|
752
787
|
size: "small",
|
|
753
|
-
icon: /* @__PURE__ */
|
|
754
|
-
onClick:
|
|
788
|
+
icon: /* @__PURE__ */ t.jsx(le, { size: P[2], strokeWidth: 1.5 }),
|
|
789
|
+
onClick: u,
|
|
755
790
|
"aria-label": "Close modal"
|
|
756
791
|
}
|
|
757
792
|
)
|
|
758
793
|
] }),
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
|
|
794
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-modal__body", children: h }),
|
|
795
|
+
m
|
|
761
796
|
]
|
|
762
797
|
}
|
|
763
798
|
) });
|
|
764
799
|
}
|
|
765
|
-
function de({ children:
|
|
766
|
-
return /* @__PURE__ */
|
|
800
|
+
function de({ children: s }) {
|
|
801
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-modal__footer", children: s });
|
|
767
802
|
}
|
|
768
|
-
function
|
|
769
|
-
children:
|
|
803
|
+
function Se({
|
|
804
|
+
children: s,
|
|
770
805
|
title: e = "Code",
|
|
771
806
|
defaultExpanded: r = !1,
|
|
772
807
|
expanded: l,
|
|
773
808
|
onToggle: n,
|
|
774
809
|
padding: a = "s",
|
|
775
|
-
className:
|
|
776
|
-
...
|
|
810
|
+
className: i = "",
|
|
811
|
+
...d
|
|
777
812
|
}) {
|
|
778
|
-
const [p,
|
|
779
|
-
|
|
780
|
-
},
|
|
813
|
+
const [p, u] = S(r), f = l !== void 0, m = f ? l : p, h = () => {
|
|
814
|
+
f ? n == null || n(!l) : u((v) => !v);
|
|
815
|
+
}, c = [
|
|
781
816
|
"ds-code-accordion",
|
|
782
817
|
`ds-code-accordion--${a}`,
|
|
783
|
-
|
|
818
|
+
m && "ds-code-accordion--expanded",
|
|
819
|
+
i
|
|
784
820
|
].filter(Boolean).join(" ");
|
|
785
|
-
return /* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ t.jsxs("div", { className: c, ...d, children: [
|
|
822
|
+
/* @__PURE__ */ t.jsxs(
|
|
787
823
|
"button",
|
|
788
824
|
{
|
|
789
825
|
type: "button",
|
|
790
826
|
className: "ds-code-accordion__header",
|
|
791
|
-
onClick:
|
|
792
|
-
"aria-expanded":
|
|
827
|
+
onClick: h,
|
|
828
|
+
"aria-expanded": m,
|
|
793
829
|
children: [
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
|
|
830
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-code-accordion__title", children: e }),
|
|
831
|
+
/* @__PURE__ */ t.jsx(
|
|
832
|
+
ee,
|
|
797
833
|
{
|
|
798
|
-
size:
|
|
834
|
+
size: P[2],
|
|
799
835
|
strokeWidth: 1.5,
|
|
800
|
-
className: `ds-code-accordion__icon ${
|
|
836
|
+
className: `ds-code-accordion__icon ${m ? "ds-code-accordion__icon--expanded" : ""}`
|
|
801
837
|
}
|
|
802
838
|
)
|
|
803
839
|
]
|
|
804
840
|
}
|
|
805
841
|
),
|
|
806
|
-
|
|
842
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ t.jsx("pre", { className: "ds-code-accordion__pre", children: /* @__PURE__ */ t.jsx("code", { children: s }) }) })
|
|
807
843
|
] });
|
|
808
844
|
}
|
|
809
|
-
function
|
|
810
|
-
return e ? r ? /* @__PURE__ */
|
|
845
|
+
function st({ children: s, block: e = !1, collapsible: r = !1, title: l = "Code", defaultExpanded: n = !1, ...a }) {
|
|
846
|
+
return e ? r ? /* @__PURE__ */ t.jsx(Se, { title: l, 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
847
|
}
|
|
812
|
-
function
|
|
813
|
-
const
|
|
814
|
-
return /* @__PURE__ */
|
|
848
|
+
function rt({ href: s, children: e, onClick: r, target: l, rel: n, ...a }) {
|
|
849
|
+
const d = l === "_blank" ? n ? `${n} noopener noreferrer` : "noopener noreferrer" : n;
|
|
850
|
+
return /* @__PURE__ */ t.jsx(
|
|
815
851
|
"a",
|
|
816
852
|
{
|
|
817
|
-
href:
|
|
853
|
+
href: s,
|
|
818
854
|
className: "ds-link",
|
|
819
855
|
onClick: r,
|
|
820
856
|
target: l,
|
|
821
|
-
rel:
|
|
857
|
+
rel: d,
|
|
822
858
|
...a,
|
|
823
859
|
children: e
|
|
824
860
|
}
|
|
825
861
|
);
|
|
826
862
|
}
|
|
827
|
-
function
|
|
828
|
-
return /* @__PURE__ */
|
|
863
|
+
function nt({ children: s, size: e = "m", variant: r = "ghost", ...l }) {
|
|
864
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-tabs", role: "tablist", ...l, children: B.Children.map(s, (n) => B.isValidElement(n) ? B.cloneElement(n, { size: e, variant: r }) : n) });
|
|
829
865
|
}
|
|
830
|
-
function
|
|
831
|
-
const
|
|
866
|
+
function at({ children: s, selected: e = !1, onClick: r, size: l = "m", variant: n = "ghost", disabled: a = !1, icon: i, href: d, ...p }) {
|
|
867
|
+
const u = i && !s, f = [
|
|
832
868
|
"ds-tab",
|
|
833
869
|
`ds-tab--${l}`,
|
|
834
870
|
`ds-tab--${n}`,
|
|
835
871
|
e && "ds-tab--selected",
|
|
836
|
-
|
|
837
|
-
].filter(Boolean).join(" "),
|
|
838
|
-
|
|
839
|
-
|
|
872
|
+
u && "ds-tab--icon-only"
|
|
873
|
+
].filter(Boolean).join(" "), m = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
874
|
+
i && /* @__PURE__ */ t.jsx("span", { className: "ds-tab-icon", children: i }),
|
|
875
|
+
s
|
|
840
876
|
] });
|
|
841
|
-
if (
|
|
842
|
-
const
|
|
877
|
+
if (d) {
|
|
878
|
+
const h = (c) => {
|
|
843
879
|
if (a) {
|
|
844
|
-
|
|
880
|
+
c.preventDefault();
|
|
845
881
|
return;
|
|
846
882
|
}
|
|
847
|
-
|
|
883
|
+
c.metaKey || c.ctrlKey || c.button === 1 || (c.preventDefault(), r == null || r(c));
|
|
848
884
|
};
|
|
849
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ t.jsx(
|
|
850
886
|
"a",
|
|
851
887
|
{
|
|
852
888
|
role: "tab",
|
|
853
889
|
"aria-current": e ? "page" : void 0,
|
|
854
890
|
"aria-disabled": a ? "true" : void 0,
|
|
855
|
-
className:
|
|
856
|
-
href: a ? void 0 :
|
|
857
|
-
onClick:
|
|
891
|
+
className: f,
|
|
892
|
+
href: a ? void 0 : d,
|
|
893
|
+
onClick: h,
|
|
858
894
|
...p,
|
|
859
|
-
children:
|
|
895
|
+
children: m
|
|
860
896
|
}
|
|
861
897
|
);
|
|
862
898
|
}
|
|
863
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ t.jsx(
|
|
864
900
|
"button",
|
|
865
901
|
{
|
|
866
902
|
role: "tab",
|
|
867
903
|
"aria-selected": e,
|
|
868
|
-
className:
|
|
904
|
+
className: f,
|
|
869
905
|
onClick: r,
|
|
870
906
|
disabled: a,
|
|
871
907
|
...p,
|
|
872
|
-
children:
|
|
908
|
+
children: m
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
function ot({ options: s, value: e, onChange: r, size: l = "m", disabled: n = !1 }) {
|
|
913
|
+
const a = A(null), i = A(null), [d, p] = S(!1), u = A(!1), f = A(null), m = A(null), h = () => {
|
|
914
|
+
if (!a.current) return;
|
|
915
|
+
const c = a.current.querySelector(`[data-value="${e}"]`);
|
|
916
|
+
if (!c) return;
|
|
917
|
+
const v = a.current.getBoundingClientRect(), j = c.getBoundingClientRect(), y = j.left - v.left, E = j.width;
|
|
918
|
+
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = y + "px", i.current.style.width = E + "px", u.current = !1) : (p(!0), requestAnimationFrame(() => {
|
|
919
|
+
if (!i.current || !a.current) return;
|
|
920
|
+
const $ = a.current.querySelector(`[data-value="${e}"]`);
|
|
921
|
+
if (!$) return;
|
|
922
|
+
const w = a.current.getBoundingClientRect(), g = $.getBoundingClientRect();
|
|
923
|
+
i.current.style.transition = "none", i.current.style.left = g.left - w.left + "px", i.current.style.width = g.width + "px";
|
|
924
|
+
}));
|
|
925
|
+
};
|
|
926
|
+
return m.current = h, ve(() => {
|
|
927
|
+
const c = f.current !== e;
|
|
928
|
+
f.current = e, u.current = d && c, h();
|
|
929
|
+
}), L(() => {
|
|
930
|
+
if (!a.current) return;
|
|
931
|
+
const c = new ResizeObserver(() => {
|
|
932
|
+
u.current = !1, m.current();
|
|
933
|
+
});
|
|
934
|
+
return c.observe(a.current), () => c.disconnect();
|
|
935
|
+
}, []), /* @__PURE__ */ t.jsxs(
|
|
936
|
+
"div",
|
|
937
|
+
{
|
|
938
|
+
className: [
|
|
939
|
+
"ds-seg",
|
|
940
|
+
`ds-seg--${l}`,
|
|
941
|
+
n && "ds-seg--disabled"
|
|
942
|
+
].filter(Boolean).join(" "),
|
|
943
|
+
ref: a,
|
|
944
|
+
role: "group",
|
|
945
|
+
children: [
|
|
946
|
+
d && /* @__PURE__ */ t.jsx(
|
|
947
|
+
"div",
|
|
948
|
+
{
|
|
949
|
+
ref: i,
|
|
950
|
+
className: "ds-seg__pill",
|
|
951
|
+
"aria-hidden": "true"
|
|
952
|
+
}
|
|
953
|
+
),
|
|
954
|
+
s.map((c) => /* @__PURE__ */ t.jsxs(
|
|
955
|
+
"button",
|
|
956
|
+
{
|
|
957
|
+
type: "button",
|
|
958
|
+
"data-value": c.value,
|
|
959
|
+
className: ["ds-seg__btn", e === c.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
960
|
+
onClick: () => !n && r(c.value),
|
|
961
|
+
"aria-pressed": e === c.value,
|
|
962
|
+
disabled: n,
|
|
963
|
+
children: [
|
|
964
|
+
c.icon && /* @__PURE__ */ t.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: c.icon }),
|
|
965
|
+
c.label
|
|
966
|
+
]
|
|
967
|
+
},
|
|
968
|
+
c.value
|
|
969
|
+
))
|
|
970
|
+
]
|
|
873
971
|
}
|
|
874
972
|
);
|
|
875
973
|
}
|
|
876
|
-
function
|
|
877
|
-
children:
|
|
974
|
+
function lt({
|
|
975
|
+
children: s,
|
|
878
976
|
title: e,
|
|
879
977
|
defaultExpanded: r = !1,
|
|
880
978
|
expanded: l,
|
|
881
979
|
onToggle: n,
|
|
882
980
|
padding: a = "m",
|
|
883
|
-
...
|
|
981
|
+
...i
|
|
884
982
|
}) {
|
|
885
|
-
const [
|
|
886
|
-
|
|
887
|
-
},
|
|
983
|
+
const [d, p] = S(r), u = l !== void 0, f = u ? l : d, m = () => {
|
|
984
|
+
u ? n == null || n(!l) : p((c) => !c);
|
|
985
|
+
}, h = [
|
|
888
986
|
"ds-accordion",
|
|
889
|
-
`ds-accordion--${a}
|
|
987
|
+
`ds-accordion--${a}`,
|
|
988
|
+
f && "ds-accordion--expanded"
|
|
890
989
|
].filter(Boolean).join(" ");
|
|
891
|
-
return /* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ t.jsxs("div", { className: h, ...i, children: [
|
|
991
|
+
/* @__PURE__ */ t.jsxs(
|
|
893
992
|
"button",
|
|
894
993
|
{
|
|
895
994
|
type: "button",
|
|
896
995
|
className: "ds-accordion__header",
|
|
897
|
-
onClick:
|
|
898
|
-
"aria-expanded":
|
|
996
|
+
onClick: m,
|
|
997
|
+
"aria-expanded": f,
|
|
899
998
|
children: [
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
|
|
999
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-accordion__title", children: e }),
|
|
1000
|
+
/* @__PURE__ */ t.jsx(
|
|
1001
|
+
ee,
|
|
903
1002
|
{
|
|
904
|
-
size:
|
|
1003
|
+
size: P[2],
|
|
905
1004
|
strokeWidth: 1.5,
|
|
906
|
-
className: `ds-accordion__icon ${
|
|
1005
|
+
className: `ds-accordion__icon ${f ? "ds-accordion__icon--expanded" : ""}`
|
|
907
1006
|
}
|
|
908
1007
|
)
|
|
909
1008
|
]
|
|
910
1009
|
}
|
|
911
1010
|
),
|
|
912
|
-
|
|
1011
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ t.jsx("div", { className: "ds-accordion__content-inner", children: s }) })
|
|
913
1012
|
] });
|
|
914
1013
|
}
|
|
915
|
-
const
|
|
916
|
-
function
|
|
1014
|
+
const M = 8, Y = 8;
|
|
1015
|
+
function Ie(s, e, r) {
|
|
917
1016
|
const l = window.innerWidth;
|
|
918
1017
|
let n, a;
|
|
919
|
-
switch (
|
|
1018
|
+
switch (s) {
|
|
920
1019
|
case "top":
|
|
921
|
-
n = e.top - r.height -
|
|
1020
|
+
n = e.top - r.height - M, a = e.left + e.width / 2 - r.width / 2;
|
|
922
1021
|
break;
|
|
923
1022
|
case "bottom":
|
|
924
|
-
n = e.bottom +
|
|
1023
|
+
n = e.bottom + M, a = e.left + e.width / 2 - r.width / 2;
|
|
925
1024
|
break;
|
|
926
1025
|
case "left":
|
|
927
|
-
n = e.top + e.height / 2 - r.height / 2, a = e.left - r.width -
|
|
1026
|
+
n = e.top + e.height / 2 - r.height / 2, a = e.left - r.width - M;
|
|
928
1027
|
break;
|
|
929
1028
|
case "right":
|
|
930
|
-
n = e.top + e.height / 2 - r.height / 2, a = e.right +
|
|
1029
|
+
n = e.top + e.height / 2 - r.height / 2, a = e.right + M;
|
|
931
1030
|
break;
|
|
932
1031
|
default:
|
|
933
|
-
n = e.bottom +
|
|
1032
|
+
n = e.bottom + M, a = e.left;
|
|
934
1033
|
}
|
|
935
|
-
const
|
|
936
|
-
return { top: n, left:
|
|
1034
|
+
const i = Math.max(Y, Math.min(l - r.width - Y, a)), d = a - i;
|
|
1035
|
+
return { top: n, left: i, arrowOffset: d };
|
|
937
1036
|
}
|
|
938
|
-
function
|
|
1037
|
+
function Ae(s, e, r) {
|
|
939
1038
|
const l = window.innerWidth, n = window.innerHeight;
|
|
940
|
-
if (
|
|
941
|
-
if (n -
|
|
942
|
-
if (l -
|
|
943
|
-
if (
|
|
944
|
-
const a = Math.max(
|
|
945
|
-
return a ===
|
|
1039
|
+
if (s.top >= e + M + Y) return "top";
|
|
1040
|
+
if (n - s.bottom >= e + M + Y) return "bottom";
|
|
1041
|
+
if (l - s.right >= r + M + Y) return "right";
|
|
1042
|
+
if (s.left >= r + M + Y) return "left";
|
|
1043
|
+
const a = Math.max(s.top, n - s.bottom, s.left, l - s.right);
|
|
1044
|
+
return a === s.top ? "top" : a === n - s.bottom ? "bottom" : a === l - s.right ? "right" : "left";
|
|
946
1045
|
}
|
|
947
|
-
function
|
|
948
|
-
const [n, a] =
|
|
949
|
-
if (!
|
|
950
|
-
const
|
|
951
|
-
|
|
1046
|
+
function ct({ children: s, content: e, position: r, ...l }) {
|
|
1047
|
+
const [n, a] = S(!1), [i, d] = S({ visibility: "hidden" }), [p, u] = S(r || "top"), f = A(null), m = A(null), h = A(!1), c = () => {
|
|
1048
|
+
if (!f.current || !m.current) return;
|
|
1049
|
+
const j = f.current.getBoundingClientRect(), y = m.current.getBoundingClientRect(), E = r || Ae(j, y.height, y.width), { top: $, left: w, arrowOffset: g } = Ie(E, j, y);
|
|
1050
|
+
u(E), d({
|
|
952
1051
|
position: "fixed",
|
|
953
|
-
top:
|
|
954
|
-
left:
|
|
1052
|
+
top: $,
|
|
1053
|
+
left: w,
|
|
955
1054
|
visibility: "visible",
|
|
956
|
-
"--arrow-offset": `${
|
|
1055
|
+
"--arrow-offset": `${g}px`
|
|
957
1056
|
});
|
|
958
1057
|
};
|
|
959
|
-
if (
|
|
1058
|
+
if (L(() => {
|
|
960
1059
|
if (!n) return;
|
|
961
|
-
|
|
962
|
-
const
|
|
963
|
-
return window.addEventListener("scroll",
|
|
964
|
-
cancelAnimationFrame(
|
|
1060
|
+
d({ position: "fixed", visibility: "hidden" });
|
|
1061
|
+
const j = requestAnimationFrame(c);
|
|
1062
|
+
return window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), () => {
|
|
1063
|
+
cancelAnimationFrame(j), window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c);
|
|
965
1064
|
};
|
|
966
|
-
}, [n, r]),
|
|
1065
|
+
}, [n, r]), L(() => {
|
|
967
1066
|
if (!n) return;
|
|
968
|
-
const
|
|
969
|
-
|
|
1067
|
+
const j = (y) => {
|
|
1068
|
+
f.current && !f.current.contains(y.target) && a(!1);
|
|
970
1069
|
};
|
|
971
|
-
return document.addEventListener("touchstart",
|
|
972
|
-
}, [n]), !e) return
|
|
973
|
-
const
|
|
1070
|
+
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1071
|
+
}, [n]), !e) return s;
|
|
1072
|
+
const v = n && /* @__PURE__ */ t.jsx(
|
|
974
1073
|
"div",
|
|
975
1074
|
{
|
|
976
|
-
ref:
|
|
1075
|
+
ref: m,
|
|
977
1076
|
className: `ds-tooltip ds-tooltip--${p}`,
|
|
978
1077
|
role: "tooltip",
|
|
979
|
-
style:
|
|
1078
|
+
style: i,
|
|
980
1079
|
children: e
|
|
981
1080
|
}
|
|
982
1081
|
);
|
|
983
|
-
return /* @__PURE__ */
|
|
1082
|
+
return /* @__PURE__ */ t.jsxs(
|
|
984
1083
|
"div",
|
|
985
1084
|
{
|
|
986
|
-
ref:
|
|
1085
|
+
ref: f,
|
|
987
1086
|
className: "ds-tooltip-wrapper",
|
|
988
1087
|
onMouseEnter: () => {
|
|
989
|
-
|
|
1088
|
+
h.current || a(!0);
|
|
990
1089
|
},
|
|
991
1090
|
onMouseLeave: () => {
|
|
992
|
-
|
|
1091
|
+
h.current || a(!1);
|
|
993
1092
|
},
|
|
994
1093
|
onTouchStart: () => {
|
|
995
|
-
|
|
1094
|
+
h.current = !0, a((j) => !j);
|
|
996
1095
|
},
|
|
997
1096
|
...l,
|
|
998
1097
|
children: [
|
|
999
|
-
|
|
1000
|
-
typeof document < "u" &&
|
|
1098
|
+
s,
|
|
1099
|
+
typeof document < "u" && Q.createPortal(v, document.body)
|
|
1001
1100
|
]
|
|
1002
1101
|
}
|
|
1003
1102
|
);
|
|
1004
1103
|
}
|
|
1005
|
-
function
|
|
1006
|
-
checked:
|
|
1104
|
+
function it({
|
|
1105
|
+
checked: s = !1,
|
|
1007
1106
|
onChange: e,
|
|
1008
1107
|
size: r = "m",
|
|
1009
1108
|
disabled: l = !1,
|
|
1010
1109
|
label: n,
|
|
1011
1110
|
id: a,
|
|
1012
|
-
...
|
|
1111
|
+
...i
|
|
1013
1112
|
}) {
|
|
1014
|
-
const
|
|
1113
|
+
const d = a || `toggle-${B.useId()}`, p = [
|
|
1015
1114
|
"ds-toggle",
|
|
1016
1115
|
`ds-toggle--${r}`,
|
|
1017
1116
|
l && "ds-toggle--disabled"
|
|
1018
1117
|
].filter(Boolean).join(" ");
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1118
|
+
return /* @__PURE__ */ t.jsxs("label", { className: p, htmlFor: d, children: [
|
|
1119
|
+
/* @__PURE__ */ t.jsx(
|
|
1021
1120
|
"input",
|
|
1022
1121
|
{
|
|
1023
1122
|
type: "checkbox",
|
|
1024
|
-
id:
|
|
1123
|
+
id: d,
|
|
1025
1124
|
className: "ds-toggle__input",
|
|
1026
|
-
checked:
|
|
1027
|
-
onChange: (
|
|
1125
|
+
checked: s,
|
|
1126
|
+
onChange: (u) => e == null ? void 0 : e(u.target.checked),
|
|
1028
1127
|
disabled: l,
|
|
1029
|
-
...
|
|
1128
|
+
...i
|
|
1030
1129
|
}
|
|
1031
1130
|
),
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
n && /* @__PURE__ */
|
|
1131
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-toggle__track", children: /* @__PURE__ */ t.jsx("span", { className: "ds-toggle__thumb" }) }),
|
|
1132
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "ds-toggle__label", children: n })
|
|
1034
1133
|
] });
|
|
1035
1134
|
}
|
|
1036
|
-
function
|
|
1037
|
-
checked:
|
|
1135
|
+
function dt({
|
|
1136
|
+
checked: s = !1,
|
|
1038
1137
|
onChange: e,
|
|
1039
1138
|
size: r = "m",
|
|
1040
1139
|
disabled: l = !1,
|
|
1041
1140
|
label: n,
|
|
1042
1141
|
id: a,
|
|
1043
|
-
...
|
|
1142
|
+
...i
|
|
1044
1143
|
}) {
|
|
1045
|
-
const
|
|
1144
|
+
const d = a || `checkbox-${B.useId()}`, p = [
|
|
1046
1145
|
"ds-checkbox",
|
|
1047
1146
|
`ds-checkbox--${r}`,
|
|
1048
1147
|
l && "ds-checkbox--disabled"
|
|
1049
|
-
].filter(Boolean).join(" "),
|
|
1050
|
-
return /* @__PURE__ */
|
|
1051
|
-
/* @__PURE__ */
|
|
1148
|
+
].filter(Boolean).join(" "), u = r === "xs" ? 10 : r === "small" ? 14 : r === "large" ? 20 : 16;
|
|
1149
|
+
return /* @__PURE__ */ t.jsxs("label", { className: p, htmlFor: d, children: [
|
|
1150
|
+
/* @__PURE__ */ t.jsx(
|
|
1052
1151
|
"input",
|
|
1053
1152
|
{
|
|
1054
1153
|
type: "checkbox",
|
|
1055
|
-
id:
|
|
1154
|
+
id: d,
|
|
1056
1155
|
className: "ds-checkbox__input",
|
|
1057
|
-
checked:
|
|
1058
|
-
onChange: (
|
|
1156
|
+
checked: s,
|
|
1157
|
+
onChange: (f) => e == null ? void 0 : e(f.target.checked),
|
|
1059
1158
|
disabled: l,
|
|
1060
|
-
...
|
|
1159
|
+
...i
|
|
1061
1160
|
}
|
|
1062
1161
|
),
|
|
1063
|
-
/* @__PURE__ */
|
|
1064
|
-
|
|
1162
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-checkbox__box", children: s && /* @__PURE__ */ t.jsx(
|
|
1163
|
+
we,
|
|
1065
1164
|
{
|
|
1066
|
-
size:
|
|
1165
|
+
size: u,
|
|
1067
1166
|
strokeWidth: 2.5,
|
|
1068
1167
|
className: "ds-checkbox__icon"
|
|
1069
1168
|
}
|
|
1070
1169
|
) }),
|
|
1071
|
-
n && /* @__PURE__ */
|
|
1170
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "ds-checkbox__label", children: n })
|
|
1072
1171
|
] });
|
|
1073
1172
|
}
|
|
1074
|
-
function
|
|
1075
|
-
checked:
|
|
1173
|
+
function ut({
|
|
1174
|
+
checked: s = !1,
|
|
1076
1175
|
onChange: e,
|
|
1077
1176
|
size: r = "m",
|
|
1078
1177
|
disabled: l = !1,
|
|
1079
1178
|
label: n,
|
|
1080
1179
|
name: a,
|
|
1081
|
-
value:
|
|
1082
|
-
id:
|
|
1180
|
+
value: i,
|
|
1181
|
+
id: d,
|
|
1083
1182
|
...p
|
|
1084
1183
|
}) {
|
|
1085
|
-
const
|
|
1184
|
+
const u = d || `radio-${B.useId()}`, f = [
|
|
1086
1185
|
"ds-radio",
|
|
1087
1186
|
`ds-radio--${r}`,
|
|
1088
1187
|
l && "ds-radio--disabled"
|
|
1089
1188
|
].filter(Boolean).join(" ");
|
|
1090
|
-
return /* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ t.jsxs("label", { className: f, htmlFor: u, children: [
|
|
1190
|
+
/* @__PURE__ */ t.jsx(
|
|
1092
1191
|
"input",
|
|
1093
1192
|
{
|
|
1094
1193
|
type: "radio",
|
|
1095
|
-
id:
|
|
1194
|
+
id: u,
|
|
1096
1195
|
className: "ds-radio__input",
|
|
1097
|
-
checked:
|
|
1098
|
-
onChange: (
|
|
1196
|
+
checked: s,
|
|
1197
|
+
onChange: (m) => e == null ? void 0 : e(m.target.checked),
|
|
1099
1198
|
disabled: l,
|
|
1100
1199
|
name: a,
|
|
1101
|
-
value:
|
|
1200
|
+
value: i,
|
|
1102
1201
|
...p
|
|
1103
1202
|
}
|
|
1104
1203
|
),
|
|
1105
|
-
/* @__PURE__ */
|
|
1106
|
-
n && /* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ t.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1205
|
+
n && /* @__PURE__ */ t.jsx("span", { className: "ds-radio__label", children: n })
|
|
1107
1206
|
] });
|
|
1108
1207
|
}
|
|
1109
|
-
function
|
|
1110
|
-
return /* @__PURE__ */
|
|
1111
|
-
"span",
|
|
1112
|
-
{
|
|
1113
|
-
className: ["ds-spinner", `ds-spinner--${t}`, `ds-spinner--${e}`, r].filter(Boolean).join(" "),
|
|
1114
|
-
role: "status",
|
|
1115
|
-
"aria-label": "Loading",
|
|
1116
|
-
...l
|
|
1117
|
-
}
|
|
1118
|
-
);
|
|
1119
|
-
}
|
|
1120
|
-
function it({ width: t, height: e, shape: r = "rect", className: l = "", style: n = {}, ...a }) {
|
|
1121
|
-
return /* @__PURE__ */ s.jsx(
|
|
1208
|
+
function ft({ width: s, height: e, shape: r = "rect", className: l = "", style: n = {}, ...a }) {
|
|
1209
|
+
return /* @__PURE__ */ t.jsx(
|
|
1122
1210
|
"span",
|
|
1123
1211
|
{
|
|
1124
1212
|
className: ["ds-skeleton", `ds-skeleton--${r}`, l].filter(Boolean).join(" "),
|
|
1125
|
-
style: { width:
|
|
1213
|
+
style: { width: s, height: e, ...n },
|
|
1126
1214
|
"aria-hidden": "true",
|
|
1127
1215
|
...a
|
|
1128
1216
|
}
|
|
1129
1217
|
);
|
|
1130
1218
|
}
|
|
1131
|
-
function
|
|
1219
|
+
function Pe(s) {
|
|
1132
1220
|
let e = 2166136261;
|
|
1133
|
-
for (let r = 0; r <
|
|
1134
|
-
e ^=
|
|
1221
|
+
for (let r = 0; r < s.length; r++)
|
|
1222
|
+
e ^= s.charCodeAt(r), e = Math.imul(e, 16777619) >>> 0;
|
|
1135
1223
|
return e % 360;
|
|
1136
1224
|
}
|
|
1137
|
-
function
|
|
1138
|
-
if (!
|
|
1139
|
-
const e =
|
|
1140
|
-
return e.length >= 2 ? (e[0][0] + e[1][0]).toUpperCase() :
|
|
1225
|
+
function Oe(s) {
|
|
1226
|
+
if (!s) return "";
|
|
1227
|
+
const e = s.trim().split(/\s+/);
|
|
1228
|
+
return e.length >= 2 ? (e[0][0] + e[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1141
1229
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const
|
|
1144
|
-
return /* @__PURE__ */
|
|
1230
|
+
function mt({ seed: s, icon: e, src: r, size: l = 32, className: n = "", style: a = {}, ...i }) {
|
|
1231
|
+
const d = Pe(s ?? ""), [p, u] = S(!1), f = e ?? /* @__PURE__ */ t.jsx("span", { className: "ds-avatar__initials", children: Oe(s) });
|
|
1232
|
+
return /* @__PURE__ */ t.jsx(
|
|
1145
1233
|
"div",
|
|
1146
1234
|
{
|
|
1147
1235
|
className: ["ds-avatar", n].filter(Boolean).join(" "),
|
|
1148
|
-
style: { width: l, height: l, "--ds-avatar-h":
|
|
1236
|
+
style: { width: l, height: l, "--ds-avatar-h": d, ...a },
|
|
1149
1237
|
"aria-hidden": "true",
|
|
1150
|
-
...
|
|
1151
|
-
children: r && !p ? /* @__PURE__ */
|
|
1238
|
+
...i,
|
|
1239
|
+
children: r && !p ? /* @__PURE__ */ t.jsx("img", { src: r, alt: "", onError: () => u(!0) }) : f
|
|
1152
1240
|
}
|
|
1153
1241
|
);
|
|
1154
1242
|
}
|
|
1155
|
-
function
|
|
1156
|
-
children:
|
|
1243
|
+
function pt({
|
|
1244
|
+
children: s,
|
|
1157
1245
|
size: e = "compact",
|
|
1158
1246
|
stickyTop: r,
|
|
1159
1247
|
maxHeight: l,
|
|
1160
1248
|
className: n = "",
|
|
1161
1249
|
style: a = {},
|
|
1162
|
-
...
|
|
1250
|
+
...i
|
|
1163
1251
|
}) {
|
|
1164
|
-
const
|
|
1252
|
+
const d = {
|
|
1165
1253
|
...l ? { maxHeight: l } : {},
|
|
1166
1254
|
...r !== void 0 ? { "--ds-table-sticky-top": typeof r == "number" ? `${r}px` : r } : {},
|
|
1167
1255
|
...a
|
|
1168
1256
|
};
|
|
1169
|
-
return /* @__PURE__ */
|
|
1257
|
+
return /* @__PURE__ */ t.jsx(
|
|
1170
1258
|
"div",
|
|
1171
1259
|
{
|
|
1172
1260
|
className: ["ds-table-wrap", l ? "ds-table-wrap--scroll" : ""].filter(Boolean).join(" "),
|
|
1173
|
-
style:
|
|
1174
|
-
children: /* @__PURE__ */
|
|
1261
|
+
style: d,
|
|
1262
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1175
1263
|
"table",
|
|
1176
1264
|
{
|
|
1177
1265
|
className: ["ds-table", `ds-table--${e}`, n].filter(Boolean).join(" "),
|
|
1178
|
-
...
|
|
1179
|
-
children:
|
|
1266
|
+
...i,
|
|
1267
|
+
children: s
|
|
1180
1268
|
}
|
|
1181
1269
|
)
|
|
1182
1270
|
}
|
|
1183
1271
|
);
|
|
1184
1272
|
}
|
|
1185
|
-
function
|
|
1186
|
-
return /* @__PURE__ */
|
|
1273
|
+
function ht({ children: s, ...e }) {
|
|
1274
|
+
return /* @__PURE__ */ t.jsx("thead", { ...e, children: s });
|
|
1187
1275
|
}
|
|
1188
|
-
function
|
|
1189
|
-
return /* @__PURE__ */
|
|
1276
|
+
function bt({ children: s, ...e }) {
|
|
1277
|
+
return /* @__PURE__ */ t.jsx("tbody", { ...e, children: s });
|
|
1190
1278
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return /* @__PURE__ */
|
|
1279
|
+
function xt({ children: s, interactive: e, selected: r, subheader: l, className: n = "", onClick: a, ...i }) {
|
|
1280
|
+
return /* @__PURE__ */ t.jsx(
|
|
1193
1281
|
"tr",
|
|
1194
1282
|
{
|
|
1195
1283
|
className: [
|
|
@@ -1200,17 +1288,17 @@ function pt({ children: t, interactive: e, selected: r, subheader: l, className:
|
|
|
1200
1288
|
n
|
|
1201
1289
|
].filter(Boolean).join(" "),
|
|
1202
1290
|
onClick: a,
|
|
1203
|
-
...
|
|
1204
|
-
children:
|
|
1291
|
+
...i,
|
|
1292
|
+
children: s
|
|
1205
1293
|
}
|
|
1206
1294
|
);
|
|
1207
1295
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return /* @__PURE__ */
|
|
1296
|
+
function vt({ children: s, colSpan: e = 999, ...r }) {
|
|
1297
|
+
return /* @__PURE__ */ t.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...r, children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: s }) });
|
|
1210
1298
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const p = !!l || r !== void 0,
|
|
1213
|
-
return /* @__PURE__ */
|
|
1299
|
+
function jt({ children: s, align: e = "left", sortDir: r, onSort: l, width: n, className: a = "", style: i = {}, ...d }) {
|
|
1300
|
+
const p = !!l || r !== void 0, u = r === "asc" ? Ne : r === "desc" ? ee : ye;
|
|
1301
|
+
return /* @__PURE__ */ t.jsx(
|
|
1214
1302
|
"th",
|
|
1215
1303
|
{
|
|
1216
1304
|
className: [
|
|
@@ -1221,17 +1309,17 @@ function ht({ children: t, align: e = "left", sortDir: r, onSort: l, width: n, c
|
|
|
1221
1309
|
a
|
|
1222
1310
|
].filter(Boolean).join(" "),
|
|
1223
1311
|
onClick: l,
|
|
1224
|
-
style: { width: n, ...
|
|
1225
|
-
...
|
|
1226
|
-
children: p ? /* @__PURE__ */
|
|
1227
|
-
|
|
1228
|
-
/* @__PURE__ */
|
|
1229
|
-
] }) :
|
|
1312
|
+
style: { width: n, ...i },
|
|
1313
|
+
...d,
|
|
1314
|
+
children: p ? /* @__PURE__ */ t.jsxs("span", { className: "ds-th__inner", children: [
|
|
1315
|
+
s,
|
|
1316
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-th__sort-icon", children: /* @__PURE__ */ t.jsx(u, { size: 11, strokeWidth: 2.5 }) })
|
|
1317
|
+
] }) : s
|
|
1230
1318
|
}
|
|
1231
1319
|
);
|
|
1232
1320
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return /* @__PURE__ */
|
|
1321
|
+
function _t({ children: s, align: e = "left", secondary: r, muted: l, truncate: n, nowrap: a, className: i = "", ...d }) {
|
|
1322
|
+
return /* @__PURE__ */ t.jsx(
|
|
1235
1323
|
"td",
|
|
1236
1324
|
{
|
|
1237
1325
|
className: [
|
|
@@ -1241,148 +1329,159 @@ function xt({ children: t, align: e = "left", secondary: r, muted: l, truncate:
|
|
|
1241
1329
|
l ? "ds-table-cell--muted" : "",
|
|
1242
1330
|
n ? "ds-table-cell--truncate" : "",
|
|
1243
1331
|
a ? "ds-table-cell--nowrap" : "",
|
|
1244
|
-
|
|
1332
|
+
i
|
|
1245
1333
|
].filter(Boolean).join(" "),
|
|
1246
|
-
...
|
|
1247
|
-
children:
|
|
1334
|
+
...d,
|
|
1335
|
+
children: s
|
|
1248
1336
|
}
|
|
1249
1337
|
);
|
|
1250
1338
|
}
|
|
1251
|
-
function
|
|
1252
|
-
icon:
|
|
1339
|
+
function wt({
|
|
1340
|
+
icon: s,
|
|
1253
1341
|
title: e,
|
|
1254
1342
|
description: r,
|
|
1255
1343
|
action: l,
|
|
1256
1344
|
size: n = "m",
|
|
1257
1345
|
className: a = "",
|
|
1258
|
-
...
|
|
1346
|
+
...i
|
|
1259
1347
|
}) {
|
|
1260
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1261
1349
|
"div",
|
|
1262
1350
|
{
|
|
1263
1351
|
className: ["ds-empty-state", `ds-empty-state--${n}`, a].filter(Boolean).join(" "),
|
|
1264
|
-
...
|
|
1352
|
+
...i,
|
|
1265
1353
|
children: [
|
|
1266
|
-
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
r && /* @__PURE__ */
|
|
1269
|
-
l && /* @__PURE__ */
|
|
1354
|
+
s && /* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1355
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__title", children: e }),
|
|
1356
|
+
r && /* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__description", children: r }),
|
|
1357
|
+
l && /* @__PURE__ */ t.jsx("div", { className: "ds-empty-state__action", children: l })
|
|
1270
1358
|
]
|
|
1271
1359
|
}
|
|
1272
1360
|
);
|
|
1273
1361
|
}
|
|
1274
|
-
function
|
|
1275
|
-
trigger:
|
|
1362
|
+
function Nt({
|
|
1363
|
+
trigger: s,
|
|
1276
1364
|
items: e = [],
|
|
1277
1365
|
open: r,
|
|
1278
1366
|
onOpenChange: l,
|
|
1279
1367
|
align: n = "left",
|
|
1280
1368
|
className: a = "",
|
|
1281
|
-
style:
|
|
1282
|
-
...
|
|
1369
|
+
style: i,
|
|
1370
|
+
...d
|
|
1283
1371
|
}) {
|
|
1284
|
-
const [p, f] =
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1372
|
+
const [p, u] = S(!1), [f, m] = S(!1), h = r !== void 0, c = h ? r : p, v = A(null), j = A(null), [y, E] = S({}), $ = A(null), w = 150, g = () => {
|
|
1373
|
+
if (h)
|
|
1374
|
+
l == null || l(!1);
|
|
1375
|
+
else {
|
|
1376
|
+
if (f) return;
|
|
1377
|
+
m(!0), $.current = setTimeout(() => {
|
|
1378
|
+
u(!1), m(!1);
|
|
1379
|
+
}, w);
|
|
1380
|
+
}
|
|
1381
|
+
}, W = () => {
|
|
1382
|
+
const x = !c;
|
|
1383
|
+
h ? l == null || l(x) : x ? (clearTimeout($.current), m(!1), u(!0)) : g();
|
|
1289
1384
|
};
|
|
1290
|
-
|
|
1291
|
-
if (!
|
|
1292
|
-
const
|
|
1293
|
-
var
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1296
|
-
n === "right" ? { top:
|
|
1385
|
+
L(() => () => clearTimeout($.current), []), L(() => {
|
|
1386
|
+
if (!c) return;
|
|
1387
|
+
const x = () => {
|
|
1388
|
+
var I;
|
|
1389
|
+
const T = (I = v.current) == null ? void 0 : I.getBoundingClientRect();
|
|
1390
|
+
T && E(
|
|
1391
|
+
n === "right" ? { top: T.bottom + 4, right: window.innerWidth - T.right } : { top: T.bottom + 4, left: T.left }
|
|
1297
1392
|
);
|
|
1298
1393
|
};
|
|
1299
|
-
return
|
|
1300
|
-
window.removeEventListener("scroll",
|
|
1394
|
+
return x(), window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), () => {
|
|
1395
|
+
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
|
|
1301
1396
|
};
|
|
1302
|
-
}, [
|
|
1303
|
-
if (!
|
|
1304
|
-
const
|
|
1305
|
-
var
|
|
1306
|
-
!((
|
|
1307
|
-
},
|
|
1308
|
-
|
|
1397
|
+
}, [c, n]), L(() => {
|
|
1398
|
+
if (!c) return;
|
|
1399
|
+
const x = (I) => {
|
|
1400
|
+
var C, O;
|
|
1401
|
+
!((C = v.current) != null && C.contains(I.target)) && !((O = j.current) != null && O.contains(I.target)) && g();
|
|
1402
|
+
}, T = (I) => {
|
|
1403
|
+
I.key === "Escape" && g();
|
|
1309
1404
|
};
|
|
1310
|
-
return document.addEventListener("mousedown",
|
|
1311
|
-
document.removeEventListener("mousedown",
|
|
1405
|
+
return document.addEventListener("mousedown", x), document.addEventListener("keydown", T), () => {
|
|
1406
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", T);
|
|
1312
1407
|
};
|
|
1313
|
-
}, [
|
|
1314
|
-
const
|
|
1408
|
+
}, [c]);
|
|
1409
|
+
const z = c && /* @__PURE__ */ t.jsx(
|
|
1315
1410
|
"div",
|
|
1316
1411
|
{
|
|
1317
|
-
ref:
|
|
1318
|
-
className: [
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1412
|
+
ref: j,
|
|
1413
|
+
className: [
|
|
1414
|
+
"ds-dropdown__menu",
|
|
1415
|
+
`ds-dropdown__menu--${n}`,
|
|
1416
|
+
f && "ds-dropdown__menu--closing"
|
|
1417
|
+
].filter(Boolean).join(" "),
|
|
1418
|
+
style: y,
|
|
1419
|
+
children: e.map((x, T) => {
|
|
1420
|
+
if (x.separator)
|
|
1421
|
+
return /* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__separator" }, T);
|
|
1422
|
+
if (x.type === "section")
|
|
1423
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
1424
|
+
x.label && /* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__section-label", children: x.label }),
|
|
1425
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__section-content", children: x.content })
|
|
1426
|
+
] }, T);
|
|
1427
|
+
const I = !!x.href, C = I ? "a" : "button", O = I ? { href: x.disabled ? void 0 : x.href, "aria-disabled": x.disabled ? "true" : void 0 } : { type: "button", disabled: x.disabled };
|
|
1428
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1429
|
+
C,
|
|
1331
1430
|
{
|
|
1332
1431
|
className: [
|
|
1333
1432
|
"ds-dropdown__item",
|
|
1334
|
-
|
|
1433
|
+
x.danger && "ds-dropdown__item--danger"
|
|
1335
1434
|
].filter(Boolean).join(" "),
|
|
1336
|
-
...
|
|
1435
|
+
...O,
|
|
1337
1436
|
onClick: () => {
|
|
1338
|
-
var
|
|
1339
|
-
(
|
|
1437
|
+
var D;
|
|
1438
|
+
(D = x.onClick) == null || D.call(x), g();
|
|
1340
1439
|
},
|
|
1341
1440
|
children: [
|
|
1342
|
-
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
|
|
1441
|
+
x.icon && /* @__PURE__ */ t.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
1442
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-dropdown__item-label", children: x.label }),
|
|
1443
|
+
x.shortcut && /* @__PURE__ */ t.jsx("span", { className: "ds-dropdown__item-shortcut", children: x.shortcut })
|
|
1345
1444
|
]
|
|
1346
1445
|
},
|
|
1347
|
-
|
|
1446
|
+
T
|
|
1348
1447
|
);
|
|
1349
1448
|
})
|
|
1350
1449
|
}
|
|
1351
1450
|
);
|
|
1352
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1353
1452
|
"div",
|
|
1354
1453
|
{
|
|
1355
|
-
ref:
|
|
1454
|
+
ref: v,
|
|
1356
1455
|
className: ["ds-dropdown", a].filter(Boolean).join(" "),
|
|
1357
|
-
style:
|
|
1358
|
-
...
|
|
1456
|
+
style: i,
|
|
1457
|
+
...d,
|
|
1359
1458
|
children: [
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
typeof document < "u" &&
|
|
1459
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-dropdown__trigger", onClick: W, children: s }),
|
|
1460
|
+
typeof document < "u" && Q.createPortal(z, document.body)
|
|
1362
1461
|
]
|
|
1363
1462
|
}
|
|
1364
1463
|
);
|
|
1365
1464
|
}
|
|
1366
1465
|
const ue = {
|
|
1367
|
-
default:
|
|
1466
|
+
default: he,
|
|
1368
1467
|
success: pe,
|
|
1369
1468
|
warning: me,
|
|
1370
1469
|
error: fe
|
|
1371
1470
|
};
|
|
1372
|
-
let
|
|
1373
|
-
const
|
|
1374
|
-
function
|
|
1375
|
-
|
|
1471
|
+
let U = [];
|
|
1472
|
+
const oe = /* @__PURE__ */ new Set();
|
|
1473
|
+
function be() {
|
|
1474
|
+
oe.forEach((s) => s([...U]));
|
|
1376
1475
|
}
|
|
1377
|
-
function
|
|
1378
|
-
|
|
1476
|
+
function Be(s) {
|
|
1477
|
+
U = [...U, s], be();
|
|
1379
1478
|
}
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1479
|
+
function Le(s) {
|
|
1480
|
+
U = U.filter((e) => e.id !== s), be();
|
|
1382
1481
|
}
|
|
1383
|
-
function
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1482
|
+
function yt() {
|
|
1483
|
+
const s = (e, r = {}) => {
|
|
1484
|
+
Be({
|
|
1386
1485
|
id: `${Date.now()}-${Math.random()}`,
|
|
1387
1486
|
message: e,
|
|
1388
1487
|
type: "default",
|
|
@@ -1390,89 +1489,90 @@ function _t() {
|
|
|
1390
1489
|
...r
|
|
1391
1490
|
});
|
|
1392
1491
|
};
|
|
1393
|
-
return
|
|
1492
|
+
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 };
|
|
1394
1493
|
}
|
|
1395
|
-
function
|
|
1396
|
-
const [r, l] =
|
|
1397
|
-
|
|
1494
|
+
function De({ data: s, onDismiss: e }) {
|
|
1495
|
+
const [r, l] = S(!1), n = A(null);
|
|
1496
|
+
L(() => (requestAnimationFrame(() => l(!0)), s.duration > 0 && (n.current = setTimeout(() => a(), s.duration)), () => clearTimeout(n.current)), []);
|
|
1398
1497
|
function a() {
|
|
1399
|
-
l(!1), setTimeout(() => e(
|
|
1498
|
+
l(!1), setTimeout(() => e(s.id), 250);
|
|
1400
1499
|
}
|
|
1401
|
-
const
|
|
1402
|
-
return /* @__PURE__ */
|
|
1500
|
+
const i = ue[s.type] ?? ue.default;
|
|
1501
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1403
1502
|
"div",
|
|
1404
1503
|
{
|
|
1405
1504
|
className: [
|
|
1406
1505
|
"ds-toast",
|
|
1407
|
-
`ds-toast--${
|
|
1506
|
+
`ds-toast--${s.type}`,
|
|
1408
1507
|
r && "ds-toast--visible"
|
|
1409
1508
|
].filter(Boolean).join(" "),
|
|
1410
|
-
role:
|
|
1509
|
+
role: s.type === "error" ? "alert" : "status",
|
|
1411
1510
|
"aria-live": "polite",
|
|
1412
1511
|
children: [
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ t.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ t.jsx(i, { size: P[3], strokeWidth: 1.5 }) }),
|
|
1513
|
+
/* @__PURE__ */ t.jsx("span", { className: "ds-toast__message", children: s.message }),
|
|
1514
|
+
/* @__PURE__ */ t.jsx(
|
|
1416
1515
|
"button",
|
|
1417
1516
|
{
|
|
1418
1517
|
className: "ds-toast__close",
|
|
1419
1518
|
onClick: a,
|
|
1420
1519
|
"aria-label": "Закрыть",
|
|
1421
|
-
children: /* @__PURE__ */
|
|
1520
|
+
children: /* @__PURE__ */ t.jsx(le, { size: P[3], strokeWidth: 1.5 })
|
|
1422
1521
|
}
|
|
1423
1522
|
)
|
|
1424
1523
|
]
|
|
1425
1524
|
}
|
|
1426
1525
|
);
|
|
1427
1526
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const [e, r] =
|
|
1430
|
-
return
|
|
1431
|
-
/* @__PURE__ */
|
|
1527
|
+
function Et({ position: s = "bottom-right" }) {
|
|
1528
|
+
const [e, r] = S(() => [...U]);
|
|
1529
|
+
return L(() => (oe.add(r), () => oe.delete(r)), []), !e.length || typeof document > "u" ? null : Q.createPortal(
|
|
1530
|
+
/* @__PURE__ */ t.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: e.map((l) => /* @__PURE__ */ t.jsx(De, { data: l, onDismiss: Le }, l.id)) }),
|
|
1432
1531
|
document.body
|
|
1433
1532
|
);
|
|
1434
1533
|
}
|
|
1435
1534
|
export {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1535
|
+
lt as Accordion,
|
|
1536
|
+
et as Alert,
|
|
1537
|
+
mt as Avatar,
|
|
1538
|
+
Qe as Badge,
|
|
1539
|
+
$e as Button,
|
|
1540
|
+
Ue as Card,
|
|
1541
|
+
dt as Checkbox,
|
|
1542
|
+
st as Code,
|
|
1543
|
+
Se as CodeAccordion,
|
|
1544
|
+
Nt as Dropdown,
|
|
1545
|
+
wt as EmptyState,
|
|
1546
|
+
qe as H1,
|
|
1547
|
+
He as H2,
|
|
1548
|
+
Ge as H3,
|
|
1549
|
+
Xe as H4,
|
|
1550
|
+
We as Input,
|
|
1551
|
+
rt as Link,
|
|
1552
|
+
tt as Modal,
|
|
1454
1553
|
de as ModalFooter,
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1554
|
+
Je as P1,
|
|
1555
|
+
Ke as P2,
|
|
1556
|
+
Ze as P3,
|
|
1557
|
+
ut as Radio,
|
|
1558
|
+
ot as SegmentedControl,
|
|
1559
|
+
Ve as Select,
|
|
1560
|
+
ft as Skeleton,
|
|
1561
|
+
ke as Spinner,
|
|
1462
1562
|
Ye as Stepper,
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1563
|
+
at as Tab,
|
|
1564
|
+
pt as Table,
|
|
1565
|
+
bt as TableBody,
|
|
1566
|
+
ht as TableHead,
|
|
1567
|
+
xt as TableRow,
|
|
1568
|
+
vt as TableSubheaderRow,
|
|
1569
|
+
nt as Tabs,
|
|
1570
|
+
_t as Td,
|
|
1571
|
+
ze as Textarea,
|
|
1572
|
+
jt as Th,
|
|
1573
|
+
Et as ToastContainer,
|
|
1574
|
+
it as Toggle,
|
|
1575
|
+
ct as Tooltip,
|
|
1576
|
+
P as iconSizes,
|
|
1577
|
+
yt as useToast
|
|
1478
1578
|
};
|