@koide-labs/ui 0.0.14 → 0.0.15

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.
@@ -9,7 +9,7 @@ import { View as Pe } from "../view/index.js";
9
9
  import { T as ft, a as be, u as dt } from "../../use-toast-manager-Dq-44AuW.js";
10
10
  import * as e from "react";
11
11
  import { o as ne } from "../../owner-rKN292Q9.js";
12
- import { u as U } from "../../useStableCallback-CkTrVkNX.js";
12
+ import { u as W } from "../../useStableCallback-CkTrVkNX.js";
13
13
  import { T as Oe } from "../../useTimeout-CflX-kz3.js";
14
14
  import { h as pe, f as re, m as Ee, e as Re } from "../../element-CZEOj04G.js";
15
15
  import { F as pt } from "../../FloatingPortalLite-DVyq6YhV.js";
@@ -20,9 +20,9 @@ import { d as Ce } from "../../floating-ui.utils.dom-C7FS5id0.js";
20
20
  import * as ht from "react-dom";
21
21
  import { i as gt } from "../../inertValue-BCYGsdmf.js";
22
22
  import { u as me } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
23
- import { f as vt } from "../../formatErrorMessage-BqPuTBN-.js";
24
- import { a as _t, t as wt } from "../../useOpenChangeComplete-Dse9kY9E.js";
25
- import { u as He } from "../../useId-C5kyn6tA.js";
23
+ import { f as _t } from "../../formatErrorMessage-BqPuTBN-.js";
24
+ import { a as vt, t as wt } from "../../useOpenChangeComplete-Dse9kY9E.js";
25
+ import { u as Le } from "../../useId-C5kyn6tA.js";
26
26
  import { u as yt } from "../../useButton-DfIwsdb8.js";
27
27
  import '../../toast.css';let Fe = 0;
28
28
  function xt(f) {
@@ -41,62 +41,62 @@ function De(f, d) {
41
41
  }
42
42
  return f;
43
43
  }
44
- const ke = function(d) {
44
+ const He = function(d) {
45
45
  const {
46
46
  children: h,
47
47
  timeout: s = 5e3,
48
48
  limit: F = 3,
49
49
  toastManager: M
50
- } = d, [y, a] = e.useState([]), [g, t] = e.useState(!1), [l, _] = e.useState(!1), [o, R] = e.useState(null);
51
- y.length === 0 && (g && t(!1), l && _(!1));
52
- const b = g || l, N = e.useRef(/* @__PURE__ */ new Map()), Y = e.useRef(null), C = e.useRef(!0), X = e.useRef(!1);
53
- function j(n) {
54
- const m = pe(ne(Y.current));
55
- if (!Y.current || !re(Y.current, m) || !Ee(m))
50
+ } = d, [y, a] = e.useState([]), [g, t] = e.useState(!1), [l, v] = e.useState(!1), [o, R] = e.useState(null);
51
+ y.length === 0 && (g && t(!1), l && v(!1));
52
+ const b = g || l, N = e.useRef(/* @__PURE__ */ new Map()), A = e.useRef(null), C = e.useRef(!0), Y = e.useRef(!1);
53
+ function K(n) {
54
+ const m = pe(ne(A.current));
55
+ if (!A.current || !re(A.current, m) || !Ee(m))
56
56
  return;
57
57
  const w = y.findIndex((r) => r.id === n);
58
- let i = null, v = w + 1;
59
- for (; v < y.length; ) {
60
- if (y[v].transitionStatus !== "ending") {
61
- i = y[v];
58
+ let i = null, _ = w + 1;
59
+ for (; _ < y.length; ) {
60
+ if (y[_].transitionStatus !== "ending") {
61
+ i = y[_];
62
62
  break;
63
63
  }
64
- v += 1;
64
+ _ += 1;
65
65
  }
66
66
  if (!i)
67
- for (v = w - 1; v >= 0; ) {
68
- if (y[v].transitionStatus !== "ending") {
69
- i = y[v];
67
+ for (_ = w - 1; _ >= 0; ) {
68
+ if (y[_].transitionStatus !== "ending") {
69
+ i = y[_];
70
70
  break;
71
71
  }
72
- v -= 1;
72
+ _ -= 1;
73
73
  }
74
74
  i ? i.ref?.current?.focus() : o?.focus({
75
75
  preventScroll: !0
76
76
  });
77
77
  }
78
- const D = U(() => {
79
- X.current || (X.current = !0, N.current.forEach((n) => {
78
+ const D = W(() => {
79
+ Y.current || (Y.current = !0, N.current.forEach((n) => {
80
80
  if (n.timeout) {
81
81
  n.timeout.clear();
82
82
  const m = Date.now() - n.start, w = n.delay - m;
83
83
  n.remaining = w > 0 ? w : 0;
84
84
  }
85
85
  }));
86
- }), I = U(() => {
87
- X.current && (X.current = !1, N.current.forEach((n, m) => {
86
+ }), k = W(() => {
87
+ Y.current && (Y.current = !1, N.current.forEach((n, m) => {
88
88
  n.remaining = n.remaining > 0 ? n.remaining : n.delay, n.timeout ??= Oe.create(), n.timeout.start(n.remaining, () => {
89
89
  N.current.delete(m), n.callback();
90
90
  }), n.start = Date.now();
91
91
  }));
92
- }), L = U((n) => {
92
+ }), I = W((n) => {
93
93
  a((i) => {
94
- const v = i.map((p) => p.id === n ? {
94
+ const _ = i.map((p) => p.id === n ? {
95
95
  ...p,
96
96
  transitionStatus: "ending",
97
97
  height: 0
98
- } : p), r = v.filter((p) => p.transitionStatus !== "ending");
99
- return v.map((p) => {
98
+ } : p), r = _.filter((p) => p.transitionStatus !== "ending");
99
+ return _.map((p) => {
100
100
  if (p.transitionStatus === "ending")
101
101
  return p;
102
102
  const x = r.indexOf(p) >= F;
@@ -107,35 +107,35 @@ const ke = function(d) {
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), _(!1));
111
- }), q = U((n) => {
110
+ m && m.timeout && (m.timeout.clear(), N.current.delete(n)), y.find((i) => i.id === n)?.onClose?.(), K(n), y.length === 1 && (t(!1), v(!1));
111
+ }), U = W((n) => {
112
112
  a((w) => w.filter((i) => i.id !== n)), y.find((w) => w.id === n)?.onRemove?.();
113
- }), V = U((n, m, w) => {
114
- const i = Date.now(), v = C.current && !g && !l, r = v ? Oe.create() : void 0;
113
+ }), $ = W((n, m, w) => {
114
+ const i = Date.now(), _ = C.current && !g && !l, r = _ ? Oe.create() : void 0;
115
115
  r?.start(m, () => {
116
116
  N.current.delete(n), w();
117
117
  }), N.current.set(n, {
118
118
  timeout: r,
119
- start: v ? i : 0,
119
+ start: _ ? i : 0,
120
120
  delay: m,
121
121
  remaining: m,
122
122
  callback: w
123
123
  });
124
- }), G = U((n) => {
124
+ }), z = W((n) => {
125
125
  const m = n.id || xt("toast"), w = {
126
126
  ...n,
127
127
  id: m,
128
128
  transitionStatus: "starting"
129
129
  };
130
- a((v) => {
131
- const r = [w, ...v], p = r.filter((x) => x.transitionStatus !== "ending");
130
+ a((_) => {
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
- return r.map((H) => T.some((Z) => Z.id === H.id) ? {
135
- ...H,
134
+ return r.map((L) => T.some((Z) => Z.id === L.id) ? {
135
+ ...L,
136
136
  limited: !0
137
137
  } : {
138
- ...H,
138
+ ...L,
139
139
  limited: !1
140
140
  });
141
141
  }
@@ -145,77 +145,77 @@ const ke = function(d) {
145
145
  }));
146
146
  });
147
147
  const i = w.timeout ?? s;
148
- return w.type !== "loading" && i > 0 && V(m, i, () => L(m)), (g || l || !C.current) && D(), m;
149
- }), K = U((n, m) => {
148
+ return w.type !== "loading" && i > 0 && $(m, i, () => I(m)), (g || l || !C.current) && D(), m;
149
+ }), X = W((n, m) => {
150
150
  a((w) => w.map((i) => i.id === n ? {
151
151
  ...i,
152
152
  ...m
153
153
  } : i));
154
- }), O = U((n, m) => {
155
- const w = De(m.loading), i = G({
154
+ }), O = W((n, m) => {
155
+ const w = De(m.loading), i = z({
156
156
  ...w,
157
157
  type: "loading"
158
- }), v = n.then((r) => {
158
+ }), _ = n.then((r) => {
159
159
  const p = De(m.success, r);
160
- K(i, {
160
+ X(i, {
161
161
  ...p,
162
162
  type: "success"
163
163
  });
164
164
  const x = p.timeout ?? s;
165
- return x > 0 && V(i, x, () => L(i)), (g || l || !C.current) && D(), r;
165
+ return x > 0 && $(i, x, () => I(i)), (g || l || !C.current) && D(), r;
166
166
  }).catch((r) => {
167
167
  const p = De(m.error, r);
168
- K(i, {
168
+ X(i, {
169
169
  ...p,
170
170
  type: "error"
171
171
  });
172
172
  const x = p.timeout ?? s;
173
- return x > 0 && V(i, x, () => L(i)), (g || l || !C.current) && D(), Promise.reject(r);
173
+ return x > 0 && $(i, x, () => I(i)), (g || l || !C.current) && D(), Promise.reject(r);
174
174
  });
175
- return {}.hasOwnProperty.call(m, "setPromise") && m.setPromise(v), v;
175
+ return {}.hasOwnProperty.call(m, "setPromise") && m.setPromise(_), _;
176
176
  });
177
177
  e.useEffect(function() {
178
178
  return M ? M[" subscribe"](({
179
179
  action: w,
180
180
  options: i
181
181
  }) => {
182
- const v = i.id;
183
- w === "promise" && i.promise ? O(i.promise, i) : w === "update" && v ? K(v, i) : w === "close" && v ? L(v) : G(i);
182
+ const _ = i.id;
183
+ w === "promise" && i.promise ? O(i.promise, i) : w === "update" && _ ? X(_, i) : w === "close" && _ ? I(_) : z(i);
184
184
  }) : void 0;
185
- }, [G, K, V, s, M, O, L]);
185
+ }, [z, X, $, s, M, O, I]);
186
186
  const J = e.useMemo(() => ({
187
187
  toasts: y,
188
188
  setToasts: a,
189
189
  hovering: g,
190
190
  setHovering: t,
191
191
  focused: l,
192
- setFocused: _,
192
+ setFocused: v,
193
193
  expanded: b,
194
- add: G,
195
- close: L,
196
- remove: q,
197
- update: K,
194
+ add: z,
195
+ close: I,
196
+ remove: U,
197
+ update: X,
198
198
  promise: O,
199
199
  pauseTimers: D,
200
- resumeTimers: I,
200
+ resumeTimers: k,
201
201
  prevFocusElement: o,
202
202
  setPrevFocusElement: R,
203
- viewportRef: Y,
204
- scheduleTimer: V,
203
+ viewportRef: A,
204
+ scheduleTimer: $,
205
205
  windowFocusedRef: C
206
- }), [G, L, l, g, b, D, o, O, q, I, V, y, K]);
206
+ }), [z, I, l, g, b, D, o, O, U, k, $, y, X]);
207
207
  return /* @__PURE__ */ E(ft.Provider, {
208
208
  value: J,
209
209
  children: h
210
210
  });
211
211
  };
212
- process.env.NODE_ENV !== "production" && (ke.displayName = "ToastProvider");
213
- const ze = /* @__PURE__ */ e.createContext(void 0);
214
- process.env.NODE_ENV !== "production" && (ze.displayName = "ToastViewportContext");
212
+ process.env.NODE_ENV !== "production" && (He.displayName = "ToastProvider");
213
+ const Ve = /* @__PURE__ */ e.createContext(void 0);
214
+ process.env.NODE_ENV !== "production" && (Ve.displayName = "ToastViewportContext");
215
215
  let Tt = /* @__PURE__ */ (function(f) {
216
216
  return f.frontmostHeight = "--toast-frontmost-height", f;
217
217
  })({});
218
- const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
218
+ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
219
219
  const {
220
220
  render: s,
221
221
  className: F,
@@ -226,27 +226,27 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
226
226
  pauseTimers: g,
227
227
  resumeTimers: t,
228
228
  setHovering: l,
229
- setFocused: _,
229
+ setFocused: v,
230
230
  viewportRef: o,
231
231
  windowFocusedRef: R,
232
232
  prevFocusElement: b,
233
233
  setPrevFocusElement: N,
234
- expanded: Y,
234
+ expanded: A,
235
235
  focused: C
236
- } = be(), X = e.useRef(!1), j = e.useRef(!1), D = a.length, I = a[0]?.height ?? 0, L = e.useMemo(() => a.some((r) => r.transitionStatus === "ending"), [a]);
236
+ } = be(), Y = e.useRef(!1), K = e.useRef(!1), D = a.length, k = a[0]?.height ?? 0, I = e.useMemo(() => a.some((r) => r.transitionStatus === "ending"), [a]);
237
237
  e.useEffect(() => {
238
238
  if (!o.current)
239
239
  return;
240
240
  function r(x) {
241
241
  D !== 0 && x.key === "F6" && x.target !== o.current && (x.preventDefault(), N(pe(ne(o.current))), o.current?.focus({
242
242
  preventScroll: !0
243
- }), g(), _(!0));
243
+ }), g(), v(!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, _, N, D, o]), e.useEffect(() => {
249
+ }, [g, v, N, D, o]), e.useEffect(() => {
250
250
  if (!o.current || !D)
251
251
  return;
252
252
  const r = Ce(o.current);
@@ -256,8 +256,8 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
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
- (!re(o.current, H) || !Ee(Z)) && t(), setTimeout(() => {
259
+ const L = Re(T), Z = pe(ne(o.current));
260
+ (!re(o.current, L) || !Ee(Z)) && t(), setTimeout(() => {
261
261
  R.current = !0;
262
262
  });
263
263
  }
@@ -269,7 +269,7 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
269
269
  t,
270
270
  o,
271
271
  R,
272
- _,
272
+ v,
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
@@ -283,41 +283,41 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
283
283
  function x(T) {
284
284
  if (T.pointerType !== "touch")
285
285
  return;
286
- const H = Re(T);
287
- re(r, H) || (t(), l(!1), _(!1));
286
+ const L = Re(T);
287
+ re(r, L) || (t(), l(!1), v(!1));
288
288
  }
289
289
  return p.addEventListener("pointerdown", x, !0), () => {
290
290
  p.removeEventListener("pointerdown", x, !0);
291
291
  };
292
- }, [D, t, _, l, o]);
293
- function q(r) {
294
- o.current && (X.current = !0, r.relatedTarget === o.current ? a[0]?.ref?.current?.focus() : b?.focus({
292
+ }, [D, t, v, l, o]);
293
+ function U(r) {
294
+ o.current && (Y.current = !0, r.relatedTarget === o.current ? a[0]?.ref?.current?.focus() : b?.focus({
295
295
  preventScroll: !0
296
296
  }));
297
297
  }
298
- function V(r) {
298
+ function $(r) {
299
299
  r.key === "Tab" && r.shiftKey && r.target === o.current && (r.preventDefault(), b?.focus({
300
300
  preventScroll: !0
301
301
  }), t());
302
302
  }
303
303
  e.useEffect(() => {
304
- !R.current || L || !j.current || (t(), l(!1), j.current = !1);
305
- }, [L, t, l, R]);
306
- function G() {
307
- g(), l(!0), j.current = !1;
304
+ !R.current || I || !K.current || (t(), l(!1), K.current = !1);
305
+ }, [I, t, l, R]);
306
+ function z() {
307
+ g(), l(!0), K.current = !1;
308
308
  }
309
- function K() {
310
- a.some((r) => r.transitionStatus === "ending") ? j.current = !0 : (t(), l(!1));
309
+ function X() {
310
+ a.some((r) => r.transitionStatus === "ending") ? K.current = !0 : (t(), l(!1));
311
311
  }
312
312
  function O() {
313
- if (X.current) {
314
- X.current = !1;
313
+ if (Y.current) {
314
+ Y.current = !1;
315
315
  return;
316
316
  }
317
- C || Ee(ne(o.current).activeElement) && (_(!0), g());
317
+ C || Ee(ne(o.current).activeElement) && (v(!0), g());
318
318
  }
319
319
  function J(r) {
320
- !C || re(o.current, r.relatedTarget) || (_(!1), t());
320
+ !C || re(o.current, r.relatedTarget) || (v(!1), t());
321
321
  }
322
322
  const n = {
323
323
  tabIndex: -1,
@@ -326,41 +326,41 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
326
326
  "aria-atomic": !1,
327
327
  "aria-relevant": "additions text",
328
328
  "aria-label": "Notifications",
329
- onMouseEnter: G,
330
- onMouseMove: G,
331
- onMouseLeave: K,
329
+ onMouseEnter: z,
330
+ onMouseMove: z,
331
+ onMouseLeave: X,
332
332
  onFocus: O,
333
333
  onBlur: J,
334
- onKeyDown: V,
334
+ onKeyDown: $,
335
335
  onClick: O
336
336
  }, m = e.useMemo(() => ({
337
- expanded: Y
338
- }), [Y]), w = oe("div", d, {
337
+ expanded: A
338
+ }), [A]), w = oe("div", d, {
339
339
  ref: [h, o],
340
340
  state: m,
341
341
  props: [n, {
342
342
  style: {
343
- [Tt.frontmostHeight]: I ? `${I}px` : void 0
343
+ [Tt.frontmostHeight]: k ? `${k}px` : void 0
344
344
  }
345
345
  }, y, {
346
346
  children: /* @__PURE__ */ ae(e.Fragment, {
347
347
  children: [D > 0 && b && /* @__PURE__ */ E(Te, {
348
- onFocus: q
348
+ onFocus: U
349
349
  }), M, D > 0 && b && /* @__PURE__ */ E(Te, {
350
- onFocus: q
350
+ onFocus: U
351
351
  })]
352
352
  })
353
353
  }]
354
354
  }), i = e.useMemo(() => ({
355
355
  viewportRef: o
356
- }), [o]), v = e.useMemo(() => a.filter((r) => r.priority === "high"), [a]);
357
- return /* @__PURE__ */ ae(ze.Provider, {
356
+ }), [o]), _ = e.useMemo(() => a.filter((r) => r.priority === "high"), [a]);
357
+ return /* @__PURE__ */ ae(Ve.Provider, {
358
358
  value: i,
359
359
  children: [D > 0 && b && /* @__PURE__ */ E(Te, {
360
- onFocus: q
361
- }), w, !C && v.length > 0 && /* @__PURE__ */ E("div", {
360
+ onFocus: U
361
+ }), w, !C && _.length > 0 && /* @__PURE__ */ E("div", {
362
362
  style: mt,
363
- children: v.map((r) => /* @__PURE__ */ ae("div", {
363
+ children: _.map((r) => /* @__PURE__ */ ae("div", {
364
364
  role: "alert",
365
365
  "aria-atomic": !0,
366
366
  children: [/* @__PURE__ */ E("div", {
@@ -372,13 +372,13 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, h) {
372
372
  })]
373
373
  });
374
374
  });
375
- process.env.NODE_ENV !== "production" && (Ve.displayName = "ToastViewport");
375
+ process.env.NODE_ENV !== "production" && ($e.displayName = "ToastViewport");
376
376
  const Se = /* @__PURE__ */ e.createContext(void 0);
377
377
  process.env.NODE_ENV !== "production" && (Se.displayName = "ToastRootContext");
378
378
  function se() {
379
379
  const f = e.useContext(Se);
380
380
  if (!f)
381
- throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>." : vt(66));
381
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>." : _t(66));
382
382
  return f;
383
383
  }
384
384
  let ee = /* @__PURE__ */ (function(f) {
@@ -392,7 +392,7 @@ const Dt = {
392
392
  } : null;
393
393
  }
394
394
  }, ie = 40, Et = 10, Q = 0.5, Rt = 1;
395
- function Ie(f, d, h) {
395
+ function ke(f, d, h) {
396
396
  switch (f) {
397
397
  case "up":
398
398
  return -h;
@@ -422,7 +422,7 @@ function bt(f) {
422
422
  scale: M
423
423
  };
424
424
  }
425
- const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
425
+ const je = /* @__PURE__ */ e.forwardRef(function(d, h) {
426
426
  const {
427
427
  toast: s,
428
428
  render: F,
@@ -433,40 +433,40 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
433
433
  let t = [];
434
434
  g || (t = Array.isArray(y) ? y : [y]);
435
435
  const l = t.length > 0, {
436
- toasts: _,
436
+ toasts: v,
437
437
  focused: o,
438
438
  close: R,
439
439
  remove: b,
440
440
  setToasts: N,
441
- pauseTimers: Y,
441
+ pauseTimers: A,
442
442
  expanded: C,
443
- setHovering: X
444
- } = be(), [j, D] = e.useState(void 0), [I, L] = e.useState(!1), [q, V] = e.useState(!1), [G, K] = e.useState(!1), [O, J] = e.useState({
443
+ setHovering: Y
444
+ } = be(), [K, D] = e.useState(void 0), [k, I] = e.useState(!1), [U, $] = e.useState(!1), [z, X] = 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
- }), [w, i] = e.useState(), [v, 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), L = e.useRef({
452
452
  x: 0,
453
453
  y: 0
454
454
  }), Z = e.useRef({
455
455
  x: 0,
456
456
  y: 0,
457
457
  scale: 1
458
- }), ce = e.useRef(void 0), he = e.useRef(0), ue = e.useRef(!1), $ = e.useRef({
458
+ }), ce = e.useRef(void 0), he = e.useRef(0), ue = e.useRef(!1), j = e.useRef({
459
459
  x: 0,
460
460
  y: 0
461
- }), ge = e.useRef(!1), ve = e.useMemo(() => _.indexOf(s), [s, _]), _e = e.useMemo(() => _.filter((c) => c.transitionStatus !== "ending").indexOf(s), [s, _]), Ge = e.useMemo(() => _.slice(0, _.indexOf(s)).reduce((c, u) => c + (u.height || 0), 0), [_, s]);
462
- _t({
461
+ }), ge = e.useRef(!1), _e = e.useMemo(() => v.indexOf(s), [s, v]), ve = e.useMemo(() => v.filter((c) => c.transitionStatus !== "ending").indexOf(s), [s, v]), ze = e.useMemo(() => v.slice(0, v.indexOf(s)).reduce((c, u) => c + (u.height || 0), 0), [v, s]);
462
+ vt({
463
463
  open: s.transitionStatus !== "ending",
464
464
  ref: T,
465
465
  onComplete() {
466
466
  s.transitionStatus === "ending" && b(s.id);
467
467
  }
468
468
  });
469
- const le = U((c = !1) => {
469
+ const le = W((c = !1) => {
470
470
  const u = T.current;
471
471
  if (!u)
472
472
  return;
@@ -475,46 +475,46 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
475
475
  const P = u.offsetHeight;
476
476
  u.style.height = S;
477
477
  function B() {
478
- N((k) => k.map((z) => z.id === s.id ? {
479
- ...z,
478
+ N((H) => H.map((V) => V.id === s.id ? {
479
+ ...V,
480
480
  ref: T,
481
481
  height: P,
482
482
  transitionStatus: void 0
483
- } : z));
483
+ } : V));
484
484
  }
485
485
  c ? ht.flushSync(B) : B();
486
486
  });
487
487
  me(le, [le]);
488
- function Ke(c, u) {
488
+ function Xe(c, u) {
489
489
  let S = c, P = u;
490
490
  return !t.includes("left") && !t.includes("right") ? S = c > 0 ? c ** Q : -(Math.abs(c) ** Q) : (!t.includes("right") && c > 0 && (S = c ** Q), !t.includes("left") && c < 0 && (S = -(Math.abs(c) ** Q))), !t.includes("up") && !t.includes("down") ? P = u > 0 ? u ** Q : -(Math.abs(u) ** Q) : (!t.includes("down") && u > 0 && (P = u ** Q), !t.includes("up") && u < 0 && (P = -(Math.abs(u) ** Q))), {
491
491
  x: S,
492
492
  y: P
493
493
  };
494
494
  }
495
- function We(c) {
495
+ function Ge(c) {
496
496
  if (c.button !== 0)
497
497
  return;
498
- c.pointerType === "touch" && Y();
498
+ c.pointerType === "touch" && A();
499
499
  const u = Re(c.nativeEvent);
500
500
  if (!(u && u.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))) {
501
- if (ue.current = !1, ce.current = void 0, he.current = 0, H.current = {
501
+ if (ue.current = !1, ce.current = void 0, he.current = 0, L.current = {
502
502
  x: c.clientX,
503
503
  y: c.clientY
504
- }, $.current = H.current, T.current) {
504
+ }, j.current = L.current, T.current) {
505
505
  const P = bt(T.current);
506
506
  Z.current = P, m(P), J({
507
507
  x: P.x,
508
508
  y: P.y
509
509
  });
510
510
  }
511
- X(!0), L(!0), V(!1), x(null), ge.current = !0, T.current?.setPointerCapture(c.pointerId);
511
+ Y(!0), I(!0), $(!1), x(null), ge.current = !0, T.current?.setPointerCapture(c.pointerId);
512
512
  }
513
513
  }
514
- function je(c) {
515
- if (!I)
514
+ function Ke(c) {
515
+ if (!k)
516
516
  return;
517
- c.preventDefault(), ge.current && (H.current = {
517
+ c.preventDefault(), ge.current && (L.current = {
518
518
  x: c.clientX,
519
519
  y: c.clientY
520
520
  }, ge.current = !1);
@@ -524,39 +524,39 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
524
524
  movementX: P,
525
525
  movementY: B
526
526
  } = c;
527
- (B < 0 && u > $.current.y || B > 0 && u < $.current.y) && ($.current = {
528
- x: $.current.x,
527
+ (B < 0 && u > j.current.y || B > 0 && u < j.current.y) && (j.current = {
528
+ x: j.current.x,
529
529
  y: u
530
- }), (P < 0 && S > $.current.x || P > 0 && S < $.current.x) && ($.current = {
530
+ }), (P < 0 && S > j.current.x || P > 0 && S < j.current.x) && (j.current = {
531
531
  x: S,
532
- y: $.current.y
532
+ y: j.current.y
533
533
  });
534
- const k = S - H.current.x, z = u - H.current.y, tt = u - $.current.y, nt = S - $.current.x;
535
- if (!q && Math.sqrt(k * k + z * z) >= Rt && (V(!0), p === null)) {
534
+ const H = S - L.current.x, V = u - L.current.y, tt = u - j.current.y, nt = S - j.current.x;
535
+ if (!U && Math.sqrt(H * H + V * V) >= Rt && ($(!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
- const st = Math.abs(k), ot = Math.abs(z);
538
+ const st = Math.abs(H), ot = Math.abs(V);
539
539
  x(st > ot ? "horizontal" : "vertical");
540
540
  }
541
541
  }
542
- let A;
542
+ let q;
543
543
  if (!ce.current)
544
- p === "vertical" ? z > 0 ? A = "down" : z < 0 && (A = "up") : p === "horizontal" ? k > 0 ? A = "right" : k < 0 && (A = "left") : Math.abs(k) >= Math.abs(z) ? A = k > 0 ? "right" : "left" : A = z > 0 ? "down" : "up", A && t.includes(A) && (ce.current = A, he.current = Ie(A, k, z), D(A));
544
+ p === "vertical" ? V > 0 ? q = "down" : V < 0 && (q = "up") : p === "horizontal" ? H > 0 ? q = "right" : H < 0 && (q = "left") : Math.abs(H) >= Math.abs(V) ? q = H > 0 ? "right" : "left" : q = V > 0 ? "down" : "up", q && t.includes(q) && (ce.current = q, he.current = ke(q, H, V), D(q));
545
545
  else {
546
- const xe = ce.current, de = Ie(xe, nt, tt);
546
+ const xe = ce.current, de = ke(xe, nt, tt);
547
547
  de > ie ? (ue.current = !1, D(xe)) : !(t.includes("left") && t.includes("right")) && !(t.includes("up") && t.includes("down")) && he.current - de >= Et && (ue.current = !0);
548
548
  }
549
- const fe = Ke(k, z);
549
+ const fe = Xe(H, V);
550
550
  let we = Z.current.x, ye = Z.current.y;
551
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")) && (ye += fe.y)), J({
552
552
  x: we,
553
553
  y: ye
554
554
  });
555
555
  }
556
- function Ue(c) {
557
- if (!I)
556
+ function We(c) {
557
+ if (!k)
558
558
  return;
559
- if (L(!1), V(!1), x(null), T.current?.releasePointerCapture(c.pointerId), ue.current) {
559
+ if (I(!1), $(!1), x(null), T.current?.releasePointerCapture(c.pointerId), ue.current) {
560
560
  J({
561
561
  x: n.x,
562
562
  y: n.y
@@ -566,8 +566,8 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
566
566
  let u = !1;
567
567
  const S = O.x - n.x, P = O.y - n.y;
568
568
  let B;
569
- for (const k of t) {
570
- switch (k) {
569
+ for (const H of t) {
570
+ switch (H) {
571
571
  case "right":
572
572
  S > ie && (u = !0, B = "right");
573
573
  break;
@@ -584,12 +584,12 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
584
584
  if (u)
585
585
  break;
586
586
  }
587
- u ? (D(B), K(!0), R(s.id)) : (J({
587
+ u ? (D(B), X(!0), R(s.id)) : (J({
588
588
  x: n.x,
589
589
  y: n.y
590
590
  }), D(void 0));
591
591
  }
592
- function qe(c) {
592
+ function Ue(c) {
593
593
  if (c.key === "Escape") {
594
594
  if (!T.current || !re(T.current, pe(ne(T.current))))
595
595
  return;
@@ -612,17 +612,17 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
612
612
  };
613
613
  }, [l]);
614
614
  function Je() {
615
- if (!I && O.x === n.x && O.y === n.y && !G)
615
+ if (!k && O.x === n.x && O.y === n.y && !z)
616
616
  return {
617
617
  [ee.swipeMovementX]: "0px",
618
618
  [ee.swipeMovementY]: "0px"
619
619
  };
620
620
  const c = O.x - n.x, u = O.y - n.y;
621
621
  return {
622
- transition: I ? "none" : void 0,
622
+ transition: k ? "none" : void 0,
623
623
  // While swiping, freeze the element at its current visual transform so it doesn't snap to the
624
624
  // end position.
625
- transform: I ? `translateX(${O.x}px) translateY(${O.y}px) scale(${n.scale})` : void 0,
625
+ transform: k ? `translateX(${O.x}px) translateY(${O.y}px) scale(${n.scale})` : void 0,
626
626
  [ee.swipeMovementX]: `${c}px`,
627
627
  [ee.swipeMovementY]: `${u}px`
628
628
  };
@@ -632,17 +632,17 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
632
632
  tabIndex: 0,
633
633
  "aria-modal": !1,
634
634
  "aria-labelledby": w,
635
- "aria-describedby": v,
635
+ "aria-describedby": _,
636
636
  "aria-hidden": Me && !o ? !0 : void 0,
637
- onPointerDown: l ? We : void 0,
638
- onPointerMove: l ? je : void 0,
639
- onPointerUp: l ? Ue : void 0,
640
- onKeyDown: qe,
637
+ onPointerDown: l ? Ge : void 0,
638
+ onPointerMove: l ? Ke : void 0,
639
+ onPointerUp: l ? We : void 0,
640
+ onKeyDown: Ue,
641
641
  inert: gt(s.limited),
642
642
  style: {
643
643
  ...Je(),
644
- [ee.index]: s.transitionStatus === "ending" ? ve : _e,
645
- [ee.offsetY]: `${Ge}px`,
644
+ [ee.index]: s.transitionStatus === "ending" ? _e : ve,
645
+ [ee.offsetY]: `${ze}px`,
646
646
  [ee.height]: s.height ? `${s.height}px` : void 0
647
647
  }
648
648
  }, te = e.useMemo(() => ({
@@ -650,15 +650,15 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
650
650
  toast: s,
651
651
  titleId: w,
652
652
  setTitleId: i,
653
- descriptionId: v,
653
+ descriptionId: _,
654
654
  setDescriptionId: r,
655
- swiping: I,
656
- swipeDirection: j,
655
+ swiping: k,
656
+ swipeDirection: K,
657
657
  recalculateHeight: le,
658
- index: ve,
659
- visibleIndex: _e,
658
+ index: _e,
659
+ visibleIndex: ve,
660
660
  expanded: C
661
- }), [s, w, v, I, j, le, ve, _e, C]), Ze = e.useMemo(() => ({
661
+ }), [s, w, _, k, K, le, _e, ve, C]), Ze = e.useMemo(() => ({
662
662
  transitionStatus: s.transitionStatus,
663
663
  expanded: C,
664
664
  limited: s.limited || !1,
@@ -676,7 +676,7 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, h) {
676
676
  children: et
677
677
  });
678
678
  });
679
- process.env.NODE_ENV !== "production" && ($e.displayName = "ToastRoot");
679
+ process.env.NODE_ENV !== "production" && (je.displayName = "ToastRoot");
680
680
  const Be = /* @__PURE__ */ e.forwardRef(function(d, h) {
681
681
  const {
682
682
  render: s,
@@ -700,18 +700,18 @@ const Be = /* @__PURE__ */ e.forwardRef(function(d, h) {
700
700
  b.disconnect(), N.disconnect();
701
701
  };
702
702
  }, [g]);
703
- const l = y > 0, _ = e.useMemo(() => ({
703
+ const l = y > 0, v = e.useMemo(() => ({
704
704
  expanded: a,
705
705
  behind: l
706
706
  }), [a, l]);
707
707
  return oe("div", d, {
708
708
  ref: [h, t],
709
- state: _,
709
+ state: v,
710
710
  props: M
711
711
  });
712
712
  });
713
713
  process.env.NODE_ENV !== "production" && (Be.displayName = "ToastContent");
714
- const Ae = /* @__PURE__ */ e.forwardRef(function(d, h) {
714
+ const qe = /* @__PURE__ */ e.forwardRef(function(d, h) {
715
715
  const {
716
716
  render: s,
717
717
  className: F,
@@ -720,15 +720,15 @@ const Ae = /* @__PURE__ */ e.forwardRef(function(d, h) {
720
720
  ...a
721
721
  } = d, {
722
722
  toast: g
723
- } = se(), t = y ?? g.description, l = !!t, _ = He(M), {
723
+ } = se(), t = y ?? g.description, l = !!t, v = Le(M), {
724
724
  setDescriptionId: o
725
725
  } = se();
726
726
  me(() => {
727
727
  if (l)
728
- return o(_), () => {
728
+ return o(v), () => {
729
729
  o(void 0);
730
730
  };
731
- }, [l, _, o]);
731
+ }, [l, v, o]);
732
732
  const R = e.useMemo(() => ({
733
733
  type: g.type
734
734
  }), [g.type]), b = oe("p", d, {
@@ -736,14 +736,14 @@ const Ae = /* @__PURE__ */ e.forwardRef(function(d, h) {
736
736
  state: R,
737
737
  props: {
738
738
  ...a,
739
- id: _,
739
+ id: v,
740
740
  children: t
741
741
  }
742
742
  });
743
743
  return l ? b : null;
744
744
  });
745
- process.env.NODE_ENV !== "production" && (Ae.displayName = "ToastDescription");
746
- const Ye = /* @__PURE__ */ e.forwardRef(function(d, h) {
745
+ process.env.NODE_ENV !== "production" && (qe.displayName = "ToastDescription");
746
+ const Ae = /* @__PURE__ */ e.forwardRef(function(d, h) {
747
747
  const {
748
748
  render: s,
749
749
  className: F,
@@ -752,15 +752,15 @@ const Ye = /* @__PURE__ */ e.forwardRef(function(d, h) {
752
752
  ...a
753
753
  } = d, {
754
754
  toast: g
755
- } = se(), t = y ?? g.title, l = !!t, _ = He(M), {
755
+ } = se(), t = y ?? g.title, l = !!t, v = Le(M), {
756
756
  setTitleId: o
757
757
  } = se();
758
758
  me(() => {
759
759
  if (l)
760
- return o(_), () => {
760
+ return o(v), () => {
761
761
  o(void 0);
762
762
  };
763
- }, [l, _, o]);
763
+ }, [l, v, o]);
764
764
  const R = e.useMemo(() => ({
765
765
  type: g.type
766
766
  }), [g.type]), b = oe("h2", d, {
@@ -768,14 +768,14 @@ const Ye = /* @__PURE__ */ e.forwardRef(function(d, h) {
768
768
  state: R,
769
769
  props: {
770
770
  ...a,
771
- id: _,
771
+ id: v,
772
772
  children: t
773
773
  }
774
774
  });
775
775
  return l ? b : null;
776
776
  });
777
- process.env.NODE_ENV !== "production" && (Ye.displayName = "ToastTitle");
778
- const Xe = /* @__PURE__ */ e.forwardRef(function(d, h) {
777
+ process.env.NODE_ENV !== "production" && (Ae.displayName = "ToastTitle");
778
+ const Ye = /* @__PURE__ */ e.forwardRef(function(d, h) {
779
779
  const {
780
780
  render: s,
781
781
  className: F,
@@ -787,7 +787,7 @@ const Xe = /* @__PURE__ */ e.forwardRef(function(d, h) {
787
787
  expanded: t
788
788
  } = be(), {
789
789
  toast: l
790
- } = se(), [_, o] = e.useState(!1), {
790
+ } = se(), [v, o] = e.useState(!1), {
791
791
  getButtonProps: R,
792
792
  buttonRef: b
793
793
  } = yt({
@@ -800,7 +800,7 @@ const Xe = /* @__PURE__ */ e.forwardRef(function(d, h) {
800
800
  ref: [h, b],
801
801
  state: N,
802
802
  props: [{
803
- "aria-hidden": !t && !_,
803
+ "aria-hidden": !t && !v,
804
804
  onClick() {
805
805
  g(l.id);
806
806
  },
@@ -813,55 +813,55 @@ const Xe = /* @__PURE__ */ e.forwardRef(function(d, h) {
813
813
  }, a, R]
814
814
  });
815
815
  });
816
- process.env.NODE_ENV !== "production" && (Xe.displayName = "ToastClose");
817
- const St = pt, Mt = "_toast__viewport_uzvu6_1", Nt = "_toast_uzvu6_1", Pt = "_toast_variant_neutral_uzvu6_111", Ot = "_toast_variant_colorway_uzvu6_117", Ct = "_toast__content_uzvu6_123", Ft = "_toast__header_uzvu6_142", It = "_toast__header_pad_uzvu6_146", Lt = "_toast__title_uzvu6_150", Ht = "_toast__description_uzvu6_154", kt = "_toast__close_uzvu6_158", W = {
816
+ process.env.NODE_ENV !== "production" && (Ye.displayName = "ToastClose");
817
+ const St = pt, Mt = "_toast__viewport_fjqk1_1", Nt = "_toast_fjqk1_1", Pt = "_toast_variant_neutral_fjqk1_111", Ot = "_toast_variant_colorway_fjqk1_117", Ct = "_toast__content_fjqk1_123", Ft = "_toast__header_fjqk1_142", kt = "_toast__header_pad_fjqk1_146", It = "_toast__title_fjqk1_150", Lt = "_toast__description_fjqk1_154", Ht = "_toast__close_fjqk1_158", G = {
818
818
  toast__viewport: Mt,
819
819
  toast: Nt,
820
820
  toast_variant_neutral: Pt,
821
821
  toast_variant_colorway: Ot,
822
822
  toast__content: Ct,
823
823
  toast__header: Ft,
824
- toast__header_pad: It,
825
- toast__title: Lt,
826
- toast__description: Ht,
827
- toast__close: kt
828
- }, ln = ke, Le = {
824
+ toast__header_pad: kt,
825
+ toast__title: It,
826
+ toast__description: Lt,
827
+ toast__close: Ht
828
+ }, ln = He, Ie = {
829
829
  info: "blue",
830
830
  error: "red",
831
831
  warning: "yellow",
832
832
  success: "green"
833
833
  };
834
834
  function fn() {
835
- return /* @__PURE__ */ E(St, { children: /* @__PURE__ */ E(Ve, { className: W.toast__viewport, children: /* @__PURE__ */ E(zt, {}) }) });
835
+ return /* @__PURE__ */ E(St, { children: /* @__PURE__ */ E($e, { className: G.toast__viewport, children: /* @__PURE__ */ E(Vt, {}) }) });
836
836
  }
837
- function zt() {
837
+ function Vt() {
838
838
  return dt().toasts.map((d) => {
839
- const h = d.type && d.type in Le ? Le[d.type] : void 0;
839
+ const h = d.type && d.type in Ie ? Ie[d.type] : void 0;
840
840
  return /* @__PURE__ */ E(
841
- $e,
841
+ je,
842
842
  {
843
843
  toast: d,
844
844
  className: Ne(
845
- W.toast,
846
- h ? W.toast_variant_colorway : W.toast_variant_neutral
845
+ G.toast,
846
+ h ? G.toast_variant_colorway : G.toast_variant_neutral
847
847
  ),
848
848
  render: /* @__PURE__ */ E(ut, { background: "default", color: h }),
849
849
  children: /* @__PURE__ */ ae(
850
850
  Pe,
851
851
  {
852
852
  render: /* @__PURE__ */ E(Be, {}),
853
- className: W.toast__content,
853
+ className: G.toast__content,
854
854
  children: [
855
855
  /* @__PURE__ */ ae(
856
856
  Pe,
857
857
  {
858
858
  className: Ne(
859
- W.toast__header,
860
- !d.title && W.toast__header_pad
859
+ G.toast__header,
860
+ !d.title && G.toast__header_pad
861
861
  ),
862
862
  children: [
863
863
  /* @__PURE__ */ E(
864
- Ye,
864
+ Ae,
865
865
  {
866
866
  render: /* @__PURE__ */ E(
867
867
  at,
@@ -869,23 +869,23 @@ function zt() {
869
869
  level: 2,
870
870
  size: "lg",
871
871
  color: "inherit",
872
- className: W.toast__title
872
+ className: G.toast__title
873
873
  }
874
874
  )
875
875
  }
876
876
  ),
877
877
  /* @__PURE__ */ E(
878
- Ae,
878
+ qe,
879
879
  {
880
880
  render: /* @__PURE__ */ E(lt, { multiline: !0, color: h ? "inherit" : "dimmer" }),
881
- className: W.toast__description
881
+ className: G.toast__description
882
882
  }
883
883
  )
884
884
  ]
885
885
  }
886
886
  ),
887
887
  /* @__PURE__ */ E(
888
- Xe,
888
+ Ye,
889
889
  {
890
890
  render: /* @__PURE__ */ E(
891
891
  ct,
@@ -894,7 +894,7 @@ function zt() {
894
894
  icon: "close-line",
895
895
  size: "sm",
896
896
  alt: "Close",
897
- className: W.toast__close
897
+ className: G.toast__close
898
898
  }
899
899
  )
900
900
  }
package/dist/toast.css CHANGED
@@ -1 +1 @@
1
- ._toast__viewport_uzvu6_1{position:fixed;right:var(--space-8);bottom:var(--space-8);z-index:49;margin:0 auto;isolation:isolate;width:var(--space-256)}@media(min-width:512px){._toast__viewport_uzvu6_1{right:var(--space-16);bottom:var(--space-16)}}._toast_uzvu6_1{--toast-custom-gap: var(--space-12);--toast-custom-peek: var(--space-12);--toast-custom-scale: max(0, 1 - (var(--toast-index) * .1)) ;--toast-custom-shrink: calc(1 - var(--toast-custom-scale));--toast-custom-height: var(--toast-frontmost-height, var(--toast-height));--toast-custom-offset-y: calc( var(--toast-offset-y) * -1 + (var(--toast-index) * var(--toast-custom-gap) * -1) + var(--toast-swipe-movement-y) );display:flex;position:absolute;right:0;bottom:0;left:auto;flex-direction:row;align-items:center;gap:var(--space-8);transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) - (var(--toast-index) * var(--toast-custom-peek)) - (var(--toast-custom-shrink) * var(--toast-custom-height)))) scale(var(--toast-custom-scale));transform-origin:bottom center;z-index:calc(1000 - var(--toast-index));transition:transform .6s cubic-bezier(.22,1,.36,1),opacity .6s,height var(--transition-duration-snappy);cursor:default;box-sizing:border-box;margin:0 0 0 auto;border-width:1px;border-style:solid;border-radius:var(--border-radius-default);background-clip:padding-box;width:100%;height:var(--toast-custom-height);-webkit-user-select:none;-moz-user-select:none;user-select:none}._toast_uzvu6_1[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--toast-custom-offset-y));height:var(--toast-height)}._toast_uzvu6_1[data-starting-style],._toast_uzvu6_1[data-ending-style]{transform:translateY(150%)}._toast_uzvu6_1[data-limited],._toast_uzvu6_1[data-ending-style]{opacity:0}._toast_uzvu6_1[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 50%))}._toast_uzvu6_1[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 50%)) translateY(var(--toast-custom-offset-y))}._toast_uzvu6_1[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 50%)) translateY(var(--toast-custom-offset-y))}._toast_uzvu6_1[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 50%))}._toast_uzvu6_1:after{display:block;position:absolute;top:100%;left:0;width:100%;height:calc(var(--toast-custom-gap) + 1px);content:""}._toast_variant_neutral_uzvu6_111{border-color:var(--surface-interactive-border);background:var(--surface-background);color:var(--foreground-default)}._toast_variant_colorway_uzvu6_117{border-color:var(--view-colorway-dimmer);background:var(--view-colorway-dimmest);color:var(--view-colorway-strongest)}._toast__content_uzvu6_123{position:relative;flex-grow:1;flex-shrink:1;gap:var(--space-8);transition:opacity var(--transition-duration-snappy) var(--transition-timing-function-snappy);padding:var(--space-12);overflow:hidden}._toast__content_uzvu6_123[data-behind]{opacity:0}._toast__content_uzvu6_123[data-expanded]{opacity:1}._toast__header_uzvu6_142{gap:var(--space-4)}._toast__header_pad_uzvu6_146{padding-right:var(--space-24)}._toast__title_uzvu6_150,._toast__description_uzvu6_154{flex:1 1 auto}._toast__close_uzvu6_158{position:absolute;top:var(--space-12);right:var(--space-12)}
1
+ ._toast__viewport_fjqk1_1{position:fixed;right:var(--space-8);bottom:var(--space-8);z-index:49;margin:0 auto;isolation:isolate;width:var(--space-256)}@media(min-width:512px){._toast__viewport_fjqk1_1{right:var(--space-16);bottom:var(--space-16)}}._toast_fjqk1_1{--toast-custom-gap: var(--space-12);--toast-custom-peek: var(--space-12);--toast-custom-scale: max(0, 1 - (var(--toast-index) * .1)) ;--toast-custom-shrink: calc(1 - var(--toast-custom-scale));--toast-custom-height: var(--toast-frontmost-height, var(--toast-height));--toast-custom-offset-y: calc( var(--toast-offset-y) * -1 + (var(--toast-index) * var(--toast-custom-gap) * -1) + var(--toast-swipe-movement-y) );display:flex;position:absolute;right:0;bottom:0;left:auto;flex-direction:row;align-items:center;gap:var(--space-8);transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) - (var(--toast-index) * var(--toast-custom-peek)) - (var(--toast-custom-shrink) * var(--toast-custom-height)))) scale(var(--toast-custom-scale));transform-origin:bottom center;z-index:calc(1000 - var(--toast-index));transition:transform .6s cubic-bezier(.22,1,.36,1),opacity .6s,height var(--transition-duration-snappy);cursor:default;box-sizing:border-box;margin:0 0 0 auto;border-width:1px;border-style:solid;border-radius:var(--border-radius-default);background-clip:padding-box;width:100%;height:var(--toast-custom-height);-webkit-user-select:none;-moz-user-select:none;user-select:none}._toast_fjqk1_1[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--toast-custom-offset-y));height:var(--toast-height)}._toast_fjqk1_1[data-starting-style],._toast_fjqk1_1[data-ending-style]{transform:translateY(150%)}._toast_fjqk1_1[data-limited],._toast_fjqk1_1[data-ending-style]{opacity:0}._toast_fjqk1_1[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 50%))}._toast_fjqk1_1[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 50%)) translateY(var(--toast-custom-offset-y))}._toast_fjqk1_1[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 50%)) translateY(var(--toast-custom-offset-y))}._toast_fjqk1_1[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 50%))}._toast_fjqk1_1:after{display:block;position:absolute;top:100%;left:0;width:100%;height:calc(var(--toast-custom-gap) + 1px);content:""}._toast_variant_neutral_fjqk1_111{border-color:var(--surface-interactive-border);background:var(--surface-background);color:var(--foreground-default)}._toast_variant_colorway_fjqk1_117{border-color:var(--view-colorway-dimmer);background:var(--view-colorway-dimmest);color:var(--view-colorway-strongest)}._toast__content_fjqk1_123{position:relative;flex-grow:1;flex-shrink:1;gap:var(--space-8);transition:opacity var(--transition-duration-snappy) var(--transition-timing-function-snappy);padding:var(--space-12);overflow:hidden}._toast__content_fjqk1_123[data-behind]{opacity:0}._toast__content_fjqk1_123[data-expanded]{opacity:1}._toast__header_fjqk1_142{gap:var(--space-4)}._toast__header_pad_fjqk1_146{padding-right:var(--space-28)}._toast__title_fjqk1_150,._toast__description_fjqk1_154{flex:1 1 auto}._toast__close_fjqk1_158{position:absolute;top:var(--space-12);right:var(--space-12)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koide-labs/ui",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {
@@ -29,23 +29,6 @@
29
29
  "sideEffects": [
30
30
  "**/*.css"
31
31
  ],
32
- "packageManager": "pnpm@10.19.0",
33
- "scripts": {
34
- "dev": "vite",
35
- "build": "npm-run-all build:icons build:vite",
36
- "build:icons": "tsx ./scripts/build-icon-types.ts",
37
- "build:vite": "tsc -b && vite build",
38
- "preview": "vite preview",
39
- "prepare": "husky",
40
- "typecheck": "tsc -b --noEmit",
41
- "lint": "npm-run-all --parallel lint:*",
42
- "lint:ts": "eslint .",
43
- "lint:style": "stylelint src/**/*.module.css",
44
- "format": "prettier --write .",
45
- "storybook": "storybook dev -p 6006",
46
- "build-storybook": "storybook build",
47
- "prepublishOnly": "pnpm run build"
48
- },
49
32
  "dependencies": {
50
33
  "@base-ui/react": "^1.0.0",
51
34
  "@npham-dev/cmdk": "^0.0.0",
@@ -116,5 +99,19 @@
116
99
  "vite-plugin-lib-inject-css": "^2.2.2",
117
100
  "vite-tsconfig-paths": "^6.0.3",
118
101
  "vitest": "^4.0.16"
102
+ },
103
+ "scripts": {
104
+ "dev": "vite",
105
+ "build": "npm-run-all build:icons build:vite",
106
+ "build:icons": "tsx ./scripts/build-icon-types.ts",
107
+ "build:vite": "tsc -b && vite build",
108
+ "preview": "vite preview",
109
+ "typecheck": "tsc -b --noEmit",
110
+ "lint": "npm-run-all --parallel lint:*",
111
+ "lint:ts": "eslint .",
112
+ "lint:style": "stylelint src/**/*.module.css",
113
+ "format": "prettier --write .",
114
+ "storybook": "storybook dev -p 6006",
115
+ "build-storybook": "storybook build"
119
116
  }
120
- }
117
+ }