@donkit-ai/design-system 1.1.30 → 1.1.31

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