@donkit-ai/design-system 1.1.18 → 1.1.20

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