@donkit-ai/design-system 1.0.3 → 1.0.5
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 +219 -218
- 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 { ChevronDown as
|
|
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 ee = { exports: {} },
|
|
11
|
+
var ee = { exports: {} }, G = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -20,7 +20,7 @@ var ee = { exports: {} }, H = {};
|
|
|
20
20
|
*/
|
|
21
21
|
var le;
|
|
22
22
|
function ye() {
|
|
23
|
-
if (le) return
|
|
23
|
+
if (le) return G;
|
|
24
24
|
le = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
26
26
|
function s(c, n, a) {
|
|
@@ -38,9 +38,9 @@ function ye() {
|
|
|
38
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
|
|
@@ -59,13 +59,13 @@ function Ee() {
|
|
|
59
59
|
return o.$$typeof === D ? null : o.displayName || o.name || null;
|
|
60
60
|
if (typeof o == "string") return o;
|
|
61
61
|
switch (o) {
|
|
62
|
-
case
|
|
62
|
+
case k:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case S:
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case $:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case g:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case P:
|
|
71
71
|
return "SuspenseList";
|
|
@@ -78,19 +78,19 @@ function Ee() {
|
|
|
78
78
|
), o.$$typeof) {
|
|
79
79
|
case v:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case y:
|
|
82
|
-
return o.displayName || "Context";
|
|
83
81
|
case _:
|
|
82
|
+
return o.displayName || "Context";
|
|
83
|
+
case m:
|
|
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 R:
|
|
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 t(o(
|
|
93
|
+
return t(o(h));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -102,50 +102,50 @@ function Ee() {
|
|
|
102
102
|
function s(o) {
|
|
103
103
|
try {
|
|
104
104
|
e(o);
|
|
105
|
-
var
|
|
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
|
-
|
|
115
|
+
y
|
|
116
116
|
), e(o);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function c(o) {
|
|
120
|
-
if (o ===
|
|
121
|
-
if (typeof o == "object" && o !== null && o.$$typeof ===
|
|
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 o =
|
|
131
|
+
var o = F.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
137
|
function l(o) {
|
|
138
|
-
if (
|
|
139
|
-
var
|
|
140
|
-
if (
|
|
138
|
+
if (X.call(o, "key")) {
|
|
139
|
+
var h = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
140
|
+
if (h && h.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return o.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function i(o,
|
|
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
151
|
N.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
@@ -159,15 +159,15 @@ function Ee() {
|
|
|
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(o,
|
|
163
|
-
var
|
|
162
|
+
function f(o, h, N, y, J, Z) {
|
|
163
|
+
var E = N.ref;
|
|
164
164
|
return o = {
|
|
165
165
|
$$typeof: j,
|
|
166
166
|
type: o,
|
|
167
|
-
key:
|
|
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
172
|
get: p
|
|
173
173
|
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
@@ -184,7 +184,7 @@ function Ee() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: J
|
|
188
188
|
}), Object.defineProperty(o, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
@@ -192,94 +192,94 @@ function Ee() {
|
|
|
192
192
|
value: Z
|
|
193
193
|
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
194
194
|
}
|
|
195
|
-
function d(o,
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if (
|
|
199
|
-
if (re(
|
|
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
|
|
207
|
+
else u(E);
|
|
208
|
+
if (X.call(h, "key")) {
|
|
209
|
+
E = t(o);
|
|
210
|
+
var Y = Object.keys(h).filter(function(xe) {
|
|
211
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
|
-
), ce[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 Q in
|
|
229
|
-
Q !== "key" && (N[Q] =
|
|
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
233
|
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
234
234
|
), f(
|
|
235
235
|
o,
|
|
236
|
-
|
|
236
|
+
E,
|
|
237
237
|
N,
|
|
238
238
|
n(),
|
|
239
|
-
|
|
239
|
+
J,
|
|
240
240
|
Z
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function u(o) {
|
|
244
|
-
|
|
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
|
|
246
|
+
function x(o) {
|
|
247
247
|
return typeof o == "object" && o !== null && o.$$typeof === j;
|
|
248
248
|
}
|
|
249
|
-
var
|
|
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
253
|
react_stack_bottom_frame: function(o) {
|
|
254
254
|
return o();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
258
|
-
|
|
257
|
+
var H, ne = {}, ae = b.react_stack_bottom_frame.bind(
|
|
258
|
+
b,
|
|
259
259
|
a
|
|
260
|
-
)(), oe =
|
|
261
|
-
|
|
262
|
-
var
|
|
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
264
|
o,
|
|
265
|
-
|
|
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
274
|
o,
|
|
275
|
-
|
|
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
284
|
process.env.NODE_ENV === "production" ? ee.exports = ye() : ee.exports = Ee();
|
|
285
285
|
var r = ee.exports;
|
|
@@ -296,13 +296,13 @@ function ke({
|
|
|
296
296
|
"aria-label": f,
|
|
297
297
|
...d
|
|
298
298
|
}) {
|
|
299
|
-
const u = n && !t,
|
|
299
|
+
const u = n && !t, x = [
|
|
300
300
|
"ds-button",
|
|
301
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(" "),
|
|
305
|
+
].filter(Boolean).join(" "), b = /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
306
306
|
n && !u && /* @__PURE__ */ r.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n }),
|
|
307
307
|
t,
|
|
308
308
|
u && /* @__PURE__ */ r.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: n })
|
|
@@ -318,13 +318,13 @@ function ke({
|
|
|
318
318
|
return /* @__PURE__ */ r.jsx(
|
|
319
319
|
"a",
|
|
320
320
|
{
|
|
321
|
-
className:
|
|
321
|
+
className: x,
|
|
322
322
|
href: a ? void 0 : p,
|
|
323
323
|
onClick: j,
|
|
324
324
|
"aria-label": f,
|
|
325
325
|
"aria-disabled": a ? "true" : void 0,
|
|
326
326
|
...d,
|
|
327
|
-
children:
|
|
327
|
+
children: b
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
330
|
}
|
|
@@ -332,12 +332,12 @@ function ke({
|
|
|
332
332
|
"button",
|
|
333
333
|
{
|
|
334
334
|
type: i,
|
|
335
|
-
className:
|
|
335
|
+
className: x,
|
|
336
336
|
disabled: a,
|
|
337
337
|
onClick: l,
|
|
338
338
|
"aria-label": f,
|
|
339
339
|
...d,
|
|
340
|
-
children:
|
|
340
|
+
children: b
|
|
341
341
|
}
|
|
342
342
|
);
|
|
343
343
|
}
|
|
@@ -354,7 +354,7 @@ function De({
|
|
|
354
354
|
id: f,
|
|
355
355
|
...d
|
|
356
356
|
}) {
|
|
357
|
-
const u = f || `input-${
|
|
357
|
+
const u = f || `input-${A.useId()}`, x = s ? `${u}-hint` : void 0, b = e ? `${u}-error` : void 0, j = b || x;
|
|
358
358
|
return /* @__PURE__ */ r.jsxs("div", { className: `ds-input-wrapper ${c ? "ds-input-wrapper--full" : ""} ${p ? "ds-input-wrapper--disabled" : ""}`, children: [
|
|
359
359
|
t && /* @__PURE__ */ r.jsx("label", { className: "ds-input-label", htmlFor: u, children: t }),
|
|
360
360
|
/* @__PURE__ */ r.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -382,8 +382,8 @@ function De({
|
|
|
382
382
|
}
|
|
383
383
|
)
|
|
384
384
|
] }),
|
|
385
|
-
s && !e && /* @__PURE__ */ r.jsx("span", { id:
|
|
386
|
-
e && /* @__PURE__ */ r.jsx("span", { id:
|
|
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
389
|
function Me({
|
|
@@ -398,7 +398,7 @@ function Me({
|
|
|
398
398
|
rows: p = 3,
|
|
399
399
|
...f
|
|
400
400
|
}) {
|
|
401
|
-
const d = l || `textarea-${
|
|
401
|
+
const d = l || `textarea-${A.useId()}`, u = s ? `${d}-hint` : void 0, x = e ? `${d}-error` : void 0, b = x || u;
|
|
402
402
|
return /* @__PURE__ */ r.jsxs("div", { className: `ds-textarea-wrapper ${c ? "ds-textarea-wrapper--full" : ""} ${a ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
403
403
|
t && /* @__PURE__ */ r.jsx("label", { className: "ds-textarea-label", htmlFor: d, children: t }),
|
|
404
404
|
/* @__PURE__ */ r.jsx(
|
|
@@ -408,13 +408,13 @@ function Me({
|
|
|
408
408
|
className: `ds-textarea ds-textarea--${n} ${e ? "ds-textarea--error" : ""} ${i ? "" : "ds-textarea--no-resize"}`,
|
|
409
409
|
disabled: a,
|
|
410
410
|
"aria-invalid": e ? "true" : "false",
|
|
411
|
-
"aria-describedby":
|
|
411
|
+
"aria-describedby": b,
|
|
412
412
|
rows: p,
|
|
413
413
|
...f
|
|
414
414
|
}
|
|
415
415
|
),
|
|
416
416
|
s && !e && /* @__PURE__ */ r.jsx("span", { id: u, className: "ds-textarea-hint", children: s }),
|
|
417
|
-
e && /* @__PURE__ */ r.jsx("span", { id:
|
|
417
|
+
e && /* @__PURE__ */ r.jsx("span", { id: x, className: "ds-textarea-error", role: "alert", children: e })
|
|
418
418
|
] });
|
|
419
419
|
}
|
|
420
420
|
function Fe({
|
|
@@ -430,34 +430,34 @@ function Fe({
|
|
|
430
430
|
id: f,
|
|
431
431
|
...d
|
|
432
432
|
}) {
|
|
433
|
-
const [u,
|
|
434
|
-
var
|
|
435
|
-
const w = (
|
|
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
436
|
if (!w) return;
|
|
437
|
-
const D = window.innerHeight,
|
|
438
|
-
|
|
439
|
-
|
|
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
440
|
);
|
|
441
441
|
};
|
|
442
|
-
|
|
442
|
+
B(() => {
|
|
443
443
|
if (u)
|
|
444
|
-
return
|
|
445
|
-
window.removeEventListener("scroll",
|
|
444
|
+
return g(), window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
|
|
445
|
+
window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
|
|
446
446
|
};
|
|
447
|
-
}, [u]),
|
|
447
|
+
}, [u]), B(() => {
|
|
448
448
|
const w = (D) => {
|
|
449
|
-
$.current && !$.current.contains(D.target) &&
|
|
449
|
+
$.current && !$.current.contains(D.target) && S.current && !S.current.contains(D.target) && x(!1);
|
|
450
450
|
};
|
|
451
451
|
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
452
452
|
}, []);
|
|
453
|
-
const P = c.find((w) => w.value === e),
|
|
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
454
|
"div",
|
|
455
455
|
{
|
|
456
|
-
ref:
|
|
456
|
+
ref: S,
|
|
457
457
|
role: "listbox",
|
|
458
|
-
"aria-labelledby": t ?
|
|
458
|
+
"aria-labelledby": t ? _ : void 0,
|
|
459
459
|
className: `ds-select-dropdown ds-select-dropdown--${i} ds-select-dropdown--${v}`,
|
|
460
|
-
style:
|
|
460
|
+
style: b,
|
|
461
461
|
children: c.map((w) => /* @__PURE__ */ r.jsx(
|
|
462
462
|
"button",
|
|
463
463
|
{
|
|
@@ -466,7 +466,7 @@ function Fe({
|
|
|
466
466
|
"aria-selected": e === w.value,
|
|
467
467
|
className: `ds-select-option ds-select-option--${i} ${e === w.value ? "ds-select-option--selected" : ""}`,
|
|
468
468
|
onClick: () => {
|
|
469
|
-
s == null || s(w.value),
|
|
469
|
+
s == null || s(w.value), x(!1);
|
|
470
470
|
},
|
|
471
471
|
children: w.label
|
|
472
472
|
},
|
|
@@ -475,28 +475,28 @@ function Fe({
|
|
|
475
475
|
}
|
|
476
476
|
);
|
|
477
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:
|
|
478
|
+
t && /* @__PURE__ */ r.jsx("label", { id: _, className: "ds-select-label", children: t }),
|
|
479
479
|
/* @__PURE__ */ r.jsx("div", { className: "ds-select-container", ref: $, children: /* @__PURE__ */ r.jsxs(
|
|
480
480
|
"button",
|
|
481
481
|
{
|
|
482
482
|
type: "button",
|
|
483
|
-
id:
|
|
483
|
+
id: m,
|
|
484
484
|
role: "combobox",
|
|
485
485
|
"aria-haspopup": "listbox",
|
|
486
486
|
"aria-expanded": u,
|
|
487
|
-
"aria-labelledby": t ?
|
|
487
|
+
"aria-labelledby": t ? _ : void 0,
|
|
488
488
|
"aria-invalid": a ? "true" : "false",
|
|
489
|
-
"aria-describedby":
|
|
489
|
+
"aria-describedby": R,
|
|
490
490
|
className: `ds-select-trigger ds-select-trigger--${i} ${a ? "ds-select-trigger--error" : ""}`,
|
|
491
|
-
onClick: () => !p &&
|
|
491
|
+
onClick: () => !p && x(!u),
|
|
492
492
|
disabled: p,
|
|
493
493
|
...d,
|
|
494
494
|
children: [
|
|
495
495
|
/* @__PURE__ */ r.jsx("span", { className: P ? "" : "ds-select-placeholder", children: (P == null ? void 0 : P.label) || n }),
|
|
496
496
|
/* @__PURE__ */ r.jsx(
|
|
497
|
-
|
|
497
|
+
K,
|
|
498
498
|
{
|
|
499
|
-
size:
|
|
499
|
+
size: M,
|
|
500
500
|
strokeWidth: 1.5,
|
|
501
501
|
className: `ds-select-icon ${u && v === "down" ? "ds-select-icon--open" : ""} ${u && v === "up" ? "ds-select-icon--up" : ""}`,
|
|
502
502
|
"aria-hidden": "true"
|
|
@@ -505,8 +505,8 @@ function Fe({
|
|
|
505
505
|
]
|
|
506
506
|
}
|
|
507
507
|
) }),
|
|
508
|
-
a && /* @__PURE__ */ r.jsx("span", { id:
|
|
509
|
-
typeof document < "u" &&
|
|
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)
|
|
510
510
|
] });
|
|
511
511
|
}
|
|
512
512
|
function We({
|
|
@@ -526,21 +526,21 @@ function We({
|
|
|
526
526
|
if (i) return;
|
|
527
527
|
const $ = Math.min(Number(e) + a, n);
|
|
528
528
|
s == null || s($);
|
|
529
|
-
},
|
|
529
|
+
}, x = () => {
|
|
530
530
|
if (i) return;
|
|
531
531
|
const $ = Math.max(Number(e) - a, c);
|
|
532
532
|
s == null || s($);
|
|
533
|
-
},
|
|
533
|
+
}, b = ($) => {
|
|
534
534
|
if (i) return;
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
535
|
+
const S = $.target.value;
|
|
536
|
+
if (S === "") {
|
|
537
537
|
s == null || s(c);
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
|
-
const
|
|
541
|
-
if (!isNaN(
|
|
542
|
-
const
|
|
543
|
-
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(_);
|
|
544
544
|
}
|
|
545
545
|
}, j = [
|
|
546
546
|
"ds-stepper-wrapper",
|
|
@@ -550,7 +550,7 @@ function We({
|
|
|
550
550
|
"ds-stepper",
|
|
551
551
|
`ds-stepper--${l}`,
|
|
552
552
|
i && "ds-stepper--disabled"
|
|
553
|
-
].filter(Boolean).join(" "),
|
|
553
|
+
].filter(Boolean).join(" "), k = l === "xs" ? T[1] : l === "small" ? T[2] : T[3];
|
|
554
554
|
return /* @__PURE__ */ r.jsxs("div", { className: j, children: [
|
|
555
555
|
t && /* @__PURE__ */ r.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
556
556
|
/* @__PURE__ */ r.jsxs("div", { className: v, children: [
|
|
@@ -559,10 +559,10 @@ function We({
|
|
|
559
559
|
{
|
|
560
560
|
type: "button",
|
|
561
561
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
562
|
-
onClick:
|
|
562
|
+
onClick: x,
|
|
563
563
|
disabled: i || e <= c,
|
|
564
564
|
"aria-label": "Decrease",
|
|
565
|
-
children: /* @__PURE__ */ r.jsx(ve, { size:
|
|
565
|
+
children: /* @__PURE__ */ r.jsx(ve, { size: k, strokeWidth: 1.5 })
|
|
566
566
|
}
|
|
567
567
|
),
|
|
568
568
|
/* @__PURE__ */ r.jsx(
|
|
@@ -571,7 +571,7 @@ function We({
|
|
|
571
571
|
type: "number",
|
|
572
572
|
className: "ds-stepper-input",
|
|
573
573
|
value: e,
|
|
574
|
-
onChange:
|
|
574
|
+
onChange: b,
|
|
575
575
|
min: c,
|
|
576
576
|
max: n,
|
|
577
577
|
step: a,
|
|
@@ -587,7 +587,7 @@ function We({
|
|
|
587
587
|
onClick: u,
|
|
588
588
|
disabled: i || e >= n,
|
|
589
589
|
"aria-label": "Increase",
|
|
590
|
-
children: /* @__PURE__ */ r.jsx(je, { size:
|
|
590
|
+
children: /* @__PURE__ */ r.jsx(je, { size: k, strokeWidth: 1.5 })
|
|
591
591
|
}
|
|
592
592
|
)
|
|
593
593
|
] }),
|
|
@@ -612,7 +612,7 @@ function Ye({
|
|
|
612
612
|
f && "ds-card--interactive"
|
|
613
613
|
].filter(Boolean).join(" ");
|
|
614
614
|
if (a) {
|
|
615
|
-
const
|
|
615
|
+
const b = (j) => {
|
|
616
616
|
if (l) {
|
|
617
617
|
j.preventDefault();
|
|
618
618
|
return;
|
|
@@ -624,14 +624,14 @@ function Ye({
|
|
|
624
624
|
{
|
|
625
625
|
className: d,
|
|
626
626
|
href: l ? void 0 : a,
|
|
627
|
-
onClick:
|
|
627
|
+
onClick: b,
|
|
628
628
|
"aria-disabled": l ? "true" : void 0,
|
|
629
629
|
...i,
|
|
630
630
|
children: t
|
|
631
631
|
}
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
|
-
const u = f && n ? "button" : "div",
|
|
634
|
+
const u = f && n ? "button" : "div", x = f && n ? {
|
|
635
635
|
type: "button",
|
|
636
636
|
onClick: n,
|
|
637
637
|
disabled: l
|
|
@@ -641,7 +641,7 @@ function Ye({
|
|
|
641
641
|
{
|
|
642
642
|
className: d,
|
|
643
643
|
role: f && !n ? "article" : void 0,
|
|
644
|
-
...
|
|
644
|
+
...x,
|
|
645
645
|
...i,
|
|
646
646
|
children: t
|
|
647
647
|
}
|
|
@@ -722,18 +722,18 @@ function Ke({
|
|
|
722
722
|
size: c = "m",
|
|
723
723
|
...n
|
|
724
724
|
}) {
|
|
725
|
-
const a =
|
|
726
|
-
|
|
727
|
-
const d = (
|
|
728
|
-
|
|
729
|
-
}, u = (
|
|
730
|
-
a.current && !a.current.contains(
|
|
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());
|
|
731
731
|
};
|
|
732
732
|
return document.addEventListener("keydown", d), document.addEventListener("mousedown", u), () => {
|
|
733
733
|
document.removeEventListener("keydown", d), document.removeEventListener("mousedown", u);
|
|
734
734
|
};
|
|
735
735
|
}, [s]);
|
|
736
|
-
const i =
|
|
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
737
|
return /* @__PURE__ */ r.jsx("div", { className: "ds-modal-overlay", ...n, children: /* @__PURE__ */ r.jsxs(
|
|
738
738
|
"div",
|
|
739
739
|
{
|
|
@@ -775,25 +775,25 @@ function Re({
|
|
|
775
775
|
className: l = "",
|
|
776
776
|
...i
|
|
777
777
|
}) {
|
|
778
|
-
const [p, f] =
|
|
778
|
+
const [p, f] = I(s), d = c !== void 0, u = d ? c : p, x = () => {
|
|
779
779
|
d ? n == null || n(!c) : f((j) => !j);
|
|
780
|
-
},
|
|
780
|
+
}, b = [
|
|
781
781
|
"ds-code-accordion",
|
|
782
782
|
`ds-code-accordion--${a}`,
|
|
783
783
|
l
|
|
784
784
|
].filter(Boolean).join(" ");
|
|
785
|
-
return /* @__PURE__ */ r.jsxs("div", { className:
|
|
785
|
+
return /* @__PURE__ */ r.jsxs("div", { className: b, ...i, children: [
|
|
786
786
|
/* @__PURE__ */ r.jsxs(
|
|
787
787
|
"button",
|
|
788
788
|
{
|
|
789
789
|
type: "button",
|
|
790
790
|
className: "ds-code-accordion__header",
|
|
791
|
-
onClick:
|
|
791
|
+
onClick: x,
|
|
792
792
|
"aria-expanded": u,
|
|
793
793
|
children: [
|
|
794
794
|
/* @__PURE__ */ r.jsx("span", { className: "ds-code-accordion__title", children: e }),
|
|
795
795
|
/* @__PURE__ */ r.jsx(
|
|
796
|
-
|
|
796
|
+
K,
|
|
797
797
|
{
|
|
798
798
|
size: T[2],
|
|
799
799
|
strokeWidth: 1.5,
|
|
@@ -825,7 +825,7 @@ function Qe({ href: t, children: e, onClick: s, target: c, rel: n, ...a }) {
|
|
|
825
825
|
);
|
|
826
826
|
}
|
|
827
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:
|
|
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) });
|
|
829
829
|
}
|
|
830
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
831
|
const f = l && !t, d = [
|
|
@@ -839,12 +839,12 @@ function tt({ children: t, selected: e = !1, onClick: s, size: c = "m", variant:
|
|
|
839
839
|
t
|
|
840
840
|
] });
|
|
841
841
|
if (i) {
|
|
842
|
-
const
|
|
842
|
+
const x = (b) => {
|
|
843
843
|
if (a) {
|
|
844
|
-
|
|
844
|
+
b.preventDefault();
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
|
-
|
|
847
|
+
b.metaKey || b.ctrlKey || b.button === 1 || (b.preventDefault(), s == null || s(b));
|
|
848
848
|
};
|
|
849
849
|
return /* @__PURE__ */ r.jsx(
|
|
850
850
|
"a",
|
|
@@ -854,7 +854,7 @@ function tt({ children: t, selected: e = !1, onClick: s, size: c = "m", variant:
|
|
|
854
854
|
"aria-disabled": a ? "true" : void 0,
|
|
855
855
|
className: d,
|
|
856
856
|
href: a ? void 0 : i,
|
|
857
|
-
onClick:
|
|
857
|
+
onClick: x,
|
|
858
858
|
...p,
|
|
859
859
|
children: u
|
|
860
860
|
}
|
|
@@ -882,13 +882,13 @@ function st({
|
|
|
882
882
|
padding: a = "m",
|
|
883
883
|
...l
|
|
884
884
|
}) {
|
|
885
|
-
const [i, p] =
|
|
886
|
-
f ? n == null || n(!c) : p((
|
|
887
|
-
},
|
|
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 = [
|
|
888
888
|
"ds-accordion",
|
|
889
889
|
`ds-accordion--${a}`
|
|
890
890
|
].filter(Boolean).join(" ");
|
|
891
|
-
return /* @__PURE__ */ r.jsxs("div", { className:
|
|
891
|
+
return /* @__PURE__ */ r.jsxs("div", { className: x, ...l, children: [
|
|
892
892
|
/* @__PURE__ */ r.jsxs(
|
|
893
893
|
"button",
|
|
894
894
|
{
|
|
@@ -899,7 +899,7 @@ function st({
|
|
|
899
899
|
children: [
|
|
900
900
|
/* @__PURE__ */ r.jsx("span", { className: "ds-accordion__title", children: e }),
|
|
901
901
|
/* @__PURE__ */ r.jsx(
|
|
902
|
-
|
|
902
|
+
K,
|
|
903
903
|
{
|
|
904
904
|
size: T[2],
|
|
905
905
|
strokeWidth: 1.5,
|
|
@@ -912,7 +912,7 @@ function st({
|
|
|
912
912
|
d && /* @__PURE__ */ r.jsx("div", { className: "ds-accordion__content", children: t })
|
|
913
913
|
] });
|
|
914
914
|
}
|
|
915
|
-
const O = 8,
|
|
915
|
+
const O = 8, z = 8;
|
|
916
916
|
function Te(t, e, s) {
|
|
917
917
|
const c = window.innerWidth;
|
|
918
918
|
let n, a;
|
|
@@ -932,41 +932,41 @@ function Te(t, e, s) {
|
|
|
932
932
|
default:
|
|
933
933
|
n = e.bottom + O, a = e.left;
|
|
934
934
|
}
|
|
935
|
-
const l = Math.max(
|
|
935
|
+
const l = Math.max(z, Math.min(c - s.width - z, a)), i = a - l;
|
|
936
936
|
return { top: n, left: l, arrowOffset: i };
|
|
937
937
|
}
|
|
938
938
|
function Se(t, e, s) {
|
|
939
939
|
const c = window.innerWidth, n = window.innerHeight;
|
|
940
|
-
if (t.top >= e + O +
|
|
941
|
-
if (n - t.bottom >= e + O +
|
|
942
|
-
if (c - t.right >= s + O +
|
|
943
|
-
if (t.left >= s + O +
|
|
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
944
|
const a = Math.max(t.top, n - t.bottom, t.left, c - t.right);
|
|
945
945
|
return a === t.top ? "top" : a === n - t.bottom ? "bottom" : a === c - t.right ? "right" : "left";
|
|
946
946
|
}
|
|
947
947
|
function rt({ children: t, content: e, position: s, ...c }) {
|
|
948
|
-
const [n, a] =
|
|
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
949
|
if (!d.current || !u.current) return;
|
|
950
|
-
const v = d.current.getBoundingClientRect(),
|
|
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
951
|
f($), i({
|
|
952
952
|
position: "fixed",
|
|
953
|
-
top:
|
|
954
|
-
left:
|
|
953
|
+
top: S,
|
|
954
|
+
left: m,
|
|
955
955
|
visibility: "visible",
|
|
956
|
-
"--arrow-offset": `${
|
|
956
|
+
"--arrow-offset": `${_}px`
|
|
957
957
|
});
|
|
958
958
|
};
|
|
959
|
-
if (
|
|
959
|
+
if (B(() => {
|
|
960
960
|
if (!n) return;
|
|
961
961
|
i({ position: "fixed", visibility: "hidden" });
|
|
962
|
-
const v = requestAnimationFrame(
|
|
963
|
-
return window.addEventListener("scroll",
|
|
964
|
-
cancelAnimationFrame(v), window.removeEventListener("scroll",
|
|
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);
|
|
965
965
|
};
|
|
966
|
-
}, [n, s]),
|
|
966
|
+
}, [n, s]), B(() => {
|
|
967
967
|
if (!n) return;
|
|
968
|
-
const v = (
|
|
969
|
-
d.current && !d.current.contains(
|
|
968
|
+
const v = (k) => {
|
|
969
|
+
d.current && !d.current.contains(k.target) && a(!1);
|
|
970
970
|
};
|
|
971
971
|
return document.addEventListener("touchstart", v), () => document.removeEventListener("touchstart", v);
|
|
972
972
|
}, [n]), !e) return t;
|
|
@@ -986,18 +986,18 @@ function rt({ children: t, content: e, position: s, ...c }) {
|
|
|
986
986
|
ref: d,
|
|
987
987
|
className: "ds-tooltip-wrapper",
|
|
988
988
|
onMouseEnter: () => {
|
|
989
|
-
|
|
989
|
+
x.current || a(!0);
|
|
990
990
|
},
|
|
991
991
|
onMouseLeave: () => {
|
|
992
|
-
|
|
992
|
+
x.current || a(!1);
|
|
993
993
|
},
|
|
994
994
|
onTouchStart: () => {
|
|
995
|
-
|
|
995
|
+
x.current = !0, a((v) => !v);
|
|
996
996
|
},
|
|
997
997
|
...c,
|
|
998
998
|
children: [
|
|
999
999
|
t,
|
|
1000
|
-
typeof document < "u" &&
|
|
1000
|
+
typeof document < "u" && C.createPortal(j, document.body)
|
|
1001
1001
|
]
|
|
1002
1002
|
}
|
|
1003
1003
|
);
|
|
@@ -1011,7 +1011,7 @@ function nt({
|
|
|
1011
1011
|
id: a,
|
|
1012
1012
|
...l
|
|
1013
1013
|
}) {
|
|
1014
|
-
const i = a || `toggle-${
|
|
1014
|
+
const i = a || `toggle-${A.useId()}`, p = [
|
|
1015
1015
|
"ds-toggle",
|
|
1016
1016
|
`ds-toggle--${s}`,
|
|
1017
1017
|
c && "ds-toggle--disabled"
|
|
@@ -1042,7 +1042,7 @@ function at({
|
|
|
1042
1042
|
id: a,
|
|
1043
1043
|
...l
|
|
1044
1044
|
}) {
|
|
1045
|
-
const i = a || `checkbox-${
|
|
1045
|
+
const i = a || `checkbox-${A.useId()}`, p = [
|
|
1046
1046
|
"ds-checkbox",
|
|
1047
1047
|
`ds-checkbox--${s}`,
|
|
1048
1048
|
c && "ds-checkbox--disabled"
|
|
@@ -1082,7 +1082,7 @@ function ot({
|
|
|
1082
1082
|
id: i,
|
|
1083
1083
|
...p
|
|
1084
1084
|
}) {
|
|
1085
|
-
const f = i || `radio-${
|
|
1085
|
+
const f = i || `radio-${A.useId()}`, d = [
|
|
1086
1086
|
"ds-radio",
|
|
1087
1087
|
`ds-radio--${s}`,
|
|
1088
1088
|
c && "ds-radio--disabled"
|
|
@@ -1200,7 +1200,7 @@ function mt({ children: t, interactive: e, selected: s, className: c = "", onCli
|
|
|
1200
1200
|
);
|
|
1201
1201
|
}
|
|
1202
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" ?
|
|
1203
|
+
const p = !!c || s !== void 0, f = s === "asc" ? we : s === "desc" ? K : Ne;
|
|
1204
1204
|
return /* @__PURE__ */ r.jsx(
|
|
1205
1205
|
"th",
|
|
1206
1206
|
{
|
|
@@ -1272,41 +1272,42 @@ function xt({
|
|
|
1272
1272
|
style: l,
|
|
1273
1273
|
...i
|
|
1274
1274
|
}) {
|
|
1275
|
-
const [p, f] =
|
|
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
1276
|
d ? c == null || c(!1) : f(!1);
|
|
1277
|
-
},
|
|
1277
|
+
}, $ = () => {
|
|
1278
1278
|
const m = !u;
|
|
1279
1279
|
d ? c == null || c(m) : f(m);
|
|
1280
1280
|
};
|
|
1281
|
-
|
|
1281
|
+
B(() => {
|
|
1282
1282
|
if (!u) return;
|
|
1283
1283
|
const m = () => {
|
|
1284
|
-
var
|
|
1285
|
-
const _ = (
|
|
1286
|
-
_ &&
|
|
1284
|
+
var R;
|
|
1285
|
+
const _ = (R = x.current) == null ? void 0 : R.getBoundingClientRect();
|
|
1286
|
+
_ && v(
|
|
1287
1287
|
n === "right" ? { top: _.bottom + 4, right: window.innerWidth - _.right } : { top: _.bottom + 4, left: _.left }
|
|
1288
1288
|
);
|
|
1289
1289
|
};
|
|
1290
1290
|
return m(), window.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
|
|
1291
1291
|
window.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
|
|
1292
1292
|
};
|
|
1293
|
-
}, [u, n]),
|
|
1293
|
+
}, [u, n]), B(() => {
|
|
1294
1294
|
if (!u) return;
|
|
1295
|
-
const m = (
|
|
1296
|
-
var
|
|
1297
|
-
(
|
|
1298
|
-
}, _ = (
|
|
1299
|
-
|
|
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();
|
|
1300
1300
|
};
|
|
1301
1301
|
return document.addEventListener("mousedown", m), document.addEventListener("keydown", _), () => {
|
|
1302
1302
|
document.removeEventListener("mousedown", m), document.removeEventListener("keydown", _);
|
|
1303
1303
|
};
|
|
1304
1304
|
}, [u]);
|
|
1305
|
-
const
|
|
1305
|
+
const S = u && /* @__PURE__ */ r.jsx(
|
|
1306
1306
|
"div",
|
|
1307
1307
|
{
|
|
1308
|
+
ref: b,
|
|
1308
1309
|
className: ["ds-dropdown__menu", `ds-dropdown__menu--${n}`].join(" "),
|
|
1309
|
-
style:
|
|
1310
|
+
style: j,
|
|
1310
1311
|
children: e.map((m, _) => {
|
|
1311
1312
|
if (m.separator)
|
|
1312
1313
|
return /* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__separator" }, _);
|
|
@@ -1315,18 +1316,18 @@ function xt({
|
|
|
1315
1316
|
m.label && /* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__section-label", children: m.label }),
|
|
1316
1317
|
/* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__section-content", children: m.content })
|
|
1317
1318
|
] }, _);
|
|
1318
|
-
const
|
|
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 };
|
|
1319
1320
|
return /* @__PURE__ */ r.jsxs(
|
|
1320
|
-
|
|
1321
|
+
g,
|
|
1321
1322
|
{
|
|
1322
1323
|
className: [
|
|
1323
1324
|
"ds-dropdown__item",
|
|
1324
1325
|
m.danger && "ds-dropdown__item--danger"
|
|
1325
1326
|
].filter(Boolean).join(" "),
|
|
1326
|
-
...
|
|
1327
|
+
...P,
|
|
1327
1328
|
onClick: () => {
|
|
1328
|
-
var
|
|
1329
|
-
(
|
|
1329
|
+
var M;
|
|
1330
|
+
(M = m.onClick) == null || M.call(m), k();
|
|
1330
1331
|
},
|
|
1331
1332
|
children: [
|
|
1332
1333
|
m.icon && /* @__PURE__ */ r.jsx("span", { className: "ds-dropdown__item-icon", children: m.icon }),
|
|
@@ -1342,13 +1343,13 @@ function xt({
|
|
|
1342
1343
|
return /* @__PURE__ */ r.jsxs(
|
|
1343
1344
|
"div",
|
|
1344
1345
|
{
|
|
1345
|
-
ref:
|
|
1346
|
+
ref: x,
|
|
1346
1347
|
className: ["ds-dropdown", a].filter(Boolean).join(" "),
|
|
1347
1348
|
style: l,
|
|
1348
1349
|
...i,
|
|
1349
1350
|
children: [
|
|
1350
|
-
/* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__trigger", onClick:
|
|
1351
|
-
typeof document < "u" &&
|
|
1351
|
+
/* @__PURE__ */ r.jsx("div", { className: "ds-dropdown__trigger", onClick: $, children: t }),
|
|
1352
|
+
typeof document < "u" && C.createPortal(S, document.body)
|
|
1352
1353
|
]
|
|
1353
1354
|
}
|
|
1354
1355
|
);
|
|
@@ -1359,16 +1360,16 @@ const ue = {
|
|
|
1359
1360
|
warning: me,
|
|
1360
1361
|
error: fe
|
|
1361
1362
|
};
|
|
1362
|
-
let
|
|
1363
|
+
let V = [];
|
|
1363
1364
|
const te = /* @__PURE__ */ new Set();
|
|
1364
1365
|
function he() {
|
|
1365
|
-
te.forEach((t) => t([...
|
|
1366
|
+
te.forEach((t) => t([...V]));
|
|
1366
1367
|
}
|
|
1367
1368
|
function Ae(t) {
|
|
1368
|
-
|
|
1369
|
+
V = [...V, t], he();
|
|
1369
1370
|
}
|
|
1370
1371
|
function Ie(t) {
|
|
1371
|
-
|
|
1372
|
+
V = V.filter((e) => e.id !== t), he();
|
|
1372
1373
|
}
|
|
1373
1374
|
function vt() {
|
|
1374
1375
|
const t = (e, s = {}) => {
|
|
@@ -1383,8 +1384,8 @@ function vt() {
|
|
|
1383
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 };
|
|
1384
1385
|
}
|
|
1385
1386
|
function Pe({ data: t, onDismiss: e }) {
|
|
1386
|
-
const [s, c] =
|
|
1387
|
-
|
|
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)), []);
|
|
1388
1389
|
function a() {
|
|
1389
1390
|
c(!1), setTimeout(() => e(t.id), 250);
|
|
1390
1391
|
}
|
|
@@ -1416,8 +1417,8 @@ function Pe({ data: t, onDismiss: e }) {
|
|
|
1416
1417
|
);
|
|
1417
1418
|
}
|
|
1418
1419
|
function jt({ position: t = "bottom-right" }) {
|
|
1419
|
-
const [e, s] =
|
|
1420
|
-
return
|
|
1420
|
+
const [e, s] = I(() => [...V]);
|
|
1421
|
+
return B(() => (te.add(s), () => te.delete(s)), []), !e.length || typeof document > "u" ? null : C.createPortal(
|
|
1421
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)) }),
|
|
1422
1423
|
document.body
|
|
1423
1424
|
);
|