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