@koide-labs/ui 0.0.11 → 0.0.12

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.
@@ -8,16 +8,13 @@ function p({ external: e, render: r, ...n }) {
8
8
  return o({
9
9
  defaultTagName: "a",
10
10
  render: r,
11
- props: t(
12
- {
13
- className: s.anchor,
14
- ...e ? {
15
- target: "_blank",
16
- rel: "noreferrer"
17
- } : {}
18
- },
19
- n
20
- )
11
+ props: t(n, {
12
+ className: s.anchor,
13
+ ...e ? {
14
+ target: "_blank",
15
+ rel: "noreferrer"
16
+ } : {}
17
+ })
21
18
  });
22
19
  }
23
20
  export {
@@ -13,4 +13,4 @@ export interface BadgeProps extends Omit<useRender.ComponentProps<"span">, "chil
13
13
  /** Tagline of badge. */
14
14
  tagline?: string;
15
15
  }
16
- export declare function Badge({ icon, name, color, shiny, tagline, render, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function Badge({ icon, name, color, shiny, tagline, render, className, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -1,41 +1,43 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as c, Fragment as g } from "react/jsx-runtime";
3
- import { c as p } from "../../clsx-OuTLNxxd.js";
4
- import { Icon as f } from "../icon/index.js";
5
- import { Text as u } from "../text/index.js";
6
- import { Tooltip as _ } from "../tooltip/index.js";
7
- import { View as b } from "../view/index.js";
8
- import { u as h } from "../../useRender-CLx7dR_1.js";
9
- import { m as x } from "../../useRenderElement-DwToLA61.js";
10
- import '../../index8.css';const y = "_badge_sf2gl_1", T = "_badge_shiny_sf2gl_16", t = {
11
- badge: y,
12
- badge_shiny: T
2
+ import { jsx as e, jsxs as g, Fragment as p } from "react/jsx-runtime";
3
+ import { c as f } from "../../clsx-OuTLNxxd.js";
4
+ import { Icon as u } from "../icon/index.js";
5
+ import { Text as _ } from "../text/index.js";
6
+ import { Tooltip as b } from "../tooltip/index.js";
7
+ import { View as h } from "../view/index.js";
8
+ import { u as x } from "../../useRender-CLx7dR_1.js";
9
+ import { m as y } from "../../useRenderElement-DwToLA61.js";
10
+ import '../../index8.css';const T = "_badge_sf2gl_1", j = "_badge_shiny_sf2gl_16", t = {
11
+ badge: T,
12
+ badge_shiny: j
13
13
  };
14
- function R({
14
+ function V({
15
15
  icon: r,
16
16
  name: m,
17
17
  color: n,
18
18
  shiny: i,
19
19
  tagline: s,
20
20
  render: a,
21
- ...l
21
+ className: l,
22
+ ...d
22
23
  }) {
23
- const d = h({
24
+ const c = x({
24
25
  defaultTagName: "span",
25
26
  render: a,
26
- props: x(
27
- {
28
- className: p(t.badge, i && t.badge_shiny),
29
- children: /* @__PURE__ */ c(g, { children: [
30
- r ? /* @__PURE__ */ e(f, { name: r }) : null,
31
- m
32
- ] })
33
- },
34
- l
35
- )
36
- }), o = /* @__PURE__ */ e(b, { color: n, children: d });
37
- return s ? /* @__PURE__ */ e(_, { trigger: o, children: /* @__PURE__ */ e(u, { size: "sm", multiline: !0, children: s }) }) : o;
27
+ props: y(d, {
28
+ className: f(
29
+ t.badge,
30
+ i && t.badge_shiny,
31
+ l
32
+ ),
33
+ children: /* @__PURE__ */ g(p, { children: [
34
+ r ? /* @__PURE__ */ e(u, { name: r }) : null,
35
+ m
36
+ ] })
37
+ })
38
+ }), o = /* @__PURE__ */ e(h, { color: n, children: c });
39
+ return s ? /* @__PURE__ */ e(b, { trigger: o, children: /* @__PURE__ */ e(_, { size: "sm", multiline: !0, children: s }) }) : o;
38
40
  }
39
41
  export {
40
- R as Badge
42
+ V as Badge
41
43
  };
@@ -24,17 +24,11 @@ function R({
24
24
  defaultTagName: "div",
25
25
  render: o,
26
26
  ref: l,
27
- props: _(
28
- {
29
- "aria-hidden": !s,
30
- className: p(
31
- t.collapse,
32
- s && t.collapse_expand
33
- ),
34
- style: { "--collapse-height": `${n}px` }
35
- },
36
- a
37
- )
27
+ props: _(a, {
28
+ "aria-hidden": !s,
29
+ className: p(t.collapse, s && t.collapse_expand),
30
+ style: { "--collapse-height": `${n}px` }
31
+ })
38
32
  });
39
33
  }
40
34
  export {
@@ -24,12 +24,7 @@ function _({
24
24
  const l = i(s), a = d(e || l), u = c({
25
25
  defaultTagName: `h${a}`,
26
26
  render: o,
27
- props: g(
28
- {
29
- className: v.heading
30
- },
31
- r
32
- )
27
+ props: g(r, { className: v.heading })
33
28
  });
34
29
  return /* @__PURE__ */ m(
35
30
  x,
@@ -29,22 +29,19 @@ function P({
29
29
  return m({
30
30
  defaultTagName: "span",
31
31
  render: x,
32
- props: r(
33
- {
34
- className: i(
35
- c.view,
36
- t.text,
37
- t[`text_color_${l}`],
38
- t[`text_size_${s}`],
39
- !e && t["text_clip-line"],
40
- !e && _ > 1 && t["text_clamp-lines"]
41
- ),
42
- style: {
43
- "--text-max-lines": Math.max(_, 1)
44
- }
45
- },
46
- o
47
- )
32
+ props: r(o, {
33
+ className: i(
34
+ c.view,
35
+ t.text,
36
+ t[`text_color_${l}`],
37
+ t[`text_size_${s}`],
38
+ !e && t["text_clip-line"],
39
+ !e && _ > 1 && t["text_clamp-lines"]
40
+ ),
41
+ style: {
42
+ "--text-max-lines": Math.max(_, 1)
43
+ }
44
+ })
48
45
  });
49
46
  }
50
47
  export {
@@ -3,13 +3,13 @@ import { c as rt } from "../../clsx-OuTLNxxd.js";
3
3
  import { Button as st } from "../button/index.js";
4
4
  import { Heading as ot } from "../heading/index.js";
5
5
  import { IconButton as it } from "../icon-button/index.js";
6
- import { Surface as at } from "../surface/index.js";
7
- import { Text as ct } from "../text/index.js";
6
+ import { Surface as ct } from "../surface/index.js";
7
+ import { Text as at } from "../text/index.js";
8
8
  import { View as xe } from "../view/index.js";
9
9
  import { T as ut, a as Re, u as lt } 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 j } from "../../useStableCallback-CkTrVkNX.js";
13
13
  import { T as Pe } from "../../useTimeout-CflX-kz3.js";
14
14
  import { h as de, f as se, m as Ee, e as be } from "../../element-CZEOj04G.js";
15
15
  import { F as ft } from "../../FloatingPortalLite-DVyq6YhV.js";
@@ -17,13 +17,13 @@ import { v as dt } from "../../visuallyHidden-CpJ-mhai.js";
17
17
  import { F as Te } from "../../FloatingPortal-tWyuKRSN.js";
18
18
  import { u as ie } from "../../useRenderElement-DwToLA61.js";
19
19
  import { d as Oe } from "../../floating-ui.utils.dom-C7FS5id0.js";
20
- import * as mt from "react-dom";
21
- import { i as pt } from "../../inertValue-BCYGsdmf.js";
20
+ import * as pt from "react-dom";
21
+ import { i as mt } from "../../inertValue-BCYGsdmf.js";
22
22
  import { u as Se } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
23
23
  import { f as ht } from "../../formatErrorMessage-BqPuTBN-.js";
24
24
  import { a as gt, t as vt } from "../../useOpenChangeComplete-Dse9kY9E.js";
25
- import { u as _t } from "../../useId-C5kyn6tA.js";
26
- import { u as wt } from "../../useButton-DfIwsdb8.js";
25
+ import { u as wt } from "../../useId-C5kyn6tA.js";
26
+ import { u as _t } from "../../useButton-DfIwsdb8.js";
27
27
  import '../../toast.css';let Ce = 0;
28
28
  function yt(f) {
29
29
  return Ce += 1, `${f}-${Math.random().toString(36).slice(2, 6)}-${Ce}`;
@@ -41,32 +41,32 @@ function De(f, d) {
41
41
  }
42
42
  return f;
43
43
  }
44
- const Ie = function(d) {
44
+ const Le = function(d) {
45
45
  const {
46
46
  children: v,
47
47
  timeout: s = 5e3,
48
- limit: z = 3,
48
+ limit: V = 3,
49
49
  toastManager: P
50
- } = d, [w, c] = e.useState([]), [_, r] = e.useState(!1), [p, y] = e.useState(!1), [u, R] = e.useState(null);
51
- w.length === 0 && (_ && r(!1), p && y(!1));
52
- const S = _ || p, M = e.useRef(/* @__PURE__ */ new Map()), Y = e.useRef(null), C = e.useRef(!0), X = e.useRef(!1);
53
- function j(t) {
54
- const m = de(ne(Y.current));
55
- if (!Y.current || !se(Y.current, m) || !Ee(m))
50
+ } = d, [_, a] = e.useState([]), [w, r] = e.useState(!1), [m, y] = e.useState(!1), [u, R] = e.useState(null);
51
+ _.length === 0 && (w && r(!1), m && y(!1));
52
+ const S = w || m, M = e.useRef(/* @__PURE__ */ new Map()), z = e.useRef(null), C = e.useRef(!0), X = e.useRef(!1);
53
+ function W(t) {
54
+ const p = de(ne(z.current));
55
+ if (!z.current || !se(z.current, p) || !Ee(p))
56
56
  return;
57
- const g = w.findIndex((n) => n.id === t);
57
+ const g = _.findIndex((n) => n.id === t);
58
58
  let o = null, h = g + 1;
59
- for (; h < w.length; ) {
60
- if (w[h].transitionStatus !== "ending") {
61
- o = w[h];
59
+ for (; h < _.length; ) {
60
+ if (_[h].transitionStatus !== "ending") {
61
+ o = _[h];
62
62
  break;
63
63
  }
64
64
  h += 1;
65
65
  }
66
66
  if (!o)
67
67
  for (h = g - 1; h >= 0; ) {
68
- if (w[h].transitionStatus !== "ending") {
69
- o = w[h];
68
+ if (_[h].transitionStatus !== "ending") {
69
+ o = _[h];
70
70
  break;
71
71
  }
72
72
  h -= 1;
@@ -75,22 +75,22 @@ const Ie = function(d) {
75
75
  preventScroll: !0
76
76
  });
77
77
  }
78
- const D = U(() => {
78
+ const D = j(() => {
79
79
  X.current || (X.current = !0, M.current.forEach((t) => {
80
80
  if (t.timeout) {
81
81
  t.timeout.clear();
82
- const m = Date.now() - t.start, g = t.delay - m;
82
+ const p = Date.now() - t.start, g = t.delay - p;
83
83
  t.remaining = g > 0 ? g : 0;
84
84
  }
85
85
  }));
86
- }), F = U(() => {
87
- X.current && (X.current = !1, M.current.forEach((t, m) => {
86
+ }), F = j(() => {
87
+ X.current && (X.current = !1, M.current.forEach((t, p) => {
88
88
  t.remaining = t.remaining > 0 ? t.remaining : t.delay, t.timeout ??= Pe.create(), t.timeout.start(t.remaining, () => {
89
- M.current.delete(m), t.callback();
89
+ M.current.delete(p), t.callback();
90
90
  }), t.start = Date.now();
91
91
  }));
92
- }), k = U((t) => {
93
- c((o) => {
92
+ }), I = j((t) => {
93
+ a((o) => {
94
94
  const h = o.map((l) => l.id === t ? {
95
95
  ...l,
96
96
  transitionStatus: "ending",
@@ -99,43 +99,43 @@ const Ie = function(d) {
99
99
  return h.map((l) => {
100
100
  if (l.transitionStatus === "ending")
101
101
  return l;
102
- const x = n.indexOf(l) >= z;
102
+ const x = n.indexOf(l) >= V;
103
103
  return {
104
104
  ...l,
105
105
  limited: x
106
106
  };
107
107
  });
108
108
  });
109
- const m = M.current.get(t);
110
- m && m.timeout && (m.timeout.clear(), M.current.delete(t)), w.find((o) => o.id === t)?.onClose?.(), j(t), w.length === 1 && (r(!1), y(!1));
111
- }), q = U((t) => {
112
- c((g) => g.filter((o) => o.id !== t)), w.find((g) => g.id === t)?.onRemove?.();
113
- }), V = U((t, m, g) => {
114
- const o = Date.now(), h = C.current && !_ && !p, n = h ? Pe.create() : void 0;
115
- n?.start(m, () => {
109
+ const p = M.current.get(t);
110
+ p && p.timeout && (p.timeout.clear(), M.current.delete(t)), _.find((o) => o.id === t)?.onClose?.(), W(t), _.length === 1 && (r(!1), y(!1));
111
+ }), q = j((t) => {
112
+ a((g) => g.filter((o) => o.id !== t)), _.find((g) => g.id === t)?.onRemove?.();
113
+ }), $ = j((t, p, g) => {
114
+ const o = Date.now(), h = C.current && !w && !m, n = h ? Pe.create() : void 0;
115
+ n?.start(p, () => {
116
116
  M.current.delete(t), g();
117
117
  }), M.current.set(t, {
118
118
  timeout: n,
119
119
  start: h ? o : 0,
120
- delay: m,
121
- remaining: m,
120
+ delay: p,
121
+ remaining: p,
122
122
  callback: g
123
123
  });
124
- }), G = U((t) => {
125
- const m = t.id || yt("toast"), g = {
124
+ }), G = j((t) => {
125
+ const p = t.id || yt("toast"), g = {
126
126
  ...t,
127
- id: m,
127
+ id: p,
128
128
  transitionStatus: "starting"
129
129
  };
130
- c((h) => {
130
+ a((h) => {
131
131
  const n = [g, ...h], l = n.filter((x) => x.transitionStatus !== "ending");
132
- if (l.length > z) {
133
- const x = l.length - z, T = l.slice(-x);
134
- return n.map((I) => T.some((Z) => Z.id === I.id) ? {
135
- ...I,
132
+ if (l.length > V) {
133
+ const x = l.length - V, T = l.slice(-x);
134
+ return n.map((L) => T.some((Z) => Z.id === L.id) ? {
135
+ ...L,
136
136
  limited: !0
137
137
  } : {
138
- ...I,
138
+ ...L,
139
139
  limited: !1
140
140
  });
141
141
  }
@@ -145,34 +145,34 @@ const Ie = function(d) {
145
145
  }));
146
146
  });
147
147
  const o = g.timeout ?? s;
148
- return g.type !== "loading" && o > 0 && V(m, o, () => k(m)), (_ || p || !C.current) && D(), m;
149
- }), K = U((t, m) => {
150
- c((g) => g.map((o) => o.id === t ? {
148
+ return g.type !== "loading" && o > 0 && $(p, o, () => I(p)), (w || m || !C.current) && D(), p;
149
+ }), K = j((t, p) => {
150
+ a((g) => g.map((o) => o.id === t ? {
151
151
  ...o,
152
- ...m
152
+ ...p
153
153
  } : o));
154
- }), O = U((t, m) => {
155
- const g = De(m.loading), o = G({
154
+ }), O = j((t, p) => {
155
+ const g = De(p.loading), o = G({
156
156
  ...g,
157
157
  type: "loading"
158
158
  }), h = t.then((n) => {
159
- const l = De(m.success, n);
159
+ const l = De(p.success, n);
160
160
  K(o, {
161
161
  ...l,
162
162
  type: "success"
163
163
  });
164
164
  const x = l.timeout ?? s;
165
- return x > 0 && V(o, x, () => k(o)), (_ || p || !C.current) && D(), n;
165
+ return x > 0 && $(o, x, () => I(o)), (w || m || !C.current) && D(), n;
166
166
  }).catch((n) => {
167
- const l = De(m.error, n);
167
+ const l = De(p.error, n);
168
168
  K(o, {
169
169
  ...l,
170
170
  type: "error"
171
171
  });
172
172
  const x = l.timeout ?? s;
173
- return x > 0 && V(o, x, () => k(o)), (_ || p || !C.current) && D(), Promise.reject(n);
173
+ return x > 0 && $(o, x, () => I(o)), (w || m || !C.current) && D(), Promise.reject(n);
174
174
  });
175
- return {}.hasOwnProperty.call(m, "setPromise") && m.setPromise(h), h;
175
+ return {}.hasOwnProperty.call(p, "setPromise") && p.setPromise(h), h;
176
176
  });
177
177
  e.useEffect(function() {
178
178
  return P ? P[" subscribe"](({
@@ -180,19 +180,19 @@ const Ie = function(d) {
180
180
  options: o
181
181
  }) => {
182
182
  const h = o.id;
183
- g === "promise" && o.promise ? O(o.promise, o) : g === "update" && h ? K(h, o) : g === "close" && h ? k(h) : G(o);
183
+ g === "promise" && o.promise ? O(o.promise, o) : g === "update" && h ? K(h, o) : g === "close" && h ? I(h) : G(o);
184
184
  }) : void 0;
185
- }, [G, K, V, s, P, O, k]);
185
+ }, [G, K, $, s, P, O, I]);
186
186
  const J = e.useMemo(() => ({
187
- toasts: w,
188
- setToasts: c,
189
- hovering: _,
187
+ toasts: _,
188
+ setToasts: a,
189
+ hovering: w,
190
190
  setHovering: r,
191
- focused: p,
191
+ focused: m,
192
192
  setFocused: y,
193
193
  expanded: S,
194
194
  add: G,
195
- close: k,
195
+ close: I,
196
196
  remove: q,
197
197
  update: K,
198
198
  promise: O,
@@ -200,64 +200,64 @@ const Ie = function(d) {
200
200
  resumeTimers: F,
201
201
  prevFocusElement: u,
202
202
  setPrevFocusElement: R,
203
- viewportRef: Y,
204
- scheduleTimer: V,
203
+ viewportRef: z,
204
+ scheduleTimer: $,
205
205
  windowFocusedRef: C
206
- }), [G, k, p, _, S, D, u, O, q, F, V, w, K]);
206
+ }), [G, I, m, w, S, D, u, O, q, F, $, _, K]);
207
207
  return /* @__PURE__ */ E(ut.Provider, {
208
208
  value: J,
209
209
  children: v
210
210
  });
211
211
  };
212
- process.env.NODE_ENV !== "production" && (Ie.displayName = "ToastProvider");
213
- const Le = /* @__PURE__ */ e.createContext(void 0);
214
- process.env.NODE_ENV !== "production" && (Le.displayName = "ToastViewportContext");
212
+ process.env.NODE_ENV !== "production" && (Le.displayName = "ToastProvider");
213
+ const He = /* @__PURE__ */ e.createContext(void 0);
214
+ process.env.NODE_ENV !== "production" && (He.displayName = "ToastViewportContext");
215
215
  let xt = /* @__PURE__ */ (function(f) {
216
216
  return f.frontmostHeight = "--toast-frontmost-height", f;
217
217
  })({});
218
- const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
218
+ const ke = /* @__PURE__ */ e.forwardRef(function(d, v) {
219
219
  const {
220
220
  render: s,
221
- className: z,
221
+ className: V,
222
222
  children: P,
223
- ...w
223
+ ..._
224
224
  } = d, {
225
- toasts: c,
226
- pauseTimers: _,
225
+ toasts: a,
226
+ pauseTimers: w,
227
227
  resumeTimers: r,
228
- setHovering: p,
228
+ setHovering: m,
229
229
  setFocused: y,
230
230
  viewportRef: u,
231
231
  windowFocusedRef: R,
232
232
  prevFocusElement: S,
233
233
  setPrevFocusElement: M,
234
- expanded: Y,
234
+ expanded: z,
235
235
  focused: C
236
- } = Re(), X = e.useRef(!1), j = e.useRef(!1), D = c.length, F = c[0]?.height ?? 0, k = e.useMemo(() => c.some((n) => n.transitionStatus === "ending"), [c]);
236
+ } = Re(), X = e.useRef(!1), W = e.useRef(!1), D = a.length, F = a[0]?.height ?? 0, I = e.useMemo(() => a.some((n) => n.transitionStatus === "ending"), [a]);
237
237
  e.useEffect(() => {
238
238
  if (!u.current)
239
239
  return;
240
240
  function n(x) {
241
241
  D !== 0 && x.key === "F6" && x.target !== u.current && (x.preventDefault(), M(de(ne(u.current))), u.current?.focus({
242
242
  preventScroll: !0
243
- }), _(), y(!0));
243
+ }), w(), y(!0));
244
244
  }
245
245
  const l = Oe(u.current);
246
246
  return l.addEventListener("keydown", n), () => {
247
247
  l.removeEventListener("keydown", n);
248
248
  };
249
- }, [_, y, M, D, u]), e.useEffect(() => {
249
+ }, [w, y, M, D, u]), e.useEffect(() => {
250
250
  if (!u.current || !D)
251
251
  return;
252
252
  const n = Oe(u.current);
253
253
  function l(T) {
254
- T.target === n && (R.current = !1, _());
254
+ T.target === n && (R.current = !1, w());
255
255
  }
256
256
  function x(T) {
257
257
  if (T.relatedTarget || T.target === n)
258
258
  return;
259
- const I = be(T), Z = de(ne(u.current));
260
- (!se(u.current, I) || !Ee(Z)) && r(), setTimeout(() => {
259
+ const L = be(T), Z = de(ne(u.current));
260
+ (!se(u.current, L) || !Ee(Z)) && r(), setTimeout(() => {
261
261
  R.current = !0;
262
262
  });
263
263
  }
@@ -265,7 +265,7 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
265
265
  n.removeEventListener("blur", l, !0), n.removeEventListener("focus", x, !0);
266
266
  };
267
267
  }, [
268
- _,
268
+ w,
269
269
  r,
270
270
  u,
271
271
  R,
@@ -283,38 +283,38 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
283
283
  function x(T) {
284
284
  if (T.pointerType !== "touch")
285
285
  return;
286
- const I = be(T);
287
- se(n, I) || (r(), p(!1), y(!1));
286
+ const L = be(T);
287
+ se(n, L) || (r(), m(!1), y(!1));
288
288
  }
289
289
  return l.addEventListener("pointerdown", x, !0), () => {
290
290
  l.removeEventListener("pointerdown", x, !0);
291
291
  };
292
- }, [D, r, y, p, u]);
292
+ }, [D, r, y, m, u]);
293
293
  function q(n) {
294
- u.current && (X.current = !0, n.relatedTarget === u.current ? c[0]?.ref?.current?.focus() : S?.focus({
294
+ u.current && (X.current = !0, n.relatedTarget === u.current ? a[0]?.ref?.current?.focus() : S?.focus({
295
295
  preventScroll: !0
296
296
  }));
297
297
  }
298
- function V(n) {
298
+ function $(n) {
299
299
  n.key === "Tab" && n.shiftKey && n.target === u.current && (n.preventDefault(), S?.focus({
300
300
  preventScroll: !0
301
301
  }), r());
302
302
  }
303
303
  e.useEffect(() => {
304
- !R.current || k || !j.current || (r(), p(!1), j.current = !1);
305
- }, [k, r, p, R]);
304
+ !R.current || I || !W.current || (r(), m(!1), W.current = !1);
305
+ }, [I, r, m, R]);
306
306
  function G() {
307
- _(), p(!0), j.current = !1;
307
+ w(), m(!0), W.current = !1;
308
308
  }
309
309
  function K() {
310
- c.some((n) => n.transitionStatus === "ending") ? j.current = !0 : (r(), p(!1));
310
+ a.some((n) => n.transitionStatus === "ending") ? W.current = !0 : (r(), m(!1));
311
311
  }
312
312
  function O() {
313
313
  if (X.current) {
314
314
  X.current = !1;
315
315
  return;
316
316
  }
317
- C || Ee(ne(u.current).activeElement) && (y(!0), _());
317
+ C || Ee(ne(u.current).activeElement) && (y(!0), w());
318
318
  }
319
319
  function J(n) {
320
320
  !C || se(u.current, n.relatedTarget) || (y(!1), r());
@@ -331,18 +331,18 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
331
331
  onMouseLeave: K,
332
332
  onFocus: O,
333
333
  onBlur: J,
334
- onKeyDown: V,
334
+ onKeyDown: $,
335
335
  onClick: O
336
- }, m = e.useMemo(() => ({
337
- expanded: Y
338
- }), [Y]), g = ie("div", d, {
336
+ }, p = e.useMemo(() => ({
337
+ expanded: z
338
+ }), [z]), g = ie("div", d, {
339
339
  ref: [v, u],
340
- state: m,
340
+ state: p,
341
341
  props: [t, {
342
342
  style: {
343
343
  [xt.frontmostHeight]: F ? `${F}px` : void 0
344
344
  }
345
- }, w, {
345
+ }, _, {
346
346
  children: /* @__PURE__ */ re(e.Fragment, {
347
347
  children: [D > 0 && S && /* @__PURE__ */ E(Te, {
348
348
  onFocus: q
@@ -353,8 +353,8 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
353
353
  }]
354
354
  }), o = e.useMemo(() => ({
355
355
  viewportRef: u
356
- }), [u]), h = e.useMemo(() => c.filter((n) => n.priority === "high"), [c]);
357
- return /* @__PURE__ */ re(Le.Provider, {
356
+ }), [u]), h = e.useMemo(() => a.filter((n) => n.priority === "high"), [a]);
357
+ return /* @__PURE__ */ re(He.Provider, {
358
358
  value: o,
359
359
  children: [D > 0 && S && /* @__PURE__ */ E(Te, {
360
360
  onFocus: q
@@ -372,10 +372,10 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
372
372
  })]
373
373
  });
374
374
  });
375
- process.env.NODE_ENV !== "production" && (He.displayName = "ToastViewport");
375
+ process.env.NODE_ENV !== "production" && (ke.displayName = "ToastViewport");
376
376
  const Me = /* @__PURE__ */ e.createContext(void 0);
377
377
  process.env.NODE_ENV !== "production" && (Me.displayName = "ToastRootContext");
378
- function me() {
378
+ function pe() {
379
379
  const f = e.useContext(Me);
380
380
  if (!f)
381
381
  throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>." : ht(66));
@@ -408,57 +408,57 @@ function Fe(f, d, v) {
408
408
  }
409
409
  function bt(f) {
410
410
  const v = window.getComputedStyle(f).transform;
411
- let s = 0, z = 0, P = 1;
411
+ let s = 0, V = 0, P = 1;
412
412
  if (v && v !== "none") {
413
- const w = v.match(/matrix(?:3d)?\(([^)]+)\)/);
414
- if (w) {
415
- const c = w[1].split(", ").map(parseFloat);
416
- c.length === 6 ? (s = c[4], z = c[5], P = Math.sqrt(c[0] * c[0] + c[1] * c[1])) : c.length === 16 && (s = c[12], z = c[13], P = c[0]);
413
+ const _ = v.match(/matrix(?:3d)?\(([^)]+)\)/);
414
+ if (_) {
415
+ const a = _[1].split(", ").map(parseFloat);
416
+ a.length === 6 ? (s = a[4], V = a[5], P = Math.sqrt(a[0] * a[0] + a[1] * a[1])) : a.length === 16 && (s = a[12], V = a[13], P = a[0]);
417
417
  }
418
418
  }
419
419
  return {
420
420
  x: s,
421
- y: z,
421
+ y: V,
422
422
  scale: P
423
423
  };
424
424
  }
425
- const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
425
+ const Ve = /* @__PURE__ */ e.forwardRef(function(d, v) {
426
426
  const {
427
427
  toast: s,
428
- render: z,
428
+ render: V,
429
429
  className: P,
430
- swipeDirection: w = ["down", "right"],
431
- ...c
432
- } = d, _ = s.positionerProps?.anchor !== void 0;
430
+ swipeDirection: _ = ["down", "right"],
431
+ ...a
432
+ } = d, w = s.positionerProps?.anchor !== void 0;
433
433
  let r = [];
434
- _ || (r = Array.isArray(w) ? w : [w]);
435
- const p = r.length > 0, {
434
+ w || (r = Array.isArray(_) ? _ : [_]);
435
+ const m = r.length > 0, {
436
436
  toasts: y,
437
437
  focused: u,
438
438
  close: R,
439
439
  remove: S,
440
440
  setToasts: M,
441
- pauseTimers: Y,
441
+ pauseTimers: z,
442
442
  expanded: C,
443
443
  setHovering: X
444
- } = Re(), [j, D] = e.useState(void 0), [F, k] = e.useState(!1), [q, V] = e.useState(!1), [G, K] = e.useState(!1), [O, J] = e.useState({
444
+ } = Re(), [W, D] = e.useState(void 0), [F, I] = e.useState(!1), [q, $] = e.useState(!1), [G, K] = e.useState(!1), [O, J] = e.useState({
445
445
  x: 0,
446
446
  y: 0
447
- }), [t, m] = e.useState({
447
+ }), [t, p] = e.useState({
448
448
  x: 0,
449
449
  y: 0,
450
450
  scale: 1
451
- }), [g, o] = e.useState(), [h, n] = e.useState(), [l, x] = e.useState(null), T = e.useRef(null), I = e.useRef({
451
+ }), [g, o] = e.useState(), [h, n] = e.useState(), [l, 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
- }), ae = e.useRef(void 0), pe = e.useRef(0), ce = e.useRef(!1), $ = e.useRef({
458
+ }), ce = e.useRef(void 0), me = e.useRef(0), ae = e.useRef(!1), A = e.useRef({
459
459
  x: 0,
460
460
  y: 0
461
- }), he = e.useRef(!1), ge = e.useMemo(() => y.indexOf(s), [s, y]), ve = e.useMemo(() => y.filter((i) => i.transitionStatus !== "ending").indexOf(s), [s, y]), Be = e.useMemo(() => y.slice(0, y.indexOf(s)).reduce((i, a) => i + (a.height || 0), 0), [y, s]);
461
+ }), he = e.useRef(!1), ge = e.useMemo(() => y.indexOf(s), [s, y]), ve = e.useMemo(() => y.filter((i) => i.transitionStatus !== "ending").indexOf(s), [s, y]), Ye = e.useMemo(() => y.slice(0, y.indexOf(s)).reduce((i, c) => i + (c.height || 0), 0), [y, s]);
462
462
  gt({
463
463
  open: s.transitionStatus !== "ending",
464
464
  ref: T,
@@ -466,28 +466,28 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
466
466
  s.transitionStatus === "ending" && S(s.id);
467
467
  }
468
468
  });
469
- const ue = U((i = !1) => {
470
- const a = T.current;
471
- if (!a)
469
+ const ue = j((i = !1) => {
470
+ const c = T.current;
471
+ if (!c)
472
472
  return;
473
- const b = a.style.height;
474
- a.style.height = "auto";
475
- const N = a.offsetHeight;
476
- a.style.height = b;
477
- function A() {
478
- M((L) => L.map((H) => H.id === s.id ? {
479
- ...H,
473
+ const b = c.style.height;
474
+ c.style.height = "auto";
475
+ const N = c.offsetHeight;
476
+ c.style.height = b;
477
+ function B() {
478
+ M((H) => H.map((k) => k.id === s.id ? {
479
+ ...k,
480
480
  ref: T,
481
481
  height: N,
482
482
  transitionStatus: void 0
483
- } : H));
483
+ } : k));
484
484
  }
485
- i ? mt.flushSync(A) : A();
485
+ i ? pt.flushSync(B) : B();
486
486
  });
487
487
  Se(ue, [ue]);
488
- function Ye(i, a) {
489
- let b = i, N = a;
490
- return !r.includes("left") && !r.includes("right") ? b = i > 0 ? i ** Q : -(Math.abs(i) ** Q) : (!r.includes("right") && i > 0 && (b = i ** Q), !r.includes("left") && i < 0 && (b = -(Math.abs(i) ** Q))), !r.includes("up") && !r.includes("down") ? N = a > 0 ? a ** Q : -(Math.abs(a) ** Q) : (!r.includes("down") && a > 0 && (N = a ** Q), !r.includes("up") && a < 0 && (N = -(Math.abs(a) ** Q))), {
488
+ function ze(i, c) {
489
+ let b = i, N = c;
490
+ return !r.includes("left") && !r.includes("right") ? b = i > 0 ? i ** Q : -(Math.abs(i) ** Q) : (!r.includes("right") && i > 0 && (b = i ** Q), !r.includes("left") && i < 0 && (b = -(Math.abs(i) ** Q))), !r.includes("up") && !r.includes("down") ? N = c > 0 ? c ** Q : -(Math.abs(c) ** Q) : (!r.includes("down") && c > 0 && (N = c ** Q), !r.includes("up") && c < 0 && (N = -(Math.abs(c) ** Q))), {
491
491
  x: b,
492
492
  y: N
493
493
  };
@@ -495,96 +495,96 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
495
495
  function Xe(i) {
496
496
  if (i.button !== 0)
497
497
  return;
498
- i.pointerType === "touch" && Y();
499
- const a = be(i.nativeEvent);
500
- if (!(a && a.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))) {
501
- if (ce.current = !1, ae.current = void 0, pe.current = 0, I.current = {
498
+ i.pointerType === "touch" && z();
499
+ const c = be(i.nativeEvent);
500
+ if (!(c && c.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))) {
501
+ if (ae.current = !1, ce.current = void 0, me.current = 0, L.current = {
502
502
  x: i.clientX,
503
503
  y: i.clientY
504
- }, $.current = I.current, T.current) {
504
+ }, A.current = L.current, T.current) {
505
505
  const N = bt(T.current);
506
- Z.current = N, m(N), J({
506
+ Z.current = N, p(N), J({
507
507
  x: N.x,
508
508
  y: N.y
509
509
  });
510
510
  }
511
- X(!0), k(!0), V(!1), x(null), he.current = !0, T.current?.setPointerCapture(i.pointerId);
511
+ X(!0), I(!0), $(!1), x(null), he.current = !0, T.current?.setPointerCapture(i.pointerId);
512
512
  }
513
513
  }
514
514
  function Ge(i) {
515
515
  if (!F)
516
516
  return;
517
- i.preventDefault(), he.current && (I.current = {
517
+ i.preventDefault(), he.current && (L.current = {
518
518
  x: i.clientX,
519
519
  y: i.clientY
520
520
  }, he.current = !1);
521
521
  const {
522
- clientY: a,
522
+ clientY: c,
523
523
  clientX: b,
524
524
  movementX: N,
525
- movementY: A
525
+ movementY: B
526
526
  } = i;
527
- (A < 0 && a > $.current.y || A > 0 && a < $.current.y) && ($.current = {
528
- x: $.current.x,
529
- y: a
530
- }), (N < 0 && b > $.current.x || N > 0 && b < $.current.x) && ($.current = {
527
+ (B < 0 && c > A.current.y || B > 0 && c < A.current.y) && (A.current = {
528
+ x: A.current.x,
529
+ y: c
530
+ }), (N < 0 && b > A.current.x || N > 0 && b < A.current.x) && (A.current = {
531
531
  x: b,
532
- y: $.current.y
532
+ y: A.current.y
533
533
  });
534
- const L = b - I.current.x, H = a - I.current.y, Qe = a - $.current.y, Ze = b - $.current.x;
535
- if (!q && Math.sqrt(L * L + H * H) >= Et && (V(!0), l === null)) {
534
+ const H = b - L.current.x, k = c - L.current.y, Qe = c - A.current.y, Ze = b - A.current.x;
535
+ if (!q && Math.sqrt(H * H + k * k) >= Et && ($(!0), l === null)) {
536
536
  const fe = r.includes("left") || r.includes("right"), et = r.includes("up") || r.includes("down");
537
537
  if (fe && et) {
538
- const tt = Math.abs(L), nt = Math.abs(H);
538
+ const tt = Math.abs(H), nt = Math.abs(k);
539
539
  x(tt > nt ? "horizontal" : "vertical");
540
540
  }
541
541
  }
542
- let B;
543
- if (!ae.current)
544
- l === "vertical" ? H > 0 ? B = "down" : H < 0 && (B = "up") : l === "horizontal" ? L > 0 ? B = "right" : L < 0 && (B = "left") : Math.abs(L) >= Math.abs(H) ? B = L > 0 ? "right" : "left" : B = H > 0 ? "down" : "up", B && r.includes(B) && (ae.current = B, pe.current = Fe(B, L, H), D(B));
542
+ let Y;
543
+ if (!ce.current)
544
+ l === "vertical" ? k > 0 ? Y = "down" : k < 0 && (Y = "up") : l === "horizontal" ? H > 0 ? Y = "right" : H < 0 && (Y = "left") : Math.abs(H) >= Math.abs(k) ? Y = H > 0 ? "right" : "left" : Y = k > 0 ? "down" : "up", Y && r.includes(Y) && (ce.current = Y, me.current = Fe(Y, H, k), D(Y));
545
545
  else {
546
- const ye = ae.current, fe = Fe(ye, Ze, Qe);
547
- fe > oe ? (ce.current = !1, D(ye)) : !(r.includes("left") && r.includes("right")) && !(r.includes("up") && r.includes("down")) && pe.current - fe >= Dt && (ce.current = !0);
546
+ const ye = ce.current, fe = Fe(ye, Ze, Qe);
547
+ fe > oe ? (ae.current = !1, D(ye)) : !(r.includes("left") && r.includes("right")) && !(r.includes("up") && r.includes("down")) && me.current - fe >= Dt && (ae.current = !0);
548
548
  }
549
- const le = Ye(L, H);
550
- let _e = Z.current.x, we = Z.current.y;
551
- l === "horizontal" ? (r.includes("left") || r.includes("right")) && (_e += le.x) : (l === "vertical" || (r.includes("left") || r.includes("right")) && (_e += le.x), (r.includes("up") || r.includes("down")) && (we += le.y)), J({
552
- x: _e,
553
- y: we
549
+ const le = ze(H, k);
550
+ let we = Z.current.x, _e = Z.current.y;
551
+ l === "horizontal" ? (r.includes("left") || r.includes("right")) && (we += le.x) : (l === "vertical" || (r.includes("left") || r.includes("right")) && (we += le.x), (r.includes("up") || r.includes("down")) && (_e += le.y)), J({
552
+ x: we,
553
+ y: _e
554
554
  });
555
555
  }
556
556
  function Ke(i) {
557
557
  if (!F)
558
558
  return;
559
- if (k(!1), V(!1), x(null), T.current?.releasePointerCapture(i.pointerId), ce.current) {
559
+ if (I(!1), $(!1), x(null), T.current?.releasePointerCapture(i.pointerId), ae.current) {
560
560
  J({
561
561
  x: t.x,
562
562
  y: t.y
563
563
  }), D(void 0);
564
564
  return;
565
565
  }
566
- let a = !1;
566
+ let c = !1;
567
567
  const b = O.x - t.x, N = O.y - t.y;
568
- let A;
569
- for (const L of r) {
570
- switch (L) {
568
+ let B;
569
+ for (const H of r) {
570
+ switch (H) {
571
571
  case "right":
572
- b > oe && (a = !0, A = "right");
572
+ b > oe && (c = !0, B = "right");
573
573
  break;
574
574
  case "left":
575
- b < -oe && (a = !0, A = "left");
575
+ b < -oe && (c = !0, B = "left");
576
576
  break;
577
577
  case "down":
578
- N > oe && (a = !0, A = "down");
578
+ N > oe && (c = !0, B = "down");
579
579
  break;
580
580
  case "up":
581
- N < -oe && (a = !0, A = "up");
581
+ N < -oe && (c = !0, B = "up");
582
582
  break;
583
583
  }
584
- if (a)
584
+ if (c)
585
585
  break;
586
586
  }
587
- a ? (D(A), K(!0), R(s.id)) : (J({
587
+ c ? (D(B), K(!0), R(s.id)) : (J({
588
588
  x: t.x,
589
589
  y: t.y
590
590
  }), D(void 0));
@@ -597,34 +597,34 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
597
597
  }
598
598
  }
599
599
  e.useEffect(() => {
600
- if (!p)
600
+ if (!m)
601
601
  return;
602
602
  const i = T.current;
603
603
  if (!i)
604
604
  return;
605
- function a(b) {
605
+ function c(b) {
606
606
  se(i, b.target) && b.preventDefault();
607
607
  }
608
- return i.addEventListener("touchmove", a, {
608
+ return i.addEventListener("touchmove", c, {
609
609
  passive: !1
610
610
  }), () => {
611
- i.removeEventListener("touchmove", a);
611
+ i.removeEventListener("touchmove", c);
612
612
  };
613
- }, [p]);
613
+ }, [m]);
614
614
  function je() {
615
615
  if (!F && O.x === t.x && O.y === t.y && !G)
616
616
  return {
617
617
  [ee.swipeMovementX]: "0px",
618
618
  [ee.swipeMovementY]: "0px"
619
619
  };
620
- const i = O.x - t.x, a = O.y - t.y;
620
+ const i = O.x - t.x, c = O.y - t.y;
621
621
  return {
622
622
  transition: F ? "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
625
  transform: F ? `translateX(${O.x}px) translateY(${O.y}px) scale(${t.scale})` : void 0,
626
626
  [ee.swipeMovementX]: `${i}px`,
627
- [ee.swipeMovementY]: `${a}px`
627
+ [ee.swipeMovementY]: `${c}px`
628
628
  };
629
629
  }
630
630
  const Ne = s.priority === "high", Ue = {
@@ -634,15 +634,15 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
634
634
  "aria-labelledby": g,
635
635
  "aria-describedby": h,
636
636
  "aria-hidden": Ne && !u ? !0 : void 0,
637
- onPointerDown: p ? Xe : void 0,
638
- onPointerMove: p ? Ge : void 0,
639
- onPointerUp: p ? Ke : void 0,
637
+ onPointerDown: m ? Xe : void 0,
638
+ onPointerMove: m ? Ge : void 0,
639
+ onPointerUp: m ? Ke : void 0,
640
640
  onKeyDown: We,
641
- inert: pt(s.limited),
641
+ inert: mt(s.limited),
642
642
  style: {
643
643
  ...je(),
644
644
  [ee.index]: s.transitionStatus === "ending" ? ge : ve,
645
- [ee.offsetY]: `${Be}px`,
645
+ [ee.offsetY]: `${Ye}px`,
646
646
  [ee.height]: s.height ? `${s.height}px` : void 0
647
647
  }
648
648
  }, te = e.useMemo(() => ({
@@ -653,12 +653,12 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
653
653
  descriptionId: h,
654
654
  setDescriptionId: n,
655
655
  swiping: F,
656
- swipeDirection: j,
656
+ swipeDirection: W,
657
657
  recalculateHeight: ue,
658
658
  index: ge,
659
659
  visibleIndex: ve,
660
660
  expanded: C
661
- }), [s, g, h, F, j, ue, ge, ve, C]), qe = e.useMemo(() => ({
661
+ }), [s, g, h, F, W, ue, ge, ve, C]), qe = e.useMemo(() => ({
662
662
  transitionStatus: s.transitionStatus,
663
663
  expanded: C,
664
664
  limited: s.limited || !1,
@@ -669,29 +669,29 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
669
669
  ref: [v, te.rootRef],
670
670
  state: qe,
671
671
  stateAttributesMapping: Tt,
672
- props: [Ue, c]
672
+ props: [Ue, a]
673
673
  });
674
674
  return /* @__PURE__ */ E(Me.Provider, {
675
675
  value: te,
676
676
  children: Je
677
677
  });
678
678
  });
679
- process.env.NODE_ENV !== "production" && (ze.displayName = "ToastRoot");
680
- const Ve = /* @__PURE__ */ e.forwardRef(function(d, v) {
679
+ process.env.NODE_ENV !== "production" && (Ve.displayName = "ToastRoot");
680
+ const $e = /* @__PURE__ */ e.forwardRef(function(d, v) {
681
681
  const {
682
682
  render: s,
683
- className: z,
683
+ className: V,
684
684
  ...P
685
685
  } = d, {
686
- visibleIndex: w,
687
- expanded: c,
688
- recalculateHeight: _
689
- } = me(), r = e.useRef(null);
686
+ visibleIndex: _,
687
+ expanded: a,
688
+ recalculateHeight: w
689
+ } = pe(), r = e.useRef(null);
690
690
  Se(() => {
691
691
  const R = r.current;
692
- if (!R || (_(), typeof ResizeObserver != "function" || typeof MutationObserver != "function"))
692
+ if (!R || (w(), typeof ResizeObserver != "function" || typeof MutationObserver != "function"))
693
693
  return;
694
- const S = new ResizeObserver(() => _(!0)), M = new MutationObserver(() => _(!0));
694
+ const S = new ResizeObserver(() => w(!0)), M = new MutationObserver(() => w(!0));
695
695
  return S.observe(R), M.observe(R, {
696
696
  childList: !0,
697
697
  subtree: !0,
@@ -699,78 +699,78 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, v) {
699
699
  }), () => {
700
700
  S.disconnect(), M.disconnect();
701
701
  };
702
- }, [_]);
703
- const p = w > 0, y = e.useMemo(() => ({
704
- expanded: c,
705
- behind: p
706
- }), [c, p]);
702
+ }, [w]);
703
+ const m = _ > 0, y = e.useMemo(() => ({
704
+ expanded: a,
705
+ behind: m
706
+ }), [a, m]);
707
707
  return ie("div", d, {
708
708
  ref: [v, r],
709
709
  state: y,
710
710
  props: P
711
711
  });
712
712
  });
713
- process.env.NODE_ENV !== "production" && (Ve.displayName = "ToastContent");
714
- const $e = /* @__PURE__ */ e.forwardRef(function(d, v) {
713
+ process.env.NODE_ENV !== "production" && ($e.displayName = "ToastContent");
714
+ const Ae = /* @__PURE__ */ e.forwardRef(function(d, v) {
715
715
  const {
716
716
  render: s,
717
- className: z,
717
+ className: V,
718
718
  id: P,
719
- children: w,
720
- ...c
719
+ children: _,
720
+ ...a
721
721
  } = d, {
722
- toast: _
723
- } = me(), r = w ?? _.description, p = !!r, y = _t(P), {
722
+ toast: w
723
+ } = pe(), r = _ ?? w.description, m = !!r, y = wt(P), {
724
724
  setDescriptionId: u
725
- } = me();
725
+ } = pe();
726
726
  Se(() => {
727
- if (p)
727
+ if (m)
728
728
  return u(y), () => {
729
729
  u(void 0);
730
730
  };
731
- }, [p, y, u]);
731
+ }, [m, y, u]);
732
732
  const R = e.useMemo(() => ({
733
- type: _.type
734
- }), [_.type]), S = ie("p", d, {
733
+ type: w.type
734
+ }), [w.type]), S = ie("p", d, {
735
735
  ref: v,
736
736
  state: R,
737
737
  props: {
738
- ...c,
738
+ ...a,
739
739
  id: y,
740
740
  children: r
741
741
  }
742
742
  });
743
- return p ? S : null;
743
+ return m ? S : null;
744
744
  });
745
- process.env.NODE_ENV !== "production" && ($e.displayName = "ToastDescription");
746
- const Ae = /* @__PURE__ */ e.forwardRef(function(d, v) {
745
+ process.env.NODE_ENV !== "production" && (Ae.displayName = "ToastDescription");
746
+ const Be = /* @__PURE__ */ e.forwardRef(function(d, v) {
747
747
  const {
748
748
  render: s,
749
- className: z,
749
+ className: V,
750
750
  disabled: P,
751
- nativeButton: w = !0,
752
- ...c
751
+ nativeButton: _ = !0,
752
+ ...a
753
753
  } = d, {
754
- close: _,
754
+ close: w,
755
755
  expanded: r
756
756
  } = Re(), {
757
- toast: p
758
- } = me(), [y, u] = e.useState(!1), {
757
+ toast: m
758
+ } = pe(), [y, u] = e.useState(!1), {
759
759
  getButtonProps: R,
760
760
  buttonRef: S
761
- } = wt({
761
+ } = _t({
762
762
  disabled: P,
763
- native: w
763
+ native: _
764
764
  }), M = e.useMemo(() => ({
765
- type: p.type
766
- }), [p.type]);
765
+ type: m.type
766
+ }), [m.type]);
767
767
  return ie("button", d, {
768
768
  ref: [v, S],
769
769
  state: M,
770
770
  props: [{
771
771
  "aria-hidden": !r && !y,
772
772
  onClick() {
773
- _(p.id);
773
+ w(m.id);
774
774
  },
775
775
  onFocus() {
776
776
  u(!0);
@@ -778,11 +778,11 @@ const Ae = /* @__PURE__ */ e.forwardRef(function(d, v) {
778
778
  onBlur() {
779
779
  u(!1);
780
780
  }
781
- }, c, R]
781
+ }, a, R]
782
782
  });
783
783
  });
784
- process.env.NODE_ENV !== "production" && (Ae.displayName = "ToastClose");
785
- const Rt = ft, St = "_toast__viewport_km0zn_1", Mt = "_toast_km0zn_1", Nt = "_toast_variant_neutral_km0zn_109", Pt = "_toast_variant_colorway_km0zn_115", Ot = "_toast__content_km0zn_121", Ct = "_toast__header_km0zn_139", Ft = "_toast__row_km0zn_144", kt = "_toast__title_km0zn_151", It = "_toast__description_km0zn_155", Lt = "_toast__close_km0zn_159", W = {
784
+ process.env.NODE_ENV !== "production" && (Be.displayName = "ToastClose");
785
+ const Rt = ft, St = "_toast__viewport_1if9c_1", Mt = "_toast_1if9c_1", Nt = "_toast_variant_neutral_1if9c_109", Pt = "_toast_variant_colorway_1if9c_115", Ot = "_toast__content_1if9c_121", Ct = "_toast__header_1if9c_139", Ft = "_toast__row_1if9c_144", It = "_toast__title_1if9c_151", Lt = "_toast__description_1if9c_155", U = {
786
786
  toast__viewport: St,
787
787
  toast: Mt,
788
788
  toast_variant_neutral: Nt,
@@ -790,63 +790,61 @@ const Rt = ft, St = "_toast__viewport_km0zn_1", Mt = "_toast_km0zn_1", Nt = "_to
790
790
  toast__content: Ot,
791
791
  toast__header: Ct,
792
792
  toast__row: Ft,
793
- toast__title: kt,
794
- toast__description: It,
795
- toast__close: Lt
796
- }, un = Ie, ke = {
793
+ toast__title: It,
794
+ toast__description: Lt
795
+ }, an = Le, Ie = {
797
796
  info: "blue",
798
797
  error: "red",
799
798
  warning: "yellow",
800
799
  success: "green"
801
800
  };
802
- function ln() {
803
- return /* @__PURE__ */ E(Rt, { children: /* @__PURE__ */ E(He, { className: W.toast__viewport, children: /* @__PURE__ */ E(Ht, {}) }) });
801
+ function un() {
802
+ return /* @__PURE__ */ E(Rt, { children: /* @__PURE__ */ E(ke, { className: U.toast__viewport, children: /* @__PURE__ */ E(Ht, {}) }) });
804
803
  }
805
804
  function Ht() {
806
805
  return lt().toasts.map((d) => {
807
- const v = d.type && d.type in ke ? ke[d.type] : void 0;
806
+ const v = d.type && d.type in Ie ? Ie[d.type] : void 0;
808
807
  return /* @__PURE__ */ E(
809
- ze,
808
+ Ve,
810
809
  {
811
810
  toast: d,
812
811
  className: rt(
813
- W.toast,
814
- v ? W.toast_variant_colorway : W.toast_variant_neutral
812
+ U.toast,
813
+ v ? U.toast_variant_colorway : U.toast_variant_neutral
815
814
  ),
816
- render: /* @__PURE__ */ E(at, { background: "default", color: v }),
815
+ render: /* @__PURE__ */ E(ct, { background: "default", color: v }),
817
816
  children: /* @__PURE__ */ re(
818
817
  xe,
819
818
  {
820
- render: /* @__PURE__ */ E(Ve, {}),
821
- className: W.toast__content,
819
+ render: /* @__PURE__ */ E($e, {}),
820
+ className: U.toast__content,
822
821
  children: [
823
- /* @__PURE__ */ re(xe, { className: W.toast__row, children: [
824
- /* @__PURE__ */ re(xe, { className: W.toast__header, children: [
822
+ /* @__PURE__ */ re(xe, { className: U.toast__row, children: [
823
+ /* @__PURE__ */ re(xe, { className: U.toast__header, children: [
825
824
  d.title ? /* @__PURE__ */ E(
826
825
  ot,
827
826
  {
828
827
  level: 2,
829
828
  size: "lg",
830
829
  color: "inherit",
831
- className: W.toast__title,
830
+ className: U.toast__title,
832
831
  children: d.title
833
832
  }
834
833
  ) : null,
835
834
  /* @__PURE__ */ E(
836
- $e,
835
+ Ae,
837
836
  {
838
- render: /* @__PURE__ */ E(ct, { multiline: !0, color: v ? "inherit" : "dimmer" }),
839
- className: W.toast__description
837
+ render: /* @__PURE__ */ E(at, { multiline: !0, color: v ? "inherit" : "dimmer" }),
838
+ className: U.toast__description
840
839
  }
841
840
  )
842
841
  ] }),
843
842
  /* @__PURE__ */ E(
844
- Ae,
843
+ Be,
845
844
  {
846
845
  render: /* @__PURE__ */ E(
847
846
  it,
848
847
  {
849
- className: d.title ? W.toast__close : void 0,
850
848
  interactive: v ? `${v}_no-fill` : "no-fill",
851
849
  icon: "close-line",
852
850
  size: "sm",
@@ -873,6 +871,6 @@ function Ht() {
873
871
  });
874
872
  }
875
873
  export {
876
- un as ToastProvider,
877
- ln as ToastViewport
874
+ an as ToastProvider,
875
+ un as ToastViewport
878
876
  };
@@ -51,28 +51,25 @@ import '../../index21.css';const g = "_view_colorway_ldhog_1", d = "_view_colorw
51
51
  return v({
52
52
  defaultTagName: "div",
53
53
  render: r,
54
- props: y(
55
- {
56
- className: t(
57
- n.view,
58
- e && l[`view_colorway_color-${e}`],
59
- _.interactive && [
60
- c.view_interactive,
61
- c[`view_interactive_${_.interactive}`]
62
- ],
63
- _.colorway && [
64
- _.colorway[1].endsWith("static") ? l.view_colorway_static : l.view_colorway,
65
- l[`view_colorway_${_.colorway[1]}`],
66
- l[`view_colorway_color-${_.colorway[0]}`]
67
- ],
68
- _.loading && [
69
- w.view_loading,
70
- w[`view_loading_${_.loading}`]
71
- ]
72
- )
73
- },
74
- a
75
- )
54
+ props: y(a, {
55
+ className: t(
56
+ n.view,
57
+ e && l[`view_colorway_color-${e}`],
58
+ _.interactive && [
59
+ c.view_interactive,
60
+ c[`view_interactive_${_.interactive}`]
61
+ ],
62
+ _.colorway && [
63
+ _.colorway[1].endsWith("static") ? l.view_colorway_static : l.view_colorway,
64
+ l[`view_colorway_${_.colorway[1]}`],
65
+ l[`view_colorway_color-${_.colorway[0]}`]
66
+ ],
67
+ _.loading && [
68
+ w.view_loading,
69
+ w[`view_loading_${_.loading}`]
70
+ ]
71
+ )
72
+ })
76
73
  });
77
74
  }, k = (o) => {
78
75
  let i = null, e = null;
package/dist/toast.css CHANGED
@@ -1 +1 @@
1
- ._toast__viewport_km0zn_1{position:fixed;z-index:1;margin:0 auto;inset:auto var(--space-8) var(--space-8) auto;width:var(--space-256)}@media(min-width:512px){._toast__viewport_km0zn_1{right:var(--space-16);bottom:var(--space-16)}}._toast_km0zn_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_km0zn_1[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--toast-custom-offset-y));height:var(--toast-height)}._toast_km0zn_1[data-starting-style],._toast_km0zn_1[data-ending-style]{transform:translateY(150%)}._toast_km0zn_1[data-limited],._toast_km0zn_1[data-ending-style]{opacity:0}._toast_km0zn_1[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 50%))}._toast_km0zn_1[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 50%)) translateY(var(--toast-custom-offset-y))}._toast_km0zn_1[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 50%)) translateY(var(--toast-custom-offset-y))}._toast_km0zn_1[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 50%))}._toast_km0zn_1:after{display:block;position:absolute;top:100%;left:0;width:100%;height:calc(var(--toast-custom-gap) + 1px);content:""}._toast_variant_neutral_km0zn_109{border-color:var(--surface-interactive-border);background:var(--surface-background);color:var(--foreground-default)}._toast_variant_colorway_km0zn_115{border-color:var(--view-colorway-dimmer);background:var(--view-colorway-dimmest);color:var(--view-colorway-strongest)}._toast__content_km0zn_121{flex-grow:1;flex-shrink:1;gap:var(--space-16);transition:opacity var(--transition-duration-snappy) var(--transition-timing-function-snappy);padding:var(--space-12);overflow:hidden}._toast__content_km0zn_121[data-behind]{opacity:0}._toast__content_km0zn_121[data-expanded]{opacity:1}._toast__header_km0zn_139{flex:1 1 auto;gap:var(--space-4)}._toast__row_km0zn_144{flex:1 1 auto;flex-direction:row;justify-content:space-between;gap:var(--space-4)}._toast__title_km0zn_151,._toast__description_km0zn_155{flex:1 1 auto}._toast__close_km0zn_159{position:absolute;top:0;right:0}
1
+ ._toast__viewport_1if9c_1{position:fixed;z-index:1;margin:0 auto;inset:auto var(--space-8) var(--space-8) auto;width:var(--space-256)}@media(min-width:512px){._toast__viewport_1if9c_1{right:var(--space-16);bottom:var(--space-16)}}._toast_1if9c_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_1if9c_1[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--toast-custom-offset-y));height:var(--toast-height)}._toast_1if9c_1[data-starting-style],._toast_1if9c_1[data-ending-style]{transform:translateY(150%)}._toast_1if9c_1[data-limited],._toast_1if9c_1[data-ending-style]{opacity:0}._toast_1if9c_1[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 50%))}._toast_1if9c_1[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 50%)) translateY(var(--toast-custom-offset-y))}._toast_1if9c_1[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 50%)) translateY(var(--toast-custom-offset-y))}._toast_1if9c_1[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 50%))}._toast_1if9c_1:after{display:block;position:absolute;top:100%;left:0;width:100%;height:calc(var(--toast-custom-gap) + 1px);content:""}._toast_variant_neutral_1if9c_109{border-color:var(--surface-interactive-border);background:var(--surface-background);color:var(--foreground-default)}._toast_variant_colorway_1if9c_115{border-color:var(--view-colorway-dimmer);background:var(--view-colorway-dimmest);color:var(--view-colorway-strongest)}._toast__content_1if9c_121{flex-grow:1;flex-shrink:1;gap:var(--space-16);transition:opacity var(--transition-duration-snappy) var(--transition-timing-function-snappy);padding:var(--space-12);overflow:hidden}._toast__content_1if9c_121[data-behind]{opacity:0}._toast__content_1if9c_121[data-expanded]{opacity:1}._toast__header_1if9c_139{flex:1 1 auto;gap:var(--space-4)}._toast__row_1if9c_144{flex:1 1 auto;flex-direction:row;justify-content:space-between;gap:var(--space-4)}._toast__title_1if9c_151,._toast__description_1if9c_155{flex:1 1 auto}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koide-labs/ui",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {