@koide-labs/ui 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/anchor/index.js +7 -10
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/badge/index.js +29 -27
- package/dist/components/collapse/index.js +5 -11
- package/dist/components/command/index.d.ts +1 -1
- package/dist/components/command/index.js +1 -1
- package/dist/components/heading/index.js +1 -6
- package/dist/components/popover/index.js +1 -1
- package/dist/components/preview-card/index.js +1 -1
- package/dist/components/text/index.js +13 -16
- package/dist/components/toast/toast.js +151 -153
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip-arrow.js +1 -1
- package/dist/components/view/index.js +19 -22
- package/dist/toast.css +1 -1
- package/dist/{tooltip-arrow-C1qXdi5T.js → tooltip-arrow-cs6vjjqZ.js} +6 -6
- package/dist/tooltip-arrow.css +1 -1
- package/package.json +4 -4
|
@@ -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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
3
|
-
import { c as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Text as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { View as
|
|
8
|
-
import { u as
|
|
9
|
-
import { m as
|
|
10
|
-
import '../../index8.css';const
|
|
11
|
-
badge:
|
|
12
|
-
badge_shiny:
|
|
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
|
|
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
|
-
|
|
21
|
+
className: l,
|
|
22
|
+
...d
|
|
22
23
|
}) {
|
|
23
|
-
const
|
|
24
|
+
const c = x({
|
|
24
25
|
defaultTagName: "span",
|
|
25
26
|
render: a,
|
|
26
|
-
props:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
2
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { Command as CommandPrimitive } from '@npham-dev/cmdk';
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
4
|
import { BaseDialogProps } from '../dialog';
|
|
5
5
|
import { IconName } from '../icon/icon-names';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as E, jsxs as oe, Fragment as Qe } from "react/jsx-runtime";
|
|
3
|
-
import { c as We } from "../../clsx-OuTLNxxd.js";
|
|
4
3
|
import * as a from "react";
|
|
5
4
|
import { useState as Qt } from "react";
|
|
6
5
|
import { c as ie, u as q, P as G } from "../../index-CeuccO-T.js";
|
|
7
6
|
import * as Jt from "react-dom";
|
|
8
7
|
import en from "react-dom";
|
|
8
|
+
import { c as We } from "../../clsx-OuTLNxxd.js";
|
|
9
9
|
import { textify as tn } from "../../-utils.js";
|
|
10
10
|
import { Dialog as nn } from "../dialog/index.js";
|
|
11
11
|
import { Icon as vt } from "../icon/index.js";
|
|
@@ -4,7 +4,7 @@ import { c as Re } from "../../clsx-OuTLNxxd.js";
|
|
|
4
4
|
import { Heading as be } from "../heading/index.js";
|
|
5
5
|
import { Surface as Se } from "../surface/index.js";
|
|
6
6
|
import { Text as ye } from "../text/index.js";
|
|
7
|
-
import { t as ae, T as Oe } from "../../tooltip-arrow-
|
|
7
|
+
import { t as ae, T as Oe } from "../../tooltip-arrow-cs6vjjqZ.js";
|
|
8
8
|
import { View as Ie } from "../view/index.js";
|
|
9
9
|
import { R as xe, P as Ne, c as x, h as Me, d as Fe, e as de, u as _e, i as ke, f as we, j as Ae, k as De, p as ee, t as He } from "../../transitions.module-CWX8e5cx.js";
|
|
10
10
|
import * as n from "react";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as P, jsxs as q } from "react/jsx-runtime";
|
|
3
3
|
import { c as pe } from "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import { Surface as fe } from "../surface/index.js";
|
|
5
|
-
import { t as z, T as me } from "../../tooltip-arrow-
|
|
5
|
+
import { t as z, T as me } from "../../tooltip-arrow-cs6vjjqZ.js";
|
|
6
6
|
import { d as Pe, e as Ce, f as we, p as U, t as ge } from "../../transitions.module-CWX8e5cx.js";
|
|
7
7
|
import * as e from "react";
|
|
8
8
|
import * as ve from "react-dom";
|
|
@@ -29,22 +29,19 @@ function P({
|
|
|
29
29
|
return m({
|
|
30
30
|
defaultTagName: "span",
|
|
31
31
|
render: x,
|
|
32
|
-
props: r(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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 {
|
|
@@ -9,7 +9,7 @@ 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
|
|
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";
|
|
@@ -21,9 +21,9 @@ import * as mt from "react-dom";
|
|
|
21
21
|
import { i as pt } 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
|
-
import { a as gt, t as
|
|
25
|
-
import { u as
|
|
26
|
-
import { u as
|
|
24
|
+
import { a as gt, t as wt } from "../../useOpenChangeComplete-Dse9kY9E.js";
|
|
25
|
+
import { u as vt } 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}`;
|
|
@@ -34,39 +34,39 @@ function De(f, d) {
|
|
|
34
34
|
description: f
|
|
35
35
|
};
|
|
36
36
|
if (typeof f == "function") {
|
|
37
|
-
const
|
|
38
|
-
return typeof
|
|
39
|
-
description:
|
|
40
|
-
} :
|
|
37
|
+
const w = f(d);
|
|
38
|
+
return typeof w == "string" ? {
|
|
39
|
+
description: w
|
|
40
|
+
} : w;
|
|
41
41
|
}
|
|
42
42
|
return f;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const Le = function(d) {
|
|
45
45
|
const {
|
|
46
|
-
children:
|
|
46
|
+
children: w,
|
|
47
47
|
timeout: s = 5e3,
|
|
48
48
|
limit: z = 3,
|
|
49
49
|
toastManager: P
|
|
50
|
-
} = d, [
|
|
51
|
-
|
|
52
|
-
const S =
|
|
53
|
-
function
|
|
50
|
+
} = d, [_, c] = e.useState([]), [v, r] = e.useState(!1), [p, y] = e.useState(!1), [u, R] = e.useState(null);
|
|
51
|
+
_.length === 0 && (v && r(!1), p && y(!1));
|
|
52
|
+
const S = v || p, M = e.useRef(/* @__PURE__ */ new Map()), Y = e.useRef(null), C = e.useRef(!0), X = e.useRef(!1);
|
|
53
|
+
function W(t) {
|
|
54
54
|
const m = de(ne(Y.current));
|
|
55
55
|
if (!Y.current || !se(Y.current, m) || !Ee(m))
|
|
56
56
|
return;
|
|
57
|
-
const g =
|
|
57
|
+
const g = _.findIndex((n) => n.id === t);
|
|
58
58
|
let o = null, h = g + 1;
|
|
59
|
-
for (; h <
|
|
60
|
-
if (
|
|
61
|
-
o =
|
|
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 (
|
|
69
|
-
o =
|
|
68
|
+
if (_[h].transitionStatus !== "ending") {
|
|
69
|
+
o = _[h];
|
|
70
70
|
break;
|
|
71
71
|
}
|
|
72
72
|
h -= 1;
|
|
@@ -75,7 +75,7 @@ const Ie = function(d) {
|
|
|
75
75
|
preventScroll: !0
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
const D =
|
|
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();
|
|
@@ -83,13 +83,13 @@ const Ie = function(d) {
|
|
|
83
83
|
t.remaining = g > 0 ? g : 0;
|
|
84
84
|
}
|
|
85
85
|
}));
|
|
86
|
-
}), F =
|
|
86
|
+
}), F = j(() => {
|
|
87
87
|
X.current && (X.current = !1, M.current.forEach((t, m) => {
|
|
88
88
|
t.remaining = t.remaining > 0 ? t.remaining : t.delay, t.timeout ??= Pe.create(), t.timeout.start(t.remaining, () => {
|
|
89
89
|
M.current.delete(m), t.callback();
|
|
90
90
|
}), t.start = Date.now();
|
|
91
91
|
}));
|
|
92
|
-
}),
|
|
92
|
+
}), I = j((t) => {
|
|
93
93
|
c((o) => {
|
|
94
94
|
const h = o.map((l) => l.id === t ? {
|
|
95
95
|
...l,
|
|
@@ -107,11 +107,11 @@ const Ie = function(d) {
|
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
109
|
const m = M.current.get(t);
|
|
110
|
-
m && m.timeout && (m.timeout.clear(), M.current.delete(t)),
|
|
111
|
-
}), q =
|
|
112
|
-
c((g) => g.filter((o) => o.id !== t)),
|
|
113
|
-
}), V =
|
|
114
|
-
const o = Date.now(), h = C.current && !
|
|
110
|
+
m && m.timeout && (m.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
|
+
c((g) => g.filter((o) => o.id !== t)), _.find((g) => g.id === t)?.onRemove?.();
|
|
113
|
+
}), V = j((t, m, g) => {
|
|
114
|
+
const o = Date.now(), h = C.current && !v && !p, n = h ? Pe.create() : void 0;
|
|
115
115
|
n?.start(m, () => {
|
|
116
116
|
M.current.delete(t), g();
|
|
117
117
|
}), M.current.set(t, {
|
|
@@ -121,7 +121,7 @@ const Ie = function(d) {
|
|
|
121
121
|
remaining: m,
|
|
122
122
|
callback: g
|
|
123
123
|
});
|
|
124
|
-
}), G =
|
|
124
|
+
}), G = j((t) => {
|
|
125
125
|
const m = t.id || yt("toast"), g = {
|
|
126
126
|
...t,
|
|
127
127
|
id: m,
|
|
@@ -131,11 +131,11 @@ const Ie = function(d) {
|
|
|
131
131
|
const n = [g, ...h], l = n.filter((x) => x.transitionStatus !== "ending");
|
|
132
132
|
if (l.length > z) {
|
|
133
133
|
const x = l.length - z, T = l.slice(-x);
|
|
134
|
-
return n.map((
|
|
135
|
-
...
|
|
134
|
+
return n.map((L) => T.some((Z) => Z.id === L.id) ? {
|
|
135
|
+
...L,
|
|
136
136
|
limited: !0
|
|
137
137
|
} : {
|
|
138
|
-
...
|
|
138
|
+
...L,
|
|
139
139
|
limited: !1
|
|
140
140
|
});
|
|
141
141
|
}
|
|
@@ -145,13 +145,13 @@ 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, () =>
|
|
149
|
-
}), K =
|
|
148
|
+
return g.type !== "loading" && o > 0 && V(m, o, () => I(m)), (v || p || !C.current) && D(), m;
|
|
149
|
+
}), K = j((t, m) => {
|
|
150
150
|
c((g) => g.map((o) => o.id === t ? {
|
|
151
151
|
...o,
|
|
152
152
|
...m
|
|
153
153
|
} : o));
|
|
154
|
-
}), O =
|
|
154
|
+
}), O = j((t, m) => {
|
|
155
155
|
const g = De(m.loading), o = G({
|
|
156
156
|
...g,
|
|
157
157
|
type: "loading"
|
|
@@ -162,7 +162,7 @@ const Ie = function(d) {
|
|
|
162
162
|
type: "success"
|
|
163
163
|
});
|
|
164
164
|
const x = l.timeout ?? s;
|
|
165
|
-
return x > 0 && V(o, x, () =>
|
|
165
|
+
return x > 0 && V(o, x, () => I(o)), (v || p || !C.current) && D(), n;
|
|
166
166
|
}).catch((n) => {
|
|
167
167
|
const l = De(m.error, n);
|
|
168
168
|
K(o, {
|
|
@@ -170,7 +170,7 @@ const Ie = function(d) {
|
|
|
170
170
|
type: "error"
|
|
171
171
|
});
|
|
172
172
|
const x = l.timeout ?? s;
|
|
173
|
-
return x > 0 && V(o, x, () =>
|
|
173
|
+
return x > 0 && V(o, x, () => I(o)), (v || p || !C.current) && D(), Promise.reject(n);
|
|
174
174
|
});
|
|
175
175
|
return {}.hasOwnProperty.call(m, "setPromise") && m.setPromise(h), h;
|
|
176
176
|
});
|
|
@@ -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 ?
|
|
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,
|
|
185
|
+
}, [G, K, V, s, P, O, I]);
|
|
186
186
|
const J = e.useMemo(() => ({
|
|
187
|
-
toasts:
|
|
187
|
+
toasts: _,
|
|
188
188
|
setToasts: c,
|
|
189
|
-
hovering:
|
|
189
|
+
hovering: v,
|
|
190
190
|
setHovering: r,
|
|
191
191
|
focused: p,
|
|
192
192
|
setFocused: y,
|
|
193
193
|
expanded: S,
|
|
194
194
|
add: G,
|
|
195
|
-
close:
|
|
195
|
+
close: I,
|
|
196
196
|
remove: q,
|
|
197
197
|
update: K,
|
|
198
198
|
promise: O,
|
|
@@ -203,27 +203,27 @@ const Ie = function(d) {
|
|
|
203
203
|
viewportRef: Y,
|
|
204
204
|
scheduleTimer: V,
|
|
205
205
|
windowFocusedRef: C
|
|
206
|
-
}), [G,
|
|
206
|
+
}), [G, I, p, v, S, D, u, O, q, F, V, _, K]);
|
|
207
207
|
return /* @__PURE__ */ E(ut.Provider, {
|
|
208
208
|
value: J,
|
|
209
|
-
children:
|
|
209
|
+
children: w
|
|
210
210
|
});
|
|
211
211
|
};
|
|
212
|
-
process.env.NODE_ENV !== "production" && (
|
|
213
|
-
const
|
|
214
|
-
process.env.NODE_ENV !== "production" && (
|
|
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
|
|
218
|
+
const ke = /* @__PURE__ */ e.forwardRef(function(d, w) {
|
|
219
219
|
const {
|
|
220
220
|
render: s,
|
|
221
221
|
className: z,
|
|
222
222
|
children: P,
|
|
223
|
-
...
|
|
223
|
+
..._
|
|
224
224
|
} = d, {
|
|
225
225
|
toasts: c,
|
|
226
|
-
pauseTimers:
|
|
226
|
+
pauseTimers: v,
|
|
227
227
|
resumeTimers: r,
|
|
228
228
|
setHovering: p,
|
|
229
229
|
setFocused: y,
|
|
@@ -233,31 +233,31 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
233
233
|
setPrevFocusElement: M,
|
|
234
234
|
expanded: Y,
|
|
235
235
|
focused: C
|
|
236
|
-
} = Re(), X = e.useRef(!1),
|
|
236
|
+
} = Re(), X = e.useRef(!1), W = e.useRef(!1), D = c.length, F = c[0]?.height ?? 0, I = e.useMemo(() => c.some((n) => n.transitionStatus === "ending"), [c]);
|
|
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
|
-
}),
|
|
243
|
+
}), v(), 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
|
-
}, [
|
|
249
|
+
}, [v, 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, v());
|
|
255
255
|
}
|
|
256
256
|
function x(T) {
|
|
257
257
|
if (T.relatedTarget || T.target === n)
|
|
258
258
|
return;
|
|
259
|
-
const
|
|
260
|
-
(!se(u.current,
|
|
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
|
+
v,
|
|
269
269
|
r,
|
|
270
270
|
u,
|
|
271
271
|
R,
|
|
@@ -283,8 +283,8 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
283
283
|
function x(T) {
|
|
284
284
|
if (T.pointerType !== "touch")
|
|
285
285
|
return;
|
|
286
|
-
const
|
|
287
|
-
se(n,
|
|
286
|
+
const L = be(T);
|
|
287
|
+
se(n, L) || (r(), p(!1), y(!1));
|
|
288
288
|
}
|
|
289
289
|
return l.addEventListener("pointerdown", x, !0), () => {
|
|
290
290
|
l.removeEventListener("pointerdown", x, !0);
|
|
@@ -301,20 +301,20 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
301
301
|
}), r());
|
|
302
302
|
}
|
|
303
303
|
e.useEffect(() => {
|
|
304
|
-
!R.current ||
|
|
305
|
-
}, [
|
|
304
|
+
!R.current || I || !W.current || (r(), p(!1), W.current = !1);
|
|
305
|
+
}, [I, r, p, R]);
|
|
306
306
|
function G() {
|
|
307
|
-
|
|
307
|
+
v(), p(!0), W.current = !1;
|
|
308
308
|
}
|
|
309
309
|
function K() {
|
|
310
|
-
c.some((n) => n.transitionStatus === "ending") ?
|
|
310
|
+
c.some((n) => n.transitionStatus === "ending") ? W.current = !0 : (r(), p(!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), v());
|
|
318
318
|
}
|
|
319
319
|
function J(n) {
|
|
320
320
|
!C || se(u.current, n.relatedTarget) || (y(!1), r());
|
|
@@ -336,13 +336,13 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
336
336
|
}, m = e.useMemo(() => ({
|
|
337
337
|
expanded: Y
|
|
338
338
|
}), [Y]), g = ie("div", d, {
|
|
339
|
-
ref: [
|
|
339
|
+
ref: [w, u],
|
|
340
340
|
state: m,
|
|
341
341
|
props: [t, {
|
|
342
342
|
style: {
|
|
343
343
|
[xt.frontmostHeight]: F ? `${F}px` : void 0
|
|
344
344
|
}
|
|
345
|
-
},
|
|
345
|
+
}, _, {
|
|
346
346
|
children: /* @__PURE__ */ re(e.Fragment, {
|
|
347
347
|
children: [D > 0 && S && /* @__PURE__ */ E(Te, {
|
|
348
348
|
onFocus: q
|
|
@@ -354,7 +354,7 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
354
354
|
}), o = e.useMemo(() => ({
|
|
355
355
|
viewportRef: u
|
|
356
356
|
}), [u]), h = e.useMemo(() => c.filter((n) => n.priority === "high"), [c]);
|
|
357
|
-
return /* @__PURE__ */ re(
|
|
357
|
+
return /* @__PURE__ */ re(He.Provider, {
|
|
358
358
|
value: o,
|
|
359
359
|
children: [D > 0 && S && /* @__PURE__ */ E(Te, {
|
|
360
360
|
onFocus: q
|
|
@@ -372,7 +372,7 @@ const He = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
372
372
|
})]
|
|
373
373
|
});
|
|
374
374
|
});
|
|
375
|
-
process.env.NODE_ENV !== "production" && (
|
|
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
378
|
function me() {
|
|
@@ -385,19 +385,19 @@ let ee = /* @__PURE__ */ (function(f) {
|
|
|
385
385
|
return f.index = "--toast-index", f.offsetY = "--toast-offset-y", f.height = "--toast-height", f.swipeMovementX = "--toast-swipe-movement-x", f.swipeMovementY = "--toast-swipe-movement-y", f;
|
|
386
386
|
})({});
|
|
387
387
|
const Tt = {
|
|
388
|
-
...
|
|
388
|
+
...wt,
|
|
389
389
|
swipeDirection(f) {
|
|
390
390
|
return f ? {
|
|
391
391
|
"data-swipe-direction": f
|
|
392
392
|
} : null;
|
|
393
393
|
}
|
|
394
394
|
}, oe = 40, Dt = 10, Q = 0.5, Et = 1;
|
|
395
|
-
function Fe(f, d,
|
|
395
|
+
function Fe(f, d, w) {
|
|
396
396
|
switch (f) {
|
|
397
397
|
case "up":
|
|
398
|
-
return -
|
|
398
|
+
return -w;
|
|
399
399
|
case "down":
|
|
400
|
-
return
|
|
400
|
+
return w;
|
|
401
401
|
case "left":
|
|
402
402
|
return -d;
|
|
403
403
|
case "right":
|
|
@@ -407,12 +407,12 @@ function Fe(f, d, v) {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
function bt(f) {
|
|
410
|
-
const
|
|
410
|
+
const w = window.getComputedStyle(f).transform;
|
|
411
411
|
let s = 0, z = 0, P = 1;
|
|
412
|
-
if (
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
const c =
|
|
412
|
+
if (w && w !== "none") {
|
|
413
|
+
const _ = w.match(/matrix(?:3d)?\(([^)]+)\)/);
|
|
414
|
+
if (_) {
|
|
415
|
+
const c = _[1].split(", ").map(parseFloat);
|
|
416
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]);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
@@ -422,16 +422,16 @@ function bt(f) {
|
|
|
422
422
|
scale: P
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
-
const ze = /* @__PURE__ */ e.forwardRef(function(d,
|
|
425
|
+
const ze = /* @__PURE__ */ e.forwardRef(function(d, w) {
|
|
426
426
|
const {
|
|
427
427
|
toast: s,
|
|
428
428
|
render: z,
|
|
429
429
|
className: P,
|
|
430
|
-
swipeDirection:
|
|
430
|
+
swipeDirection: _ = ["down", "right"],
|
|
431
431
|
...c
|
|
432
|
-
} = d,
|
|
432
|
+
} = d, v = s.positionerProps?.anchor !== void 0;
|
|
433
433
|
let r = [];
|
|
434
|
-
|
|
434
|
+
v || (r = Array.isArray(_) ? _ : [_]);
|
|
435
435
|
const p = r.length > 0, {
|
|
436
436
|
toasts: y,
|
|
437
437
|
focused: u,
|
|
@@ -441,14 +441,14 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
441
441
|
pauseTimers: Y,
|
|
442
442
|
expanded: C,
|
|
443
443
|
setHovering: X
|
|
444
|
-
} = Re(), [
|
|
444
|
+
} = Re(), [W, D] = e.useState(void 0), [F, I] = e.useState(!1), [q, V] = e.useState(!1), [G, K] = e.useState(!1), [O, J] = e.useState({
|
|
445
445
|
x: 0,
|
|
446
446
|
y: 0
|
|
447
447
|
}), [t, m] = 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),
|
|
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({
|
|
@@ -458,7 +458,7 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
458
458
|
}), ae = e.useRef(void 0), pe = e.useRef(0), ce = e.useRef(!1), $ = e.useRef({
|
|
459
459
|
x: 0,
|
|
460
460
|
y: 0
|
|
461
|
-
}), he = e.useRef(!1), ge = e.useMemo(() => y.indexOf(s), [s, y]),
|
|
461
|
+
}), he = e.useRef(!1), ge = e.useMemo(() => y.indexOf(s), [s, y]), we = 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]);
|
|
462
462
|
gt({
|
|
463
463
|
open: s.transitionStatus !== "ending",
|
|
464
464
|
ref: T,
|
|
@@ -466,7 +466,7 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
466
466
|
s.transitionStatus === "ending" && S(s.id);
|
|
467
467
|
}
|
|
468
468
|
});
|
|
469
|
-
const ue =
|
|
469
|
+
const ue = j((i = !1) => {
|
|
470
470
|
const a = T.current;
|
|
471
471
|
if (!a)
|
|
472
472
|
return;
|
|
@@ -475,12 +475,12 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
475
475
|
const N = a.offsetHeight;
|
|
476
476
|
a.style.height = b;
|
|
477
477
|
function A() {
|
|
478
|
-
M((
|
|
479
|
-
...
|
|
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
|
-
} :
|
|
483
|
+
} : k));
|
|
484
484
|
}
|
|
485
485
|
i ? mt.flushSync(A) : A();
|
|
486
486
|
});
|
|
@@ -498,23 +498,23 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
498
498
|
i.pointerType === "touch" && Y();
|
|
499
499
|
const a = be(i.nativeEvent);
|
|
500
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,
|
|
501
|
+
if (ce.current = !1, ae.current = void 0, pe.current = 0, L.current = {
|
|
502
502
|
x: i.clientX,
|
|
503
503
|
y: i.clientY
|
|
504
|
-
}, $.current =
|
|
504
|
+
}, $.current = L.current, T.current) {
|
|
505
505
|
const N = bt(T.current);
|
|
506
506
|
Z.current = N, m(N), J({
|
|
507
507
|
x: N.x,
|
|
508
508
|
y: N.y
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
X(!0),
|
|
511
|
+
X(!0), I(!0), V(!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 && (
|
|
517
|
+
i.preventDefault(), he.current && (L.current = {
|
|
518
518
|
x: i.clientX,
|
|
519
519
|
y: i.clientY
|
|
520
520
|
}, he.current = !1);
|
|
@@ -531,32 +531,32 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
531
531
|
x: b,
|
|
532
532
|
y: $.current.y
|
|
533
533
|
});
|
|
534
|
-
const
|
|
535
|
-
if (!q && Math.sqrt(
|
|
534
|
+
const H = b - L.current.x, k = a - L.current.y, Qe = a - $.current.y, Ze = b - $.current.x;
|
|
535
|
+
if (!q && Math.sqrt(H * H + k * k) >= Et && (V(!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(
|
|
538
|
+
const tt = Math.abs(H), nt = Math.abs(k);
|
|
539
539
|
x(tt > nt ? "horizontal" : "vertical");
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
let B;
|
|
543
543
|
if (!ae.current)
|
|
544
|
-
l === "vertical" ?
|
|
544
|
+
l === "vertical" ? k > 0 ? B = "down" : k < 0 && (B = "up") : l === "horizontal" ? H > 0 ? B = "right" : H < 0 && (B = "left") : Math.abs(H) >= Math.abs(k) ? B = H > 0 ? "right" : "left" : B = k > 0 ? "down" : "up", B && r.includes(B) && (ae.current = B, pe.current = Fe(B, H, k), D(B));
|
|
545
545
|
else {
|
|
546
546
|
const ye = ae.current, fe = Fe(ye, Ze, Qe);
|
|
547
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);
|
|
548
548
|
}
|
|
549
|
-
const le = Ye(
|
|
550
|
-
let
|
|
551
|
-
l === "horizontal" ? (r.includes("left") || r.includes("right")) && (
|
|
552
|
-
x:
|
|
553
|
-
y:
|
|
549
|
+
const le = Ye(H, k);
|
|
550
|
+
let ve = Z.current.x, _e = Z.current.y;
|
|
551
|
+
l === "horizontal" ? (r.includes("left") || r.includes("right")) && (ve += le.x) : (l === "vertical" || (r.includes("left") || r.includes("right")) && (ve += le.x), (r.includes("up") || r.includes("down")) && (_e += le.y)), J({
|
|
552
|
+
x: ve,
|
|
553
|
+
y: _e
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
556
|
function Ke(i) {
|
|
557
557
|
if (!F)
|
|
558
558
|
return;
|
|
559
|
-
if (
|
|
559
|
+
if (I(!1), V(!1), x(null), T.current?.releasePointerCapture(i.pointerId), ce.current) {
|
|
560
560
|
J({
|
|
561
561
|
x: t.x,
|
|
562
562
|
y: t.y
|
|
@@ -566,8 +566,8 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
566
566
|
let a = !1;
|
|
567
567
|
const b = O.x - t.x, N = O.y - t.y;
|
|
568
568
|
let A;
|
|
569
|
-
for (const
|
|
570
|
-
switch (
|
|
569
|
+
for (const H of r) {
|
|
570
|
+
switch (H) {
|
|
571
571
|
case "right":
|
|
572
572
|
b > oe && (a = !0, A = "right");
|
|
573
573
|
break;
|
|
@@ -641,7 +641,7 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
641
641
|
inert: pt(s.limited),
|
|
642
642
|
style: {
|
|
643
643
|
...je(),
|
|
644
|
-
[ee.index]: s.transitionStatus === "ending" ? ge :
|
|
644
|
+
[ee.index]: s.transitionStatus === "ending" ? ge : we,
|
|
645
645
|
[ee.offsetY]: `${Be}px`,
|
|
646
646
|
[ee.height]: s.height ? `${s.height}px` : void 0
|
|
647
647
|
}
|
|
@@ -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:
|
|
656
|
+
swipeDirection: W,
|
|
657
657
|
recalculateHeight: ue,
|
|
658
658
|
index: ge,
|
|
659
|
-
visibleIndex:
|
|
659
|
+
visibleIndex: we,
|
|
660
660
|
expanded: C
|
|
661
|
-
}), [s, g, h, F,
|
|
661
|
+
}), [s, g, h, F, W, ue, ge, we, C]), qe = e.useMemo(() => ({
|
|
662
662
|
transitionStatus: s.transitionStatus,
|
|
663
663
|
expanded: C,
|
|
664
664
|
limited: s.limited || !1,
|
|
@@ -666,7 +666,7 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
666
666
|
swiping: te.swiping,
|
|
667
667
|
swipeDirection: te.swipeDirection
|
|
668
668
|
}), [C, s.transitionStatus, s.limited, s.type, te.swiping, te.swipeDirection]), Je = ie("div", d, {
|
|
669
|
-
ref: [
|
|
669
|
+
ref: [w, te.rootRef],
|
|
670
670
|
state: qe,
|
|
671
671
|
stateAttributesMapping: Tt,
|
|
672
672
|
props: [Ue, c]
|
|
@@ -677,21 +677,21 @@ const ze = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
677
677
|
});
|
|
678
678
|
});
|
|
679
679
|
process.env.NODE_ENV !== "production" && (ze.displayName = "ToastRoot");
|
|
680
|
-
const Ve = /* @__PURE__ */ e.forwardRef(function(d,
|
|
680
|
+
const Ve = /* @__PURE__ */ e.forwardRef(function(d, w) {
|
|
681
681
|
const {
|
|
682
682
|
render: s,
|
|
683
683
|
className: z,
|
|
684
684
|
...P
|
|
685
685
|
} = d, {
|
|
686
|
-
visibleIndex:
|
|
686
|
+
visibleIndex: _,
|
|
687
687
|
expanded: c,
|
|
688
|
-
recalculateHeight:
|
|
688
|
+
recalculateHeight: v
|
|
689
689
|
} = me(), r = e.useRef(null);
|
|
690
690
|
Se(() => {
|
|
691
691
|
const R = r.current;
|
|
692
|
-
if (!R || (
|
|
692
|
+
if (!R || (v(), typeof ResizeObserver != "function" || typeof MutationObserver != "function"))
|
|
693
693
|
return;
|
|
694
|
-
const S = new ResizeObserver(() =>
|
|
694
|
+
const S = new ResizeObserver(() => v(!0)), M = new MutationObserver(() => v(!0));
|
|
695
695
|
return S.observe(R), M.observe(R, {
|
|
696
696
|
childList: !0,
|
|
697
697
|
subtree: !0,
|
|
@@ -699,28 +699,28 @@ const Ve = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
699
699
|
}), () => {
|
|
700
700
|
S.disconnect(), M.disconnect();
|
|
701
701
|
};
|
|
702
|
-
}, [
|
|
703
|
-
const p =
|
|
702
|
+
}, [v]);
|
|
703
|
+
const p = _ > 0, y = e.useMemo(() => ({
|
|
704
704
|
expanded: c,
|
|
705
705
|
behind: p
|
|
706
706
|
}), [c, p]);
|
|
707
707
|
return ie("div", d, {
|
|
708
|
-
ref: [
|
|
708
|
+
ref: [w, r],
|
|
709
709
|
state: y,
|
|
710
710
|
props: P
|
|
711
711
|
});
|
|
712
712
|
});
|
|
713
713
|
process.env.NODE_ENV !== "production" && (Ve.displayName = "ToastContent");
|
|
714
|
-
const $e = /* @__PURE__ */ e.forwardRef(function(d,
|
|
714
|
+
const $e = /* @__PURE__ */ e.forwardRef(function(d, w) {
|
|
715
715
|
const {
|
|
716
716
|
render: s,
|
|
717
717
|
className: z,
|
|
718
718
|
id: P,
|
|
719
|
-
children:
|
|
719
|
+
children: _,
|
|
720
720
|
...c
|
|
721
721
|
} = d, {
|
|
722
|
-
toast:
|
|
723
|
-
} = me(), r =
|
|
722
|
+
toast: v
|
|
723
|
+
} = me(), r = _ ?? v.description, p = !!r, y = vt(P), {
|
|
724
724
|
setDescriptionId: u
|
|
725
725
|
} = me();
|
|
726
726
|
Se(() => {
|
|
@@ -730,9 +730,9 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
730
730
|
};
|
|
731
731
|
}, [p, y, u]);
|
|
732
732
|
const R = e.useMemo(() => ({
|
|
733
|
-
type:
|
|
734
|
-
}), [
|
|
735
|
-
ref:
|
|
733
|
+
type: v.type
|
|
734
|
+
}), [v.type]), S = ie("p", d, {
|
|
735
|
+
ref: w,
|
|
736
736
|
state: R,
|
|
737
737
|
props: {
|
|
738
738
|
...c,
|
|
@@ -743,34 +743,34 @@ const $e = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
743
743
|
return p ? S : null;
|
|
744
744
|
});
|
|
745
745
|
process.env.NODE_ENV !== "production" && ($e.displayName = "ToastDescription");
|
|
746
|
-
const Ae = /* @__PURE__ */ e.forwardRef(function(d,
|
|
746
|
+
const Ae = /* @__PURE__ */ e.forwardRef(function(d, w) {
|
|
747
747
|
const {
|
|
748
748
|
render: s,
|
|
749
749
|
className: z,
|
|
750
750
|
disabled: P,
|
|
751
|
-
nativeButton:
|
|
751
|
+
nativeButton: _ = !0,
|
|
752
752
|
...c
|
|
753
753
|
} = d, {
|
|
754
|
-
close:
|
|
754
|
+
close: v,
|
|
755
755
|
expanded: r
|
|
756
756
|
} = Re(), {
|
|
757
757
|
toast: p
|
|
758
758
|
} = me(), [y, u] = e.useState(!1), {
|
|
759
759
|
getButtonProps: R,
|
|
760
760
|
buttonRef: S
|
|
761
|
-
} =
|
|
761
|
+
} = _t({
|
|
762
762
|
disabled: P,
|
|
763
|
-
native:
|
|
763
|
+
native: _
|
|
764
764
|
}), M = e.useMemo(() => ({
|
|
765
765
|
type: p.type
|
|
766
766
|
}), [p.type]);
|
|
767
767
|
return ie("button", d, {
|
|
768
|
-
ref: [
|
|
768
|
+
ref: [w, S],
|
|
769
769
|
state: M,
|
|
770
770
|
props: [{
|
|
771
771
|
"aria-hidden": !r && !y,
|
|
772
772
|
onClick() {
|
|
773
|
-
|
|
773
|
+
v(p.id);
|
|
774
774
|
},
|
|
775
775
|
onFocus() {
|
|
776
776
|
u(!0);
|
|
@@ -782,7 +782,7 @@ const Ae = /* @__PURE__ */ e.forwardRef(function(d, v) {
|
|
|
782
782
|
});
|
|
783
783
|
});
|
|
784
784
|
process.env.NODE_ENV !== "production" && (Ae.displayName = "ToastClose");
|
|
785
|
-
const Rt = ft, St = "
|
|
785
|
+
const Rt = ft, St = "_toast__viewport_1wmsz_1", Mt = "_toast_1wmsz_1", Nt = "_toast_variant_neutral_1wmsz_111", Pt = "_toast_variant_colorway_1wmsz_117", Ot = "_toast__content_1wmsz_123", Ct = "_toast__header_1wmsz_141", Ft = "_toast__row_1wmsz_146", It = "_toast__title_1wmsz_153", Lt = "_toast__description_1wmsz_157", U = {
|
|
786
786
|
toast__viewport: St,
|
|
787
787
|
toast: Mt,
|
|
788
788
|
toast_variant_neutral: Nt,
|
|
@@ -790,53 +790,52 @@ 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:
|
|
794
|
-
toast__description:
|
|
795
|
-
|
|
796
|
-
}, un = Ie, ke = {
|
|
793
|
+
toast__title: It,
|
|
794
|
+
toast__description: Lt
|
|
795
|
+
}, cn = Le, Ie = {
|
|
797
796
|
info: "blue",
|
|
798
797
|
error: "red",
|
|
799
798
|
warning: "yellow",
|
|
800
799
|
success: "green"
|
|
801
800
|
};
|
|
802
|
-
function
|
|
803
|
-
return /* @__PURE__ */ E(Rt, { children: /* @__PURE__ */ E(
|
|
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
|
|
806
|
+
const w = d.type && d.type in Ie ? Ie[d.type] : void 0;
|
|
808
807
|
return /* @__PURE__ */ E(
|
|
809
808
|
ze,
|
|
810
809
|
{
|
|
811
810
|
toast: d,
|
|
812
811
|
className: rt(
|
|
813
|
-
|
|
814
|
-
|
|
812
|
+
U.toast,
|
|
813
|
+
w ? U.toast_variant_colorway : U.toast_variant_neutral
|
|
815
814
|
),
|
|
816
|
-
render: /* @__PURE__ */ E(at, { background: "default", color:
|
|
815
|
+
render: /* @__PURE__ */ E(at, { background: "default", color: w }),
|
|
817
816
|
children: /* @__PURE__ */ re(
|
|
818
817
|
xe,
|
|
819
818
|
{
|
|
820
819
|
render: /* @__PURE__ */ E(Ve, {}),
|
|
821
|
-
className:
|
|
820
|
+
className: U.toast__content,
|
|
822
821
|
children: [
|
|
823
|
-
/* @__PURE__ */ re(xe, { className:
|
|
824
|
-
/* @__PURE__ */ re(xe, { className:
|
|
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:
|
|
830
|
+
className: U.toast__title,
|
|
832
831
|
children: d.title
|
|
833
832
|
}
|
|
834
833
|
) : null,
|
|
835
834
|
/* @__PURE__ */ E(
|
|
836
835
|
$e,
|
|
837
836
|
{
|
|
838
|
-
render: /* @__PURE__ */ E(ct, { multiline: !0, color:
|
|
839
|
-
className:
|
|
837
|
+
render: /* @__PURE__ */ E(ct, { multiline: !0, color: w ? "inherit" : "dimmer" }),
|
|
838
|
+
className: U.toast__description
|
|
840
839
|
}
|
|
841
840
|
)
|
|
842
841
|
] }),
|
|
@@ -846,8 +845,7 @@ function Ht() {
|
|
|
846
845
|
render: /* @__PURE__ */ E(
|
|
847
846
|
it,
|
|
848
847
|
{
|
|
849
|
-
|
|
850
|
-
interactive: v ? `${v}_no-fill` : "no-fill",
|
|
848
|
+
interactive: w ? `${w}_no-fill` : "no-fill",
|
|
851
849
|
icon: "close-line",
|
|
852
850
|
size: "sm",
|
|
853
851
|
alt: "Close"
|
|
@@ -860,7 +858,7 @@ function Ht() {
|
|
|
860
858
|
st,
|
|
861
859
|
{
|
|
862
860
|
...d.action,
|
|
863
|
-
interactive:
|
|
861
|
+
interactive: w ? `${w}_fill` : !0,
|
|
864
862
|
children: d.action.children
|
|
865
863
|
}
|
|
866
864
|
) : null
|
|
@@ -873,6 +871,6 @@ function Ht() {
|
|
|
873
871
|
});
|
|
874
872
|
}
|
|
875
873
|
export {
|
|
876
|
-
|
|
877
|
-
|
|
874
|
+
cn as ToastProvider,
|
|
875
|
+
un as ToastViewport
|
|
878
876
|
};
|
|
@@ -3,7 +3,7 @@ import { jsx as O, jsxs as ne } from "react/jsx-runtime";
|
|
|
3
3
|
import { c as Ee } from "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import { textify as Se } from "../../-utils.js";
|
|
5
5
|
import { Surface as xe } from "../surface/index.js";
|
|
6
|
-
import { t as oe, T as be } from "../../tooltip-arrow-
|
|
6
|
+
import { t as oe, T as be } from "../../tooltip-arrow-cs6vjjqZ.js";
|
|
7
7
|
import { R as Oe, P as we, c as N, d as Me, e as Ie, f as Ne, p as $, t as De } from "../../transitions.module-CWX8e5cx.js";
|
|
8
8
|
import * as o from "react";
|
|
9
9
|
import { u as le, T as Ae } from "../../useTimeout-CflX-kz3.js";
|
|
@@ -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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_.colorway
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
.
|
|
1
|
+
._toast__viewport_1wmsz_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_1wmsz_1{right:var(--space-16);bottom:var(--space-16)}}._toast_1wmsz_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_1wmsz_1[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--toast-custom-offset-y));height:var(--toast-height)}._toast_1wmsz_1[data-starting-style],._toast_1wmsz_1[data-ending-style]{transform:translateY(150%)}._toast_1wmsz_1[data-limited],._toast_1wmsz_1[data-ending-style]{opacity:0}._toast_1wmsz_1[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 50%))}._toast_1wmsz_1[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 50%)) translateY(var(--toast-custom-offset-y))}._toast_1wmsz_1[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 50%)) translateY(var(--toast-custom-offset-y))}._toast_1wmsz_1[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 50%))}._toast_1wmsz_1:after{display:block;position:absolute;top:100%;left:0;width:100%;height:calc(var(--toast-custom-gap) + 1px);content:""}._toast_variant_neutral_1wmsz_111{border-color:var(--surface-interactive-border);background:var(--surface-background);color:var(--foreground-default)}._toast_variant_colorway_1wmsz_117{border-color:var(--view-colorway-dimmer);background:var(--view-colorway-dimmest);color:var(--view-colorway-strongest)}._toast__content_1wmsz_123{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_1wmsz_123[data-behind]{opacity:0}._toast__content_1wmsz_123[data-expanded]{opacity:1}._toast__header_1wmsz_141{flex:1 1 auto;gap:var(--space-4)}._toast__row_1wmsz_146{flex:1 1 auto;flex-direction:row;justify-content:space-between;gap:var(--space-4)}._toast__title_1wmsz_153,._toast__description_1wmsz_157{flex:1 1 auto}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { c as r } from "./clsx-OuTLNxxd.js";
|
|
3
|
-
import './tooltip-arrow.css';const i = "
|
|
3
|
+
import './tooltip-arrow.css';const i = "_tooltip_j3wze_1", _ = "_tooltip__arrow_j3wze_10", p = {
|
|
4
4
|
tooltip: i,
|
|
5
5
|
tooltip__arrow: _,
|
|
6
|
-
"tooltip__arrow-icon": "_tooltip__arrow-
|
|
6
|
+
"tooltip__arrow-icon": "_tooltip__arrow-icon_j3wze_35"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function e(t) {
|
|
9
9
|
return /* @__PURE__ */ o(
|
|
10
10
|
"svg",
|
|
11
11
|
{
|
|
@@ -13,12 +13,12 @@ function s(t) {
|
|
|
13
13
|
height: "5",
|
|
14
14
|
viewBox: "0 0 30 10",
|
|
15
15
|
preserveAspectRatio: "none",
|
|
16
|
-
className: r(
|
|
16
|
+
className: r(p["tooltip__arrow-icon"], t.className),
|
|
17
17
|
children: /* @__PURE__ */ o("polygon", { points: "0,0 30,0 15,10" })
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
e as T,
|
|
23
|
+
p as t
|
|
24
24
|
};
|
package/dist/tooltip-arrow.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tooltip_j3wze_1{z-index:49;box-shadow:var(--shadow-1);border:1px solid var(--outline-dimmer);border-radius:var(--border-radius-default);background-color:var(--surface-background);padding:var(--space-4) var(--space-8)}._tooltip__arrow_j3wze_10[data-instant]{transition:none}._tooltip__arrow_j3wze_10[data-side=top]{bottom:-4px}._tooltip__arrow_j3wze_10[data-side=bottom]{top:-4px;rotate:180deg}._tooltip__arrow_j3wze_10[data-side=left]{right:-7px;rotate:-90deg}._tooltip__arrow_j3wze_10[data-side=right]{left:-7px;rotate:90deg}._tooltip__arrow-icon_j3wze_35{display:block;position:relative;fill:var(--surface-background)!important;stroke:var(--outline-dimmer);stroke-dasharray:0 30 22 0 22;stroke-linejoin:round;stroke-width:2;border-top:1px solid var(--surface-background)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koide-labs/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@base-ui/react": "^1.0.0",
|
|
34
|
+
"@npham-dev/cmdk": "^0.0.0",
|
|
34
35
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
35
36
|
"autosize": "^6.0.1",
|
|
36
37
|
"clsx": "^2.1.1",
|
|
37
|
-
"cmdk": "github:npham-dev/cmdk#main&path:/cmdk",
|
|
38
38
|
"date-fns": "^4.1.0",
|
|
39
39
|
"modern-normalize": "^3.0.1",
|
|
40
40
|
"prismjs": "^1.30.0",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^19.2.0",
|
|
47
47
|
"react-dom": "^19.2.0",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
48
|
+
"react-markdown": "^10.1.0",
|
|
49
|
+
"remixicon": "^4.8.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"react-markdown": {
|