@robert-stackflow/oneui 0.6.61 → 0.6.63
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/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/components/Popover.js +28 -11
- package/components/Toast.js +1 -1
- package/components/Toast.module.css +98 -26
- package/components/ToastStack.js +20 -18
- package/components/motion.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 0.6.63
|
|
2
|
+
|
|
3
|
+
- Redesign Toast as compact theme-aware cards that fan out into one notification panel. Both states hide scrollbar tracks and expanded messages remain scrollable.
|
|
4
|
+
- Keep the toast layer stable while messages change and soften the transition between collapsed and expanded layouts.
|
|
5
|
+
|
|
6
|
+
## 0.6.62
|
|
7
|
+
|
|
8
|
+
- Fix popover dismissal in closed shadow roots so select options and trigger clicks work normally.
|
|
9
|
+
|
|
1
10
|
## 0.6.61
|
|
2
11
|
|
|
3
12
|
- Keep editable control typography consistent in narrow windows. Touch input keeps its existing font size.
|
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ Section 支持 headingLevel(2–6,默认 2)和 contentLayout="settings";
|
|
|
103
103
|
|
|
104
104
|
提示横幅主入口改为 `Banner`,两端应用与示例均使用新名称。支持五种 tone、soft/outline/filled 变体、compact、图标、标题、操作、关闭,以及受控或内部状态的可展开 details。旧的 `Alert` 仅保留兼容别名,不维护另一套实现。
|
|
105
105
|
|
|
106
|
-
Toast
|
|
106
|
+
Toast 收起时显示紧凑的叠卡,最新消息在前,后层逐层缩小并露出边缘。悬停、键盘聚焦或点击数量按钮展开为同一面板,按 Escape 收起。`ToastProvider maxVisible` 默认 3,控制收起时露出的卡片层数,展开可访问整组通知。组内按实际高度排列,超出视口时可在通知区域滚动,滚动条轨道保持隐藏;六个位置均使用受约束的原生顶层浮层。深色与柔和样式的按钮分别保持悬停、按下和键盘焦点对比度。
|
|
107
107
|
|
|
108
108
|
只有前台可读的消息计时;展开、悬停、聚焦及异步操作暂停计时,恢复后继续剩余时长。`notify(message,{id:"task"})` 用同一个 id 原位更新异步任务并重置该消息的时长。`createToaster().getSnapshot()` 仍返回最新一条,`getQueueSnapshot()` 返回队列;带 id 的 dismiss/clear 只影响对应消息,无参时作用于全部消息。旧关闭函数不会影响后来的其他消息。独立使用的 `Toast` 保留原生浮层与已有调用方式。
|
|
109
109
|
|
package/components/Popover.js
CHANGED
|
@@ -160,13 +160,26 @@ function Popover({
|
|
|
160
160
|
subtree: true,
|
|
161
161
|
characterData: true
|
|
162
162
|
});
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
const document = surface.ownerDocument;
|
|
164
|
+
const shadows = /* @__PURE__ */ new Set();
|
|
165
|
+
for (const element of [surface, trigger]) {
|
|
166
|
+
let root2 = element.getRootNode();
|
|
167
|
+
while (root2 instanceof ShadowRoot) {
|
|
168
|
+
shadows.add(root2);
|
|
169
|
+
root2 = root2.host.getRootNode();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const eventRoots = [document, ...shadows];
|
|
173
|
+
const dismissed = /* @__PURE__ */ new WeakSet();
|
|
174
|
+
const dismissOutside = (event) => {
|
|
175
|
+
if (dismissed.has(event)) return;
|
|
176
|
+
const path = event.composedPath();
|
|
177
|
+
if (path.includes(surface) || path.includes(trigger)) return;
|
|
178
|
+
for (const root2 of shadows) {
|
|
179
|
+
if (path.includes(root2.host) && !path.includes(root2)) return;
|
|
180
|
+
}
|
|
181
|
+
dismissed.add(event);
|
|
182
|
+
close.current();
|
|
170
183
|
};
|
|
171
184
|
const key = (event) => {
|
|
172
185
|
if (event.key === "Escape") {
|
|
@@ -178,9 +191,11 @@ function Popover({
|
|
|
178
191
|
trigger.focus();
|
|
179
192
|
}
|
|
180
193
|
};
|
|
181
|
-
|
|
194
|
+
for (const root2 of eventRoots) {
|
|
195
|
+
root2.addEventListener("pointerdown", dismissOutside, true);
|
|
196
|
+
root2.addEventListener("focusin", dismissOutside, true);
|
|
197
|
+
}
|
|
182
198
|
document.addEventListener("keydown", key, true);
|
|
183
|
-
document.addEventListener("focusin", focus, true);
|
|
184
199
|
window.addEventListener("resize", position);
|
|
185
200
|
window.addEventListener("scroll", position, true);
|
|
186
201
|
window.visualViewport?.addEventListener("resize", position);
|
|
@@ -188,9 +203,11 @@ function Popover({
|
|
|
188
203
|
return () => {
|
|
189
204
|
observer.disconnect();
|
|
190
205
|
contentObserver?.disconnect();
|
|
191
|
-
|
|
206
|
+
for (const root2 of eventRoots) {
|
|
207
|
+
root2.removeEventListener("pointerdown", dismissOutside, true);
|
|
208
|
+
root2.removeEventListener("focusin", dismissOutside, true);
|
|
209
|
+
}
|
|
192
210
|
document.removeEventListener("keydown", key, true);
|
|
193
|
-
document.removeEventListener("focusin", focus, true);
|
|
194
211
|
window.removeEventListener("resize", position);
|
|
195
212
|
window.removeEventListener("scroll", position, true);
|
|
196
213
|
window.visualViewport?.removeEventListener("resize", position);
|
package/components/Toast.js
CHANGED
|
@@ -150,7 +150,7 @@ function Toast({
|
|
|
150
150
|
const icon = options.icon === false ? null : options.icon === true || options.icon === void 0 ? tone !== "neutral" || options.icon === true ? /* @__PURE__ */ jsx(Icon, {}) : null : options.icon;
|
|
151
151
|
const style = {
|
|
152
152
|
"--toast-stack-offset": `${stackOffset}px`,
|
|
153
|
-
"--toast-stack-scale": stackExpanded ? 1 : Math.max(0.
|
|
153
|
+
"--toast-stack-scale": stackExpanded ? 1 : Math.max(0.82, 1 - stackIndex * 0.055),
|
|
154
154
|
"--toast-stack-height": stackHeight === void 0 ? void 0 : `${stackHeight}px`,
|
|
155
155
|
zIndex: 1e3 - stackIndex,
|
|
156
156
|
"--toast-icon-color": options.iconColor,
|
|
@@ -19,26 +19,33 @@
|
|
|
19
19
|
}
|
|
20
20
|
.region {
|
|
21
21
|
position: absolute;
|
|
22
|
-
width: min(
|
|
22
|
+
width: min(380px, 100%);
|
|
23
23
|
max-height: 100%;
|
|
24
24
|
box-sizing: border-box;
|
|
25
|
-
padding:
|
|
26
|
-
overflow
|
|
27
|
-
overflow-y: auto;
|
|
28
|
-
overscroll-behavior: contain;
|
|
29
|
-
scrollbar-gutter: stable both-edges;
|
|
25
|
+
padding: 16px 16px 24px;
|
|
26
|
+
overflow: visible;
|
|
30
27
|
pointer-events: none;
|
|
31
28
|
}
|
|
32
29
|
.region[data-expanded="true"] {
|
|
30
|
+
overflow: hidden auto;
|
|
31
|
+
overscroll-behavior: contain;
|
|
33
32
|
pointer-events: auto;
|
|
34
33
|
}
|
|
34
|
+
.region,
|
|
35
|
+
.content {
|
|
36
|
+
scrollbar-width: none;
|
|
37
|
+
}
|
|
38
|
+
.region::-webkit-scrollbar,
|
|
39
|
+
.content::-webkit-scrollbar {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
35
42
|
.region[data-position^="top"] {
|
|
36
43
|
top: 0;
|
|
37
44
|
}
|
|
38
45
|
.region[data-position^="bottom"] {
|
|
39
46
|
bottom: 0;
|
|
40
|
-
padding-top:
|
|
41
|
-
padding-bottom:
|
|
47
|
+
padding-top: 24px;
|
|
48
|
+
padding-bottom: 16px;
|
|
42
49
|
}
|
|
43
50
|
.region[data-position$="left"] {
|
|
44
51
|
left: 4px;
|
|
@@ -53,25 +60,51 @@
|
|
|
53
60
|
.stack {
|
|
54
61
|
position: relative;
|
|
55
62
|
width: 100%;
|
|
63
|
+
isolation: isolate;
|
|
64
|
+
}
|
|
65
|
+
.stack::before {
|
|
66
|
+
content: "";
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0 -6px;
|
|
69
|
+
border: 1px solid var(--line);
|
|
70
|
+
border-radius: 16px;
|
|
71
|
+
background: var(--surface);
|
|
72
|
+
box-shadow:
|
|
73
|
+
0 12px 32px #00000026,
|
|
74
|
+
0 2px 6px #00000012;
|
|
75
|
+
opacity: 0;
|
|
76
|
+
scale: 0.97;
|
|
77
|
+
transform-origin: top center;
|
|
78
|
+
transition:
|
|
79
|
+
opacity 200ms ease-out,
|
|
80
|
+
scale 280ms cubic-bezier(0.2, 0.75, 0.25, 1);
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
.region[data-position^="bottom"] .stack::before {
|
|
84
|
+
transform-origin: bottom center;
|
|
85
|
+
}
|
|
86
|
+
.region[data-expanded="true"] .stack::before {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
scale: 1;
|
|
56
89
|
}
|
|
57
90
|
.toast {
|
|
58
91
|
--tone: #c4c4c4;
|
|
59
92
|
--soft-tone: #555;
|
|
60
|
-
--toast-control:
|
|
61
|
-
--toast-control-hover:
|
|
62
|
-
--toast-control-active:
|
|
93
|
+
--toast-control: color-mix(in srgb, var(--fg) 6%, transparent);
|
|
94
|
+
--toast-control-hover: color-mix(in srgb, var(--fg) 12%, transparent);
|
|
95
|
+
--toast-control-active: color-mix(in srgb, var(--fg) 18%, transparent);
|
|
63
96
|
--toast-stack-sign: 1;
|
|
64
97
|
position: fixed;
|
|
65
98
|
inset: auto;
|
|
66
99
|
margin: 0;
|
|
67
100
|
padding: 0;
|
|
68
|
-
border: 1px solid
|
|
69
|
-
border-radius:
|
|
101
|
+
border: 1px solid var(--line);
|
|
102
|
+
border-radius: 12px;
|
|
70
103
|
box-sizing: border-box;
|
|
71
|
-
width: min(
|
|
104
|
+
width: min(348px, calc(100vw - 32px));
|
|
72
105
|
max-width: none;
|
|
73
|
-
background:
|
|
74
|
-
color: var(--toast-text-color,
|
|
106
|
+
background: var(--surface);
|
|
107
|
+
color: var(--toast-text-color, var(--fg));
|
|
75
108
|
box-shadow:
|
|
76
109
|
0 8px 24px #00000016,
|
|
77
110
|
0 2px 6px #0000000c;
|
|
@@ -85,8 +118,11 @@
|
|
|
85
118
|
)
|
|
86
119
|
scale(var(--toast-stack-scale, 1));
|
|
87
120
|
transition:
|
|
88
|
-
transform
|
|
89
|
-
height
|
|
121
|
+
transform 320ms cubic-bezier(0.18, 0.8, 0.24, 1),
|
|
122
|
+
height 280ms cubic-bezier(0.18, 0.8, 0.24, 1),
|
|
123
|
+
background-color 180ms ease-out,
|
|
124
|
+
border-color 180ms ease-out,
|
|
125
|
+
box-shadow 180ms ease-out;
|
|
90
126
|
will-change: transform, opacity;
|
|
91
127
|
}
|
|
92
128
|
.toast:popover-open,
|
|
@@ -96,8 +132,8 @@
|
|
|
96
132
|
.content {
|
|
97
133
|
display: flex;
|
|
98
134
|
align-items: center;
|
|
99
|
-
gap:
|
|
100
|
-
padding:
|
|
135
|
+
gap: 8px;
|
|
136
|
+
padding: 9px 10px;
|
|
101
137
|
box-sizing: border-box;
|
|
102
138
|
max-height: min(320px, calc(100dvh - 80px));
|
|
103
139
|
overflow: auto;
|
|
@@ -126,14 +162,16 @@
|
|
|
126
162
|
display: grid;
|
|
127
163
|
place-items: center;
|
|
128
164
|
flex-shrink: 0;
|
|
129
|
-
width:
|
|
130
|
-
height:
|
|
131
|
-
|
|
165
|
+
width: 24px;
|
|
166
|
+
height: 24px;
|
|
167
|
+
border-radius: 7px;
|
|
168
|
+
background: color-mix(in srgb, var(--soft-tone) 10%, transparent);
|
|
169
|
+
color: var(--toast-icon-color, var(--soft-tone));
|
|
132
170
|
}
|
|
133
171
|
.icon svg {
|
|
134
172
|
display: block;
|
|
135
|
-
width:
|
|
136
|
-
height:
|
|
173
|
+
width: 16px;
|
|
174
|
+
height: 16px;
|
|
137
175
|
}
|
|
138
176
|
.toast button {
|
|
139
177
|
appearance: none;
|
|
@@ -265,6 +303,12 @@
|
|
|
265
303
|
.content {
|
|
266
304
|
visibility: hidden;
|
|
267
305
|
}
|
|
306
|
+
.toast[data-embedded="true"][data-stack-expanded="false"]:not(
|
|
307
|
+
[data-stack-index="0"]
|
|
308
|
+
) {
|
|
309
|
+
background: color-mix(in srgb, var(--fg) 7%, var(--surface));
|
|
310
|
+
box-shadow: 0 3px 6px #00000015;
|
|
311
|
+
}
|
|
268
312
|
.toast[data-stack-hidden="true"] {
|
|
269
313
|
visibility: hidden;
|
|
270
314
|
pointer-events: none;
|
|
@@ -277,6 +321,27 @@
|
|
|
277
321
|
:global([data-theme="dark"]) .toast[data-variant="soft"] {
|
|
278
322
|
--soft-tone: var(--tone);
|
|
279
323
|
}
|
|
324
|
+
:global([data-theme="dark"]) .toast .icon {
|
|
325
|
+
color: var(--toast-icon-color, var(--tone));
|
|
326
|
+
background: color-mix(in srgb, var(--tone) 12%, transparent);
|
|
327
|
+
}
|
|
328
|
+
.toast[data-embedded="true"][data-stack-expanded="true"] {
|
|
329
|
+
border-color: transparent;
|
|
330
|
+
border-radius: 9px;
|
|
331
|
+
box-shadow: none;
|
|
332
|
+
background: var(--surface);
|
|
333
|
+
}
|
|
334
|
+
.toast[data-stack-expanded="true"] .content:not(:has(.icon)) {
|
|
335
|
+
padding-inline-start: 42px;
|
|
336
|
+
}
|
|
337
|
+
.toast[data-embedded="true"][data-stack-expanded="true"]:not(
|
|
338
|
+
[data-stack-index="0"]
|
|
339
|
+
):hover {
|
|
340
|
+
background: color-mix(in srgb, var(--fg) 4%, var(--surface));
|
|
341
|
+
}
|
|
342
|
+
.toast[data-embedded="true"][data-stack-expanded="true"][data-variant="soft"] {
|
|
343
|
+
background: color-mix(in srgb, var(--soft-tone) 8%, var(--surface));
|
|
344
|
+
}
|
|
280
345
|
.spin {
|
|
281
346
|
animation: spin 1s linear infinite;
|
|
282
347
|
}
|
|
@@ -286,10 +351,17 @@
|
|
|
286
351
|
}
|
|
287
352
|
}
|
|
288
353
|
@media (prefers-reduced-motion: reduce) {
|
|
289
|
-
.toast
|
|
354
|
+
.toast,
|
|
355
|
+
.stack::before {
|
|
290
356
|
transition: none;
|
|
291
357
|
}
|
|
292
358
|
.spin {
|
|
293
359
|
animation: none;
|
|
294
360
|
}
|
|
295
361
|
}
|
|
362
|
+
:global(html[data-motion="false"]) .toast,
|
|
363
|
+
:global(html[data-motion="false"]) .stack::before,
|
|
364
|
+
:global(html[data-motion="off"]) .toast,
|
|
365
|
+
:global(html[data-motion="off"]) .stack::before {
|
|
366
|
+
transition: none;
|
|
367
|
+
}
|
package/components/ToastStack.js
CHANGED
|
@@ -10,6 +10,10 @@ import { createPortal } from "react-dom";
|
|
|
10
10
|
import { Toast } from "./Toast.js";
|
|
11
11
|
import { useUIText } from "./useUIText.js";
|
|
12
12
|
import s from "./Toast.module.css";
|
|
13
|
+
const ESTIMATED_HEIGHT = 50;
|
|
14
|
+
const CARD_PEEK = 9;
|
|
15
|
+
const LIST_PADDING = 6;
|
|
16
|
+
const LIST_GAP = 4;
|
|
13
17
|
function ToastStack({
|
|
14
18
|
position,
|
|
15
19
|
messages,
|
|
@@ -72,11 +76,6 @@ function ToastStack({
|
|
|
72
76
|
host.remove();
|
|
73
77
|
};
|
|
74
78
|
}, [host]);
|
|
75
|
-
useLayoutEffect(() => {
|
|
76
|
-
const node = viewport.current;
|
|
77
|
-
if (node.matches(":popover-open")) node.hidePopover();
|
|
78
|
-
node.showPopover();
|
|
79
|
-
}, [newest]);
|
|
80
79
|
useEffect(() => () => clearTimeout(timer.current), []);
|
|
81
80
|
useEffect(() => {
|
|
82
81
|
const ids = new Set(messages.map((message) => String(message.id)));
|
|
@@ -88,19 +87,22 @@ function ToastStack({
|
|
|
88
87
|
setExpanded(false);
|
|
89
88
|
}
|
|
90
89
|
}, [messages]);
|
|
91
|
-
let offset =
|
|
92
|
-
const frontHeight = heights[newest] ??
|
|
90
|
+
let offset = LIST_PADDING;
|
|
91
|
+
const frontHeight = heights[newest] ?? ESTIMATED_HEIGHT;
|
|
92
|
+
const listOpen = expanded && messages.length > 1;
|
|
93
93
|
const offsets = messages.map((toast) => {
|
|
94
94
|
const value = offset;
|
|
95
|
-
offset += (heights[toast.id] ??
|
|
95
|
+
offset += (heights[toast.id] ?? ESTIMATED_HEIGHT) + LIST_GAP;
|
|
96
96
|
return value;
|
|
97
97
|
});
|
|
98
|
-
const height =
|
|
98
|
+
const height = listOpen ? offset - LIST_GAP + LIST_PADDING : frontHeight + Math.min(messages.length - 1, maxVisible - 1) * CARD_PEEK;
|
|
99
99
|
useLayoutEffect(() => {
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
const node = region.current;
|
|
101
|
+
if (node && !listOpen) node.scrollTop = 0;
|
|
102
|
+
else if (node && position.startsWith("bottom")) {
|
|
103
|
+
node.scrollTop = node.scrollHeight;
|
|
102
104
|
}
|
|
103
|
-
}, [
|
|
105
|
+
}, [listOpen, position, height]);
|
|
104
106
|
return createPortal(
|
|
105
107
|
/* @__PURE__ */ jsx(
|
|
106
108
|
"div",
|
|
@@ -116,7 +118,7 @@ function ToastStack({
|
|
|
116
118
|
ref: region,
|
|
117
119
|
className: s.region,
|
|
118
120
|
"data-position": position,
|
|
119
|
-
"data-expanded":
|
|
121
|
+
"data-expanded": listOpen,
|
|
120
122
|
role: "region",
|
|
121
123
|
"aria-label": text("\u901A\u77E5", "Notifications", "\u901A\u77E5"),
|
|
122
124
|
onPointerEnter: (event) => {
|
|
@@ -161,17 +163,17 @@ function ToastStack({
|
|
|
161
163
|
position,
|
|
162
164
|
onDismiss,
|
|
163
165
|
stackIndex: index,
|
|
164
|
-
stackOffset:
|
|
165
|
-
stackExpanded:
|
|
166
|
-
stackHidden: !
|
|
167
|
-
stackHeight: !
|
|
166
|
+
stackOffset: listOpen ? offsets[index] : index * CARD_PEEK,
|
|
167
|
+
stackExpanded: listOpen,
|
|
168
|
+
stackHidden: !listOpen && index >= maxVisible,
|
|
169
|
+
stackHeight: !listOpen && index > 0 ? frontHeight : void 0,
|
|
168
170
|
stackCount: index === 0 ? messages.length : void 0,
|
|
169
171
|
onStackToggle: () => {
|
|
170
172
|
interaction.current.pinned = !expanded;
|
|
171
173
|
interaction.current.suppressed = expanded;
|
|
172
174
|
setExpanded(!expanded);
|
|
173
175
|
},
|
|
174
|
-
paused:
|
|
176
|
+
paused: listOpen || index > 0,
|
|
175
177
|
onHeightChange: (value) => setHeights(
|
|
176
178
|
(old) => old[toast.id] === value ? old : { ...old, [toast.id]: value }
|
|
177
179
|
)
|
package/components/motion.js
CHANGED
|
@@ -21,11 +21,11 @@ function runMotion(node, phase, offset = "0 -4px", token, profile = "surface") {
|
|
|
21
21
|
runs.set(node, state);
|
|
22
22
|
const revision = ++state.revision, interrupted = !!state.animation, style = getComputedStyle(node);
|
|
23
23
|
const from = {
|
|
24
|
-
opacity: interrupted ? style.opacity : phase === "enter" ? "0" : phase === "update" ? ".78" : "1",
|
|
24
|
+
opacity: interrupted ? style.opacity : phase === "enter" ? "0" : phase === "update" ? profile === "toast" ? ".94" : ".78" : "1",
|
|
25
25
|
translate: interrupted ? style.translate : phase === "enter" ? offset : phase === "update" ? profile === "toast" ? "0 0" : "0 2px" : "0 0"
|
|
26
26
|
};
|
|
27
27
|
const scale = profile !== "surface" ? {
|
|
28
|
-
scale: interrupted ? style.scale : phase === "enter" ? profile === "toast" ? ".
|
|
28
|
+
scale: interrupted ? style.scale : phase === "enter" ? profile === "toast" ? ".975" : ".97" : "1"
|
|
29
29
|
} : {};
|
|
30
30
|
Object.assign(from, scale);
|
|
31
31
|
state.animation?.cancel();
|
|
@@ -52,7 +52,7 @@ function runMotion(node, phase, offset = "0 -4px", token, profile = "surface") {
|
|
|
52
52
|
if (!duration || !node.isConnected) return Promise.resolve(finish());
|
|
53
53
|
const animation = node.animate([from, to], {
|
|
54
54
|
duration,
|
|
55
|
-
easing: profile === "toast" ? phase === "exit" ? "cubic-bezier(.
|
|
55
|
+
easing: profile === "toast" ? phase === "exit" ? "cubic-bezier(.32,0,.7,1)" : "cubic-bezier(.2,.8,.24,1)" : getComputedStyle(document.documentElement).getPropertyValue("--ease").trim() || "ease-out",
|
|
56
56
|
fill: "both"
|
|
57
57
|
});
|
|
58
58
|
state.animation = animation;
|
|
@@ -76,7 +76,7 @@ function surfaceMotion(node, phase, offset = "0 -4px", token) {
|
|
|
76
76
|
return runMotion(node, phase, offset, token);
|
|
77
77
|
}
|
|
78
78
|
function toastMotion(node, phase, position) {
|
|
79
|
-
const offset = position.endsWith("right") ? "
|
|
79
|
+
const offset = position.endsWith("right") ? "10px 0" : position.endsWith("left") ? "-10px 0" : position.startsWith("top") ? "0 -8px" : "0 8px";
|
|
80
80
|
return runMotion(node, phase, offset, `--toast-${phase}`, "toast");
|
|
81
81
|
}
|
|
82
82
|
function popoverSurfaceMotion(node, phase, side = "bottom") {
|