@donkit-ai/design-system 0.4.3 → 1.0.1

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