@koide-labs/ui 0.1.2 → 0.1.3

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.
Files changed (94) hide show
  1. package/README.md +4 -1
  2. package/dist/accordion.css +1 -1
  3. package/dist/alert-dialog.css +1 -1
  4. package/dist/anchor.css +1 -1
  5. package/dist/avatar.css +1 -1
  6. package/dist/badge.css +1 -1
  7. package/dist/button.css +1 -1
  8. package/dist/checkbox.css +1 -1
  9. package/dist/code.css +1 -1
  10. package/dist/collapse.css +1 -1
  11. package/dist/command.css +1 -1
  12. package/dist/components/accordion/accordion.js +40 -40
  13. package/dist/components/alert-dialog/alert-dialog.js +9 -9
  14. package/dist/components/anchor/anchor.js +5 -5
  15. package/dist/components/avatar/avatar.js +26 -26
  16. package/dist/components/badge/badge.js +13 -13
  17. package/dist/components/button/button.js +13 -13
  18. package/dist/components/checkbox/checkbox.js +1 -1
  19. package/dist/components/code/code.js +48 -48
  20. package/dist/components/collapse/collapse.js +7 -7
  21. package/dist/components/command/command.js +121 -121
  22. package/dist/components/context-menu/context-menu.js +6 -6
  23. package/dist/components/dialog/dialog.js +1 -1
  24. package/dist/components/heading/heading.js +6 -6
  25. package/dist/components/icon/icon.js +12 -12
  26. package/dist/components/icon-button/icon-button.js +26 -26
  27. package/dist/components/inline-code/inline-code.js +2 -2
  28. package/dist/components/input/input.js +1 -1
  29. package/dist/components/meter/meter.js +40 -40
  30. package/dist/components/multiline-input/multiline-input.js +1 -1
  31. package/dist/components/number-input/number-input.js +7 -7
  32. package/dist/components/password-input/password-input.js +2 -2
  33. package/dist/components/pill/pill.js +11 -11
  34. package/dist/components/popover/popover.js +21 -21
  35. package/dist/components/preview-card/preview-card.js +2 -2
  36. package/dist/components/radio-group/radio-group.js +54 -54
  37. package/dist/components/search-bar/search-bar.js +8 -8
  38. package/dist/components/select/select.js +75 -75
  39. package/dist/components/separator/index.js +1 -1
  40. package/dist/components/separator/separator.js +1 -1
  41. package/dist/components/slider/slider.js +128 -128
  42. package/dist/components/spinner/spinner.js +4 -4
  43. package/dist/components/stacked-avatars/stacked-avatars.js +35 -35
  44. package/dist/components/status-banner/status-banner.js +22 -22
  45. package/dist/components/surface/surface.js +15 -15
  46. package/dist/components/switch/switch.js +28 -28
  47. package/dist/components/tabs/tabs.js +132 -132
  48. package/dist/components/text/text.js +25 -25
  49. package/dist/components/timestamp/timestamp.js +73 -73
  50. package/dist/components/toaster/toaster.js +165 -165
  51. package/dist/components/tooltip/index.js +1 -1
  52. package/dist/components/tooltip/tooltip.js +1 -1
  53. package/dist/components/view/view.js +44 -44
  54. package/dist/context-menu.css +1 -1
  55. package/dist/dialog.css +1 -1
  56. package/dist/{dialog.module-Pi1eHwli.js → dialog.module-1PAL873u.js} +59 -59
  57. package/dist/heading.css +1 -1
  58. package/dist/icon-button.css +1 -1
  59. package/dist/icon.css +1 -1
  60. package/dist/index.js +2 -2
  61. package/dist/inline-code.css +1 -1
  62. package/dist/input.css +1 -1
  63. package/dist/input.module-CtE19OH8.js +8 -0
  64. package/dist/integrations/react-markdown/index.js +1 -1
  65. package/dist/meter.css +1 -1
  66. package/dist/number-input.css +1 -1
  67. package/dist/password-input.css +1 -1
  68. package/dist/pill.css +1 -1
  69. package/dist/popover.css +1 -1
  70. package/dist/preview-card.css +1 -1
  71. package/dist/radio-group.css +1 -1
  72. package/dist/search-bar.css +1 -1
  73. package/dist/select.css +1 -1
  74. package/dist/{separator-wNYojB9q.js → separator-DgY7BjjO.js} +10 -10
  75. package/dist/separator.css +1 -1
  76. package/dist/slider.css +1 -1
  77. package/dist/spinner.css +1 -1
  78. package/dist/stacked-avatars.css +1 -1
  79. package/dist/status-banner.css +1 -1
  80. package/dist/styles/core.css +1 -1
  81. package/dist/surface.css +1 -1
  82. package/dist/switch.css +1 -1
  83. package/dist/tabs.css +1 -1
  84. package/dist/text.css +1 -1
  85. package/dist/timestamp.css +1 -1
  86. package/dist/toaster.css +1 -1
  87. package/dist/{tooltip-DZkByWDR.js → tooltip-BJQPwudf.js} +2 -2
  88. package/dist/tooltip.css +1 -1
  89. package/dist/view.css +1 -1
  90. package/dist/view.module-CjopAf_0.js +6 -0
  91. package/dist/view2.css +1 -1
  92. package/package.json +19 -16
  93. package/dist/input.module-zw1dlr1_.js +0 -8
  94. package/dist/view.module-DlwuNdUj.js +0 -6
@@ -1,6 +1,6 @@
1
- import { jsx as E, jsxs as re } from "react/jsx-runtime";
1
+ import { jsx as D, jsxs as re } from "react/jsx-runtime";
2
2
  import { c as Ne } from "../../clsx-OuTLNxxd.js";
3
- import { T as it, a as be, u as at } from "../../use-toast-manager-Dq-44AuW.js";
3
+ import { T as it, a as Re, u as at } from "../../use-toast-manager-Dq-44AuW.js";
4
4
  import { View as Pe } from "../view/view.js";
5
5
  import { Heading as ct } from "../heading/heading.js";
6
6
  import { Text as ut } from "../text/text.js";
@@ -11,7 +11,7 @@ import * as e from "react";
11
11
  import { o as ne } from "../../owner-rKN292Q9.js";
12
12
  import { u as U } from "../../useStableCallback-DKZHlUAT.js";
13
13
  import { T as Oe } from "../../useTimeout-BNni6aw5.js";
14
- import { d as pe, f as se, m as Ee, h as Re } from "../../element-u5WgOZX1.js";
14
+ import { d as pe, f as se, m as De, h as Ee } from "../../element-u5WgOZX1.js";
15
15
  import { F as pt } from "../../FloatingPortalLite-_ECdFE7b.js";
16
16
  import { v as mt } from "../../visuallyHidden-CpJ-mhai.js";
17
17
  import { F as Te } from "../../FloatingPortal-BQsQhvIr.js";
@@ -21,14 +21,14 @@ import * as ht from "react-dom";
21
21
  import { i as gt } from "../../inertValue-BTpPjX30.js";
22
22
  import { u as me } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
23
23
  import { f as _t } from "../../formatErrorMessage-BqPuTBN-.js";
24
- import { u as wt, t as vt } from "../../useOpenChangeComplete-BHd-N7Ig.js";
24
+ import { u as yt, t as wt } from "../../useOpenChangeComplete-BHd-N7Ig.js";
25
25
  import { u as He } from "../../useId-C5kyn6tA.js";
26
- import { u as yt } from "../../useButton-d3_JgBNr.js";
26
+ import { u as vt } from "../../useButton-d3_JgBNr.js";
27
27
  import '../../toaster.css';let Fe = 0;
28
28
  function xt(a) {
29
29
  return Fe += 1, `${a}-${Math.random().toString(36).slice(2, 6)}-${Fe}`;
30
30
  }
31
- function De(a, c) {
31
+ function be(a, c) {
32
32
  if (typeof a == "string")
33
33
  return {
34
34
  description: a
@@ -47,26 +47,26 @@ const ke = function(c) {
47
47
  timeout: s = 5e3,
48
48
  limit: F = 3,
49
49
  toastManager: M
50
- } = c, [y, u] = e.useState([]), [g, t] = e.useState(!1), [d, w] = e.useState(!1), [o, R] = e.useState(null);
51
- y.length === 0 && (g && t(!1), d && w(!1));
52
- const b = g || d, N = e.useRef(/* @__PURE__ */ new Map()), z = e.useRef(null), C = e.useRef(!0), X = e.useRef(!1);
50
+ } = c, [v, u] = e.useState([]), [g, t] = e.useState(!1), [d, y] = e.useState(!1), [o, E] = e.useState(null);
51
+ v.length === 0 && (g && t(!1), d && y(!1));
52
+ const R = g || d, N = e.useRef(/* @__PURE__ */ new Map()), z = e.useRef(null), C = e.useRef(!0), X = e.useRef(!1);
53
53
  function j(n) {
54
54
  const m = pe(ne(z.current));
55
- if (!z.current || !se(z.current, m) || !Ee(m))
55
+ if (!z.current || !se(z.current, m) || !De(m))
56
56
  return;
57
- const v = y.findIndex((r) => r.id === n);
58
- let i = null, _ = v + 1;
59
- for (; _ < y.length; ) {
60
- if (y[_].transitionStatus !== "ending") {
61
- i = y[_];
57
+ const w = v.findIndex((r) => r.id === n);
58
+ let i = null, _ = w + 1;
59
+ for (; _ < v.length; ) {
60
+ if (v[_].transitionStatus !== "ending") {
61
+ i = v[_];
62
62
  break;
63
63
  }
64
64
  _ += 1;
65
65
  }
66
66
  if (!i)
67
- for (_ = v - 1; _ >= 0; ) {
68
- if (y[_].transitionStatus !== "ending") {
69
- i = y[_];
67
+ for (_ = w - 1; _ >= 0; ) {
68
+ if (v[_].transitionStatus !== "ending") {
69
+ i = v[_];
70
70
  break;
71
71
  }
72
72
  _ -= 1;
@@ -75,12 +75,12 @@ const ke = function(c) {
75
75
  preventScroll: !0
76
76
  });
77
77
  }
78
- const D = U(() => {
78
+ const b = U(() => {
79
79
  X.current || (X.current = !0, N.current.forEach((n) => {
80
80
  if (n.timeout) {
81
81
  n.timeout.clear();
82
- const m = Date.now() - n.start, v = n.delay - m;
83
- n.remaining = v > 0 ? v : 0;
82
+ const m = Date.now() - n.start, w = n.delay - m;
83
+ n.remaining = w > 0 ? w : 0;
84
84
  }
85
85
  }));
86
86
  }), I = U(() => {
@@ -107,28 +107,28 @@ const ke = function(c) {
107
107
  });
108
108
  });
109
109
  const m = N.current.get(n);
110
- m && m.timeout && (m.timeout.clear(), N.current.delete(n)), y.find((i) => i.id === n)?.onClose?.(), j(n), y.length === 1 && (t(!1), w(!1));
110
+ m && m.timeout && (m.timeout.clear(), N.current.delete(n)), v.find((i) => i.id === n)?.onClose?.(), j(n), v.length === 1 && (t(!1), y(!1));
111
111
  }), q = U((n) => {
112
- u((v) => v.filter((i) => i.id !== n)), y.find((v) => v.id === n)?.onRemove?.();
113
- }), B = U((n, m, v) => {
112
+ u((w) => w.filter((i) => i.id !== n)), v.find((w) => w.id === n)?.onRemove?.();
113
+ }), B = U((n, m, w) => {
114
114
  const i = Date.now(), _ = C.current && !g && !d, r = _ ? Oe.create() : void 0;
115
115
  r?.start(m, () => {
116
- N.current.delete(n), v();
116
+ N.current.delete(n), w();
117
117
  }), N.current.set(n, {
118
118
  timeout: r,
119
119
  start: _ ? i : 0,
120
120
  delay: m,
121
121
  remaining: m,
122
- callback: v
122
+ callback: w
123
123
  });
124
124
  }), G = U((n) => {
125
- const m = n.id || xt("toast"), v = {
125
+ const m = n.id || xt("toast"), w = {
126
126
  ...n,
127
127
  id: m,
128
128
  transitionStatus: "starting"
129
129
  };
130
130
  u((_) => {
131
- const r = [v, ..._], p = r.filter((x) => x.transitionStatus !== "ending");
131
+ const r = [w, ..._], p = r.filter((x) => x.transitionStatus !== "ending");
132
132
  if (p.length > F) {
133
133
  const x = p.length - F, T = p.slice(-x);
134
134
  return r.map((H) => T.some((Z) => Z.id === H.id) ? {
@@ -144,67 +144,67 @@ const ke = function(c) {
144
144
  limited: !1
145
145
  }));
146
146
  });
147
- const i = v.timeout ?? s;
148
- return v.type !== "loading" && i > 0 && B(m, i, () => L(m)), (g || d || !C.current) && D(), m;
147
+ const i = w.timeout ?? s;
148
+ return w.type !== "loading" && i > 0 && B(m, i, () => L(m)), (g || d || !C.current) && b(), m;
149
149
  }), K = U((n, m) => {
150
- u((v) => v.map((i) => i.id === n ? {
150
+ u((w) => w.map((i) => i.id === n ? {
151
151
  ...i,
152
152
  ...m
153
153
  } : i));
154
154
  }), O = U((n, m) => {
155
- const v = De(m.loading), i = G({
156
- ...v,
155
+ const w = be(m.loading), i = G({
156
+ ...w,
157
157
  type: "loading"
158
158
  }), _ = n.then((r) => {
159
- const p = De(m.success, r);
159
+ const p = be(m.success, r);
160
160
  K(i, {
161
161
  ...p,
162
162
  type: "success"
163
163
  });
164
164
  const x = p.timeout ?? s;
165
- return x > 0 && B(i, x, () => L(i)), (g || d || !C.current) && D(), r;
165
+ return x > 0 && B(i, x, () => L(i)), (g || d || !C.current) && b(), r;
166
166
  }).catch((r) => {
167
- const p = De(m.error, r);
167
+ const p = be(m.error, r);
168
168
  K(i, {
169
169
  ...p,
170
170
  type: "error"
171
171
  });
172
172
  const x = p.timeout ?? s;
173
- return x > 0 && B(i, x, () => L(i)), (g || d || !C.current) && D(), Promise.reject(r);
173
+ return x > 0 && B(i, x, () => L(i)), (g || d || !C.current) && b(), Promise.reject(r);
174
174
  });
175
175
  return {}.hasOwnProperty.call(m, "setPromise") && m.setPromise(_), _;
176
176
  });
177
177
  e.useEffect(function() {
178
178
  return M ? M[" subscribe"](({
179
- action: v,
179
+ action: w,
180
180
  options: i
181
181
  }) => {
182
182
  const _ = i.id;
183
- v === "promise" && i.promise ? O(i.promise, i) : v === "update" && _ ? K(_, i) : v === "close" && _ ? L(_) : G(i);
183
+ w === "promise" && i.promise ? O(i.promise, i) : w === "update" && _ ? K(_, i) : w === "close" && _ ? L(_) : G(i);
184
184
  }) : void 0;
185
185
  }, [G, K, B, s, M, O, L]);
186
186
  const J = e.useMemo(() => ({
187
- toasts: y,
187
+ toasts: v,
188
188
  setToasts: u,
189
189
  hovering: g,
190
190
  setHovering: t,
191
191
  focused: d,
192
- setFocused: w,
193
- expanded: b,
192
+ setFocused: y,
193
+ expanded: R,
194
194
  add: G,
195
195
  close: L,
196
196
  remove: q,
197
197
  update: K,
198
198
  promise: O,
199
- pauseTimers: D,
199
+ pauseTimers: b,
200
200
  resumeTimers: I,
201
201
  prevFocusElement: o,
202
- setPrevFocusElement: R,
202
+ setPrevFocusElement: E,
203
203
  viewportRef: z,
204
204
  scheduleTimer: B,
205
205
  windowFocusedRef: C
206
- }), [G, L, d, g, b, D, o, O, q, I, B, y, K]);
207
- return /* @__PURE__ */ E(it.Provider, {
206
+ }), [G, L, d, g, R, b, o, O, q, I, B, v, K]);
207
+ return /* @__PURE__ */ D(it.Provider, {
208
208
  value: J,
209
209
  children: h
210
210
  });
@@ -220,45 +220,45 @@ const Be = /* @__PURE__ */ e.forwardRef(function(c, h) {
220
220
  render: s,
221
221
  className: F,
222
222
  children: M,
223
- ...y
223
+ ...v
224
224
  } = c, {
225
225
  toasts: u,
226
226
  pauseTimers: g,
227
227
  resumeTimers: t,
228
228
  setHovering: d,
229
- setFocused: w,
229
+ setFocused: y,
230
230
  viewportRef: o,
231
- windowFocusedRef: R,
232
- prevFocusElement: b,
231
+ windowFocusedRef: E,
232
+ prevFocusElement: R,
233
233
  setPrevFocusElement: N,
234
234
  expanded: z,
235
235
  focused: C
236
- } = be(), X = e.useRef(!1), j = e.useRef(!1), D = u.length, I = u[0]?.height ?? 0, L = e.useMemo(() => u.some((r) => r.transitionStatus === "ending"), [u]);
236
+ } = Re(), X = e.useRef(!1), j = e.useRef(!1), b = u.length, I = u[0]?.height ?? 0, L = e.useMemo(() => u.some((r) => r.transitionStatus === "ending"), [u]);
237
237
  e.useEffect(() => {
238
238
  if (!o.current)
239
239
  return;
240
240
  function r(x) {
241
- D !== 0 && x.key === "F6" && x.target !== o.current && (x.preventDefault(), N(pe(ne(o.current))), o.current?.focus({
241
+ b !== 0 && x.key === "F6" && x.target !== o.current && (x.preventDefault(), N(pe(ne(o.current))), o.current?.focus({
242
242
  preventScroll: !0
243
- }), g(), w(!0));
243
+ }), g(), y(!0));
244
244
  }
245
245
  const p = Ce(o.current);
246
246
  return p.addEventListener("keydown", r), () => {
247
247
  p.removeEventListener("keydown", r);
248
248
  };
249
- }, [g, w, N, D, o]), e.useEffect(() => {
250
- if (!o.current || !D)
249
+ }, [g, y, N, b, o]), e.useEffect(() => {
250
+ if (!o.current || !b)
251
251
  return;
252
252
  const r = Ce(o.current);
253
253
  function p(T) {
254
- T.target === r && (R.current = !1, g());
254
+ T.target === r && (E.current = !1, g());
255
255
  }
256
256
  function x(T) {
257
257
  if (T.relatedTarget || T.target === r)
258
258
  return;
259
- const H = Re(T), Z = pe(ne(o.current));
260
- (!se(o.current, H) || !Ee(Z)) && t(), setTimeout(() => {
261
- R.current = !0;
259
+ const H = Ee(T), Z = pe(ne(o.current));
260
+ (!se(o.current, H) || !De(Z)) && t(), setTimeout(() => {
261
+ E.current = !0;
262
262
  });
263
263
  }
264
264
  return r.addEventListener("blur", p, !0), r.addEventListener("focus", x, !0), () => {
@@ -268,41 +268,41 @@ const Be = /* @__PURE__ */ e.forwardRef(function(c, h) {
268
268
  g,
269
269
  t,
270
270
  o,
271
- R,
272
- w,
271
+ E,
272
+ y,
273
273
  // `viewportRef.current` isn't available on the first render,
274
274
  // since the portal node hasn't yet been created.
275
275
  // By adding this dependency, we ensure the window listeners
276
276
  // are added when toasts have been created, once the ref is available.
277
- D
277
+ b
278
278
  ]), e.useEffect(() => {
279
279
  const r = o.current;
280
- if (!r || D === 0)
280
+ if (!r || b === 0)
281
281
  return;
282
282
  const p = ne(r);
283
283
  function x(T) {
284
284
  if (T.pointerType !== "touch")
285
285
  return;
286
- const H = Re(T);
287
- se(r, H) || (t(), d(!1), w(!1));
286
+ const H = Ee(T);
287
+ se(r, H) || (t(), d(!1), y(!1));
288
288
  }
289
289
  return p.addEventListener("pointerdown", x, !0), () => {
290
290
  p.removeEventListener("pointerdown", x, !0);
291
291
  };
292
- }, [D, t, w, d, o]);
292
+ }, [b, t, y, d, o]);
293
293
  function q(r) {
294
- o.current && (X.current = !0, r.relatedTarget === o.current ? u[0]?.ref?.current?.focus() : b?.focus({
294
+ o.current && (X.current = !0, r.relatedTarget === o.current ? u[0]?.ref?.current?.focus() : R?.focus({
295
295
  preventScroll: !0
296
296
  }));
297
297
  }
298
298
  function B(r) {
299
- r.key === "Tab" && r.shiftKey && r.target === o.current && (r.preventDefault(), b?.focus({
299
+ r.key === "Tab" && r.shiftKey && r.target === o.current && (r.preventDefault(), R?.focus({
300
300
  preventScroll: !0
301
301
  }), t());
302
302
  }
303
303
  e.useEffect(() => {
304
- !R.current || L || !j.current || (t(), d(!1), j.current = !1);
305
- }, [L, t, d, R]);
304
+ !E.current || L || !j.current || (t(), d(!1), j.current = !1);
305
+ }, [L, t, d, E]);
306
306
  function G() {
307
307
  g(), d(!0), j.current = !1;
308
308
  }
@@ -314,10 +314,10 @@ const Be = /* @__PURE__ */ e.forwardRef(function(c, h) {
314
314
  X.current = !1;
315
315
  return;
316
316
  }
317
- C || Ee(ne(o.current).activeElement) && (w(!0), g());
317
+ C || De(ne(o.current).activeElement) && (y(!0), g());
318
318
  }
319
319
  function J(r) {
320
- !C || se(o.current, r.relatedTarget) || (w(!1), t());
320
+ !C || se(o.current, r.relatedTarget) || (y(!1), t());
321
321
  }
322
322
  const n = {
323
323
  tabIndex: -1,
@@ -335,18 +335,18 @@ const Be = /* @__PURE__ */ e.forwardRef(function(c, h) {
335
335
  onClick: O
336
336
  }, m = e.useMemo(() => ({
337
337
  expanded: z
338
- }), [z]), v = ie("div", c, {
338
+ }), [z]), w = ie("div", c, {
339
339
  ref: [h, o],
340
340
  state: m,
341
341
  props: [n, {
342
342
  style: {
343
343
  [Tt.frontmostHeight]: I ? `${I}px` : void 0
344
344
  }
345
- }, y, {
345
+ }, v, {
346
346
  children: /* @__PURE__ */ re(e.Fragment, {
347
- children: [D > 0 && b && /* @__PURE__ */ E(Te, {
347
+ children: [b > 0 && R && /* @__PURE__ */ D(Te, {
348
348
  onFocus: q
349
- }), M, D > 0 && b && /* @__PURE__ */ E(Te, {
349
+ }), M, b > 0 && R && /* @__PURE__ */ D(Te, {
350
350
  onFocus: q
351
351
  })]
352
352
  })
@@ -356,16 +356,16 @@ const Be = /* @__PURE__ */ e.forwardRef(function(c, h) {
356
356
  }), [o]), _ = e.useMemo(() => u.filter((r) => r.priority === "high"), [u]);
357
357
  return /* @__PURE__ */ re(Ve.Provider, {
358
358
  value: i,
359
- children: [D > 0 && b && /* @__PURE__ */ E(Te, {
359
+ children: [b > 0 && R && /* @__PURE__ */ D(Te, {
360
360
  onFocus: q
361
- }), v, !C && _.length > 0 && /* @__PURE__ */ E("div", {
361
+ }), w, !C && _.length > 0 && /* @__PURE__ */ D("div", {
362
362
  style: mt,
363
363
  children: _.map((r) => /* @__PURE__ */ re("div", {
364
364
  role: "alert",
365
365
  "aria-atomic": !0,
366
- children: [/* @__PURE__ */ E("div", {
366
+ children: [/* @__PURE__ */ D("div", {
367
367
  children: r.title
368
- }), /* @__PURE__ */ E("div", {
368
+ }), /* @__PURE__ */ D("div", {
369
369
  children: r.description
370
370
  })]
371
371
  }, r.id))
@@ -384,14 +384,14 @@ function oe() {
384
384
  let ee = /* @__PURE__ */ (function(a) {
385
385
  return a.index = "--toast-index", a.offsetY = "--toast-offset-y", a.height = "--toast-height", a.swipeMovementX = "--toast-swipe-movement-x", a.swipeMovementY = "--toast-swipe-movement-y", a;
386
386
  })({});
387
- const Dt = {
388
- ...vt,
387
+ const bt = {
388
+ ...wt,
389
389
  swipeDirection(a) {
390
390
  return a ? {
391
391
  "data-swipe-direction": a
392
392
  } : null;
393
393
  }
394
- }, ae = 40, Et = 10, Q = 0.5, Rt = 1;
394
+ }, ae = 40, Dt = 10, Q = 0.5, Et = 1;
395
395
  function Ie(a, c, h) {
396
396
  switch (a) {
397
397
  case "up":
@@ -406,13 +406,13 @@ function Ie(a, c, h) {
406
406
  return 0;
407
407
  }
408
408
  }
409
- function bt(a) {
409
+ function Rt(a) {
410
410
  const h = window.getComputedStyle(a).transform;
411
411
  let s = 0, F = 0, M = 1;
412
412
  if (h && h !== "none") {
413
- const y = h.match(/matrix(?:3d)?\(([^)]+)\)/);
414
- if (y) {
415
- const u = y[1].split(", ").map(parseFloat);
413
+ const v = h.match(/matrix(?:3d)?\(([^)]+)\)/);
414
+ if (v) {
415
+ const u = v[1].split(", ").map(parseFloat);
416
416
  u.length === 6 ? (s = u[4], F = u[5], M = Math.sqrt(u[0] * u[0] + u[1] * u[1])) : u.length === 16 && (s = u[12], F = u[13], M = u[0]);
417
417
  }
418
418
  }
@@ -427,28 +427,28 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
427
427
  toast: s,
428
428
  render: F,
429
429
  className: M,
430
- swipeDirection: y = ["down", "right"],
430
+ swipeDirection: v = ["down", "right"],
431
431
  ...u
432
432
  } = c, g = s.positionerProps?.anchor !== void 0;
433
433
  let t = [];
434
- g || (t = Array.isArray(y) ? y : [y]);
434
+ g || (t = Array.isArray(v) ? v : [v]);
435
435
  const d = t.length > 0, {
436
- toasts: w,
436
+ toasts: y,
437
437
  focused: o,
438
- close: R,
439
- remove: b,
438
+ close: E,
439
+ remove: R,
440
440
  setToasts: N,
441
441
  pauseTimers: z,
442
442
  expanded: C,
443
443
  setHovering: X
444
- } = be(), [j, D] = e.useState(void 0), [I, L] = e.useState(!1), [q, B] = e.useState(!1), [G, K] = e.useState(!1), [O, J] = e.useState({
444
+ } = Re(), [j, b] = e.useState(void 0), [I, L] = e.useState(!1), [q, B] = e.useState(!1), [G, K] = e.useState(!1), [O, J] = e.useState({
445
445
  x: 0,
446
446
  y: 0
447
447
  }), [n, m] = e.useState({
448
448
  x: 0,
449
449
  y: 0,
450
450
  scale: 1
451
- }), [v, i] = e.useState(), [_, r] = e.useState(), [p, x] = e.useState(null), T = e.useRef(null), H = e.useRef({
451
+ }), [w, i] = e.useState(), [_, r] = e.useState(), [p, x] = e.useState(null), T = e.useRef(null), H = e.useRef({
452
452
  x: 0,
453
453
  y: 0
454
454
  }), Z = e.useRef({
@@ -458,12 +458,12 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
458
458
  }), ce = e.useRef(void 0), he = e.useRef(0), ue = e.useRef(!1), $ = e.useRef({
459
459
  x: 0,
460
460
  y: 0
461
- }), ge = e.useRef(!1), _e = e.useMemo(() => w.indexOf(s), [s, w]), we = e.useMemo(() => w.filter((l) => l.transitionStatus !== "ending").indexOf(s), [s, w]), Ge = e.useMemo(() => w.slice(0, w.indexOf(s)).reduce((l, f) => l + (f.height || 0), 0), [w, s]);
462
- wt({
461
+ }), ge = e.useRef(!1), _e = e.useMemo(() => y.indexOf(s), [s, y]), ye = e.useMemo(() => y.filter((l) => l.transitionStatus !== "ending").indexOf(s), [s, y]), Ge = e.useMemo(() => y.slice(0, y.indexOf(s)).reduce((l, f) => l + (f.height || 0), 0), [y, s]);
462
+ yt({
463
463
  open: s.transitionStatus !== "ending",
464
464
  ref: T,
465
465
  onComplete() {
466
- s.transitionStatus === "ending" && b(s.id);
466
+ s.transitionStatus === "ending" && R(s.id);
467
467
  }
468
468
  });
469
469
  const le = U((l = !1) => {
@@ -496,13 +496,13 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
496
496
  if (l.button !== 0)
497
497
  return;
498
498
  l.pointerType === "touch" && z();
499
- const f = Re(l.nativeEvent);
499
+ const f = Ee(l.nativeEvent);
500
500
  if (!(f && f.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))) {
501
501
  if (ue.current = !1, ce.current = void 0, he.current = 0, H.current = {
502
502
  x: l.clientX,
503
503
  y: l.clientY
504
504
  }, $.current = H.current, T.current) {
505
- const P = bt(T.current);
505
+ const P = Rt(T.current);
506
506
  Z.current = P, m(P), J({
507
507
  x: P.x,
508
508
  y: P.y
@@ -532,7 +532,7 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
532
532
  y: $.current.y
533
533
  });
534
534
  const k = S - H.current.x, V = f - H.current.y, tt = f - $.current.y, nt = S - $.current.x;
535
- if (!q && Math.sqrt(k * k + V * V) >= Rt && (B(!0), p === null)) {
535
+ if (!q && Math.sqrt(k * k + V * V) >= Et && (B(!0), p === null)) {
536
536
  const de = t.includes("left") || t.includes("right"), rt = t.includes("up") || t.includes("down");
537
537
  if (de && rt) {
538
538
  const st = Math.abs(k), ot = Math.abs(V);
@@ -541,16 +541,16 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
541
541
  }
542
542
  let Y;
543
543
  if (!ce.current)
544
- p === "vertical" ? V > 0 ? Y = "down" : V < 0 && (Y = "up") : p === "horizontal" ? k > 0 ? Y = "right" : k < 0 && (Y = "left") : Math.abs(k) >= Math.abs(V) ? Y = k > 0 ? "right" : "left" : Y = V > 0 ? "down" : "up", Y && t.includes(Y) && (ce.current = Y, he.current = Ie(Y, k, V), D(Y));
544
+ p === "vertical" ? V > 0 ? Y = "down" : V < 0 && (Y = "up") : p === "horizontal" ? k > 0 ? Y = "right" : k < 0 && (Y = "left") : Math.abs(k) >= Math.abs(V) ? Y = k > 0 ? "right" : "left" : Y = V > 0 ? "down" : "up", Y && t.includes(Y) && (ce.current = Y, he.current = Ie(Y, k, V), b(Y));
545
545
  else {
546
546
  const xe = ce.current, de = Ie(xe, nt, tt);
547
- de > ae ? (ue.current = !1, D(xe)) : !(t.includes("left") && t.includes("right")) && !(t.includes("up") && t.includes("down")) && he.current - de >= Et && (ue.current = !0);
547
+ de > ae ? (ue.current = !1, b(xe)) : !(t.includes("left") && t.includes("right")) && !(t.includes("up") && t.includes("down")) && he.current - de >= Dt && (ue.current = !0);
548
548
  }
549
549
  const fe = Ke(k, V);
550
- let ve = Z.current.x, ye = Z.current.y;
551
- p === "horizontal" ? (t.includes("left") || t.includes("right")) && (ve += fe.x) : (p === "vertical" || (t.includes("left") || t.includes("right")) && (ve += fe.x), (t.includes("up") || t.includes("down")) && (ye += fe.y)), J({
552
- x: ve,
553
- y: ye
550
+ let we = Z.current.x, ve = Z.current.y;
551
+ p === "horizontal" ? (t.includes("left") || t.includes("right")) && (we += fe.x) : (p === "vertical" || (t.includes("left") || t.includes("right")) && (we += fe.x), (t.includes("up") || t.includes("down")) && (ve += fe.y)), J({
552
+ x: we,
553
+ y: ve
554
554
  });
555
555
  }
556
556
  function Ue(l) {
@@ -560,7 +560,7 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
560
560
  J({
561
561
  x: n.x,
562
562
  y: n.y
563
- }), D(void 0);
563
+ }), b(void 0);
564
564
  return;
565
565
  }
566
566
  let f = !1;
@@ -584,16 +584,16 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
584
584
  if (f)
585
585
  break;
586
586
  }
587
- f ? (D(A), K(!0), R(s.id)) : (J({
587
+ f ? (b(A), K(!0), E(s.id)) : (J({
588
588
  x: n.x,
589
589
  y: n.y
590
- }), D(void 0));
590
+ }), b(void 0));
591
591
  }
592
592
  function qe(l) {
593
593
  if (l.key === "Escape") {
594
594
  if (!T.current || !se(T.current, pe(ne(T.current))))
595
595
  return;
596
- R(s.id);
596
+ E(s.id);
597
597
  }
598
598
  }
599
599
  e.useEffect(() => {
@@ -631,7 +631,7 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
631
631
  role: Me ? "alertdialog" : "dialog",
632
632
  tabIndex: 0,
633
633
  "aria-modal": !1,
634
- "aria-labelledby": v,
634
+ "aria-labelledby": w,
635
635
  "aria-describedby": _,
636
636
  "aria-hidden": Me && !o ? !0 : void 0,
637
637
  onPointerDown: d ? We : void 0,
@@ -641,14 +641,14 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
641
641
  inert: gt(s.limited),
642
642
  style: {
643
643
  ...Je(),
644
- [ee.index]: s.transitionStatus === "ending" ? _e : we,
644
+ [ee.index]: s.transitionStatus === "ending" ? _e : ye,
645
645
  [ee.offsetY]: `${Ge}px`,
646
646
  [ee.height]: s.height ? `${s.height}px` : void 0
647
647
  }
648
648
  }, te = e.useMemo(() => ({
649
649
  rootRef: T,
650
650
  toast: s,
651
- titleId: v,
651
+ titleId: w,
652
652
  setTitleId: i,
653
653
  descriptionId: _,
654
654
  setDescriptionId: r,
@@ -656,9 +656,9 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
656
656
  swipeDirection: j,
657
657
  recalculateHeight: le,
658
658
  index: _e,
659
- visibleIndex: we,
659
+ visibleIndex: ye,
660
660
  expanded: C
661
- }), [s, v, _, I, j, le, _e, we, C]), Ze = e.useMemo(() => ({
661
+ }), [s, w, _, I, j, le, _e, ye, C]), Ze = e.useMemo(() => ({
662
662
  transitionStatus: s.transitionStatus,
663
663
  expanded: C,
664
664
  limited: s.limited || !1,
@@ -668,10 +668,10 @@ const $e = /* @__PURE__ */ e.forwardRef(function(c, h) {
668
668
  }), [C, s.transitionStatus, s.limited, s.type, te.swiping, te.swipeDirection]), et = ie("div", c, {
669
669
  ref: [h, te.rootRef],
670
670
  state: Ze,
671
- stateAttributesMapping: Dt,
671
+ stateAttributesMapping: bt,
672
672
  props: [Qe, u]
673
673
  });
674
- return /* @__PURE__ */ E(Se.Provider, {
674
+ return /* @__PURE__ */ D(Se.Provider, {
675
675
  value: te,
676
676
  children: et
677
677
  });
@@ -683,30 +683,30 @@ const Ae = /* @__PURE__ */ e.forwardRef(function(c, h) {
683
683
  className: F,
684
684
  ...M
685
685
  } = c, {
686
- visibleIndex: y,
686
+ visibleIndex: v,
687
687
  expanded: u,
688
688
  recalculateHeight: g
689
689
  } = oe(), t = e.useRef(null);
690
690
  me(() => {
691
- const R = t.current;
692
- if (!R || (g(), typeof ResizeObserver != "function" || typeof MutationObserver != "function"))
691
+ const E = t.current;
692
+ if (!E || (g(), typeof ResizeObserver != "function" || typeof MutationObserver != "function"))
693
693
  return;
694
- const b = new ResizeObserver(() => g(!0)), N = new MutationObserver(() => g(!0));
695
- return b.observe(R), N.observe(R, {
694
+ const R = new ResizeObserver(() => g(!0)), N = new MutationObserver(() => g(!0));
695
+ return R.observe(E), N.observe(E, {
696
696
  childList: !0,
697
697
  subtree: !0,
698
698
  characterData: !0
699
699
  }), () => {
700
- b.disconnect(), N.disconnect();
700
+ R.disconnect(), N.disconnect();
701
701
  };
702
702
  }, [g]);
703
- const d = y > 0, w = e.useMemo(() => ({
703
+ const d = v > 0, y = e.useMemo(() => ({
704
704
  expanded: u,
705
705
  behind: d
706
706
  }), [u, d]);
707
707
  return ie("div", c, {
708
708
  ref: [h, t],
709
- state: w,
709
+ state: y,
710
710
  props: M
711
711
  });
712
712
  });
@@ -716,31 +716,31 @@ const Ye = /* @__PURE__ */ e.forwardRef(function(c, h) {
716
716
  render: s,
717
717
  className: F,
718
718
  id: M,
719
- children: y,
719
+ children: v,
720
720
  ...u
721
721
  } = c, {
722
722
  toast: g
723
- } = oe(), t = y ?? g.description, d = !!t, w = He(M), {
723
+ } = oe(), t = v ?? g.description, d = !!t, y = He(M), {
724
724
  setDescriptionId: o
725
725
  } = oe();
726
726
  me(() => {
727
727
  if (d)
728
- return o(w), () => {
728
+ return o(y), () => {
729
729
  o(void 0);
730
730
  };
731
- }, [d, w, o]);
732
- const R = e.useMemo(() => ({
731
+ }, [d, y, o]);
732
+ const E = e.useMemo(() => ({
733
733
  type: g.type
734
- }), [g.type]), b = ie("p", c, {
734
+ }), [g.type]), R = ie("p", c, {
735
735
  ref: h,
736
- state: R,
736
+ state: E,
737
737
  props: {
738
738
  ...u,
739
- id: w,
739
+ id: y,
740
740
  children: t
741
741
  }
742
742
  });
743
- return d ? b : null;
743
+ return d ? R : null;
744
744
  });
745
745
  process.env.NODE_ENV !== "production" && (Ye.displayName = "ToastDescription");
746
746
  const ze = /* @__PURE__ */ e.forwardRef(function(c, h) {
@@ -748,31 +748,31 @@ const ze = /* @__PURE__ */ e.forwardRef(function(c, h) {
748
748
  render: s,
749
749
  className: F,
750
750
  id: M,
751
- children: y,
751
+ children: v,
752
752
  ...u
753
753
  } = c, {
754
754
  toast: g
755
- } = oe(), t = y ?? g.title, d = !!t, w = He(M), {
755
+ } = oe(), t = v ?? g.title, d = !!t, y = He(M), {
756
756
  setTitleId: o
757
757
  } = oe();
758
758
  me(() => {
759
759
  if (d)
760
- return o(w), () => {
760
+ return o(y), () => {
761
761
  o(void 0);
762
762
  };
763
- }, [d, w, o]);
764
- const R = e.useMemo(() => ({
763
+ }, [d, y, o]);
764
+ const E = e.useMemo(() => ({
765
765
  type: g.type
766
- }), [g.type]), b = ie("h2", c, {
766
+ }), [g.type]), R = ie("h2", c, {
767
767
  ref: h,
768
- state: R,
768
+ state: E,
769
769
  props: {
770
770
  ...u,
771
- id: w,
771
+ id: y,
772
772
  children: t
773
773
  }
774
774
  });
775
- return d ? b : null;
775
+ return d ? R : null;
776
776
  });
777
777
  process.env.NODE_ENV !== "production" && (ze.displayName = "ToastTitle");
778
778
  const Xe = /* @__PURE__ */ e.forwardRef(function(c, h) {
@@ -780,27 +780,27 @@ const Xe = /* @__PURE__ */ e.forwardRef(function(c, h) {
780
780
  render: s,
781
781
  className: F,
782
782
  disabled: M,
783
- nativeButton: y = !0,
783
+ nativeButton: v = !0,
784
784
  ...u
785
785
  } = c, {
786
786
  close: g,
787
787
  expanded: t
788
- } = be(), {
788
+ } = Re(), {
789
789
  toast: d
790
- } = oe(), [w, o] = e.useState(!1), {
791
- getButtonProps: R,
792
- buttonRef: b
793
- } = yt({
790
+ } = oe(), [y, o] = e.useState(!1), {
791
+ getButtonProps: E,
792
+ buttonRef: R
793
+ } = vt({
794
794
  disabled: M,
795
- native: y
795
+ native: v
796
796
  }), N = e.useMemo(() => ({
797
797
  type: d.type
798
798
  }), [d.type]);
799
799
  return ie("button", c, {
800
- ref: [h, b],
800
+ ref: [h, R],
801
801
  state: N,
802
802
  props: [{
803
- "aria-hidden": !t && !w,
803
+ "aria-hidden": !t && !y,
804
804
  onClick() {
805
805
  g(d.id);
806
806
  },
@@ -810,11 +810,11 @@ const Xe = /* @__PURE__ */ e.forwardRef(function(c, h) {
810
810
  onBlur() {
811
811
  o(!1);
812
812
  }
813
- }, u, R]
813
+ }, u, E]
814
814
  });
815
815
  });
816
816
  process.env.NODE_ENV !== "production" && (Xe.displayName = "ToastClose");
817
- const St = pt, Mt = "_toaster__viewport_rfuxw_2", Nt = "_toaster_rfuxw_2", Pt = "_toaster_variant_neutral_rfuxw_112", Ot = "_toaster_variant_colorway_rfuxw_118", Ct = "_toaster__content_rfuxw_124", Ft = "_toaster__header_rfuxw_143", It = "_toaster__header_pad_rfuxw_147", Lt = "_toaster__title_rfuxw_151", Ht = "_toaster__description_rfuxw_155", kt = "_toaster__close_rfuxw_159", W = {
817
+ const St = pt, Mt = "_toaster__viewport_twmyb_2", Nt = "_toaster_twmyb_2", Pt = "_toaster_variant_neutral_twmyb_112", Ot = "_toaster_variant_colorway_twmyb_118", Ct = "_toaster__content_twmyb_124", Ft = "_toaster__header_twmyb_143", It = "_toaster__header_pad_twmyb_147", Lt = "_toaster__title_twmyb_151", Ht = "_toaster__description_twmyb_155", kt = "_toaster__close_twmyb_159", W = {
818
818
  toaster__viewport: Mt,
819
819
  toaster: Nt,
820
820
  toaster_variant_neutral: Pt,
@@ -834,13 +834,13 @@ const St = pt, Mt = "_toaster__viewport_rfuxw_2", Nt = "_toaster_rfuxw_2", Pt =
834
834
  function ln({ children: a, ...c }) {
835
835
  return /* @__PURE__ */ re(ke, { ...c, children: [
836
836
  a,
837
- /* @__PURE__ */ E(St, { children: /* @__PURE__ */ E(Be, { className: W.toaster__viewport, children: /* @__PURE__ */ E(Vt, {}) }) })
837
+ /* @__PURE__ */ D(St, { children: /* @__PURE__ */ D(Be, { className: W.toaster__viewport, children: /* @__PURE__ */ D(Vt, {}) }) })
838
838
  ] });
839
839
  }
840
840
  function Vt() {
841
841
  return at().toasts.map((c) => {
842
842
  const h = c.type && c.type in Le ? Le[c.type] : void 0;
843
- return /* @__PURE__ */ E(
843
+ return /* @__PURE__ */ D(
844
844
  $e,
845
845
  {
846
846
  toast: c,
@@ -848,11 +848,11 @@ function Vt() {
848
848
  W.toaster,
849
849
  h ? W.toaster_variant_colorway : W.toaster_variant_neutral
850
850
  ),
851
- render: /* @__PURE__ */ E(dt, { background: "default", color: h }),
851
+ render: /* @__PURE__ */ D(dt, { background: "default", color: h }),
852
852
  children: /* @__PURE__ */ re(
853
853
  Pe,
854
854
  {
855
- render: /* @__PURE__ */ E(Ae, {}),
855
+ render: /* @__PURE__ */ D(Ae, {}),
856
856
  className: W.toaster__content,
857
857
  children: [
858
858
  /* @__PURE__ */ re(
@@ -863,10 +863,10 @@ function Vt() {
863
863
  !c.title && W.toaster__header_pad
864
864
  ),
865
865
  children: [
866
- /* @__PURE__ */ E(
866
+ /* @__PURE__ */ D(
867
867
  ze,
868
868
  {
869
- render: /* @__PURE__ */ E(
869
+ render: /* @__PURE__ */ D(
870
870
  ct,
871
871
  {
872
872
  level: 2,
@@ -877,20 +877,20 @@ function Vt() {
877
877
  )
878
878
  }
879
879
  ),
880
- /* @__PURE__ */ E(
880
+ /* @__PURE__ */ D(
881
881
  Ye,
882
882
  {
883
- render: /* @__PURE__ */ E(ut, { multiline: !0, color: h ? "inherit" : "dimmer" }),
883
+ render: /* @__PURE__ */ D(ut, { multiline: !0, color: h ? "inherit" : "dimmer" }),
884
884
  className: W.toaster__description
885
885
  }
886
886
  )
887
887
  ]
888
888
  }
889
889
  ),
890
- /* @__PURE__ */ E(
890
+ /* @__PURE__ */ D(
891
891
  Xe,
892
892
  {
893
- render: /* @__PURE__ */ E(
893
+ render: /* @__PURE__ */ D(
894
894
  lt,
895
895
  {
896
896
  interactive: h ? `${h}_no-fill` : "no-fill",
@@ -902,7 +902,7 @@ function Vt() {
902
902
  )
903
903
  }
904
904
  ),
905
- c.action ? /* @__PURE__ */ E(
905
+ c.action ? /* @__PURE__ */ D(
906
906
  ft,
907
907
  {
908
908
  ...c.action,