@donkit-ai/design-system 1.0.1 → 1.0.4

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