@tbox.cn/app-agent-ui-kit 1.0.0-alpha.15 → 1.0.0-alpha.16
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-agent-ui-kit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent 对话壳 UI 组件包(源码发布,单一模板统一化 W2-1):ChatPage/壳组件族/主题 tokens。",
|
|
6
6
|
"exports": {
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"remark-gfm": "4.0.1",
|
|
45
45
|
"yet-another-react-lightbox": "3.33.1",
|
|
46
46
|
"zustand": "4.5.7",
|
|
47
|
-
"@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.
|
|
48
|
-
"@tbox.cn/app-contracts": "1.0.0-alpha.
|
|
47
|
+
"@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.16",
|
|
48
|
+
"@tbox.cn/app-contracts": "1.0.0-alpha.16"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"react": "18.3.1",
|
package/src/overlay/Overlay.tsx
CHANGED
|
@@ -125,7 +125,8 @@ export function Overlay({
|
|
|
125
125
|
>
|
|
126
126
|
{mask ? (
|
|
127
127
|
<div
|
|
128
|
-
|
|
128
|
+
// 根节点已有独立层叠上下文;遮罩留在其底层,不依赖面板动画的 transform 维持层级。
|
|
129
|
+
className={['absolute inset-0 -z-[1] touch-none', maskClassName ?? 'bg-scrim'].filter(Boolean).join(' ')}
|
|
129
130
|
data-tbox-overlay-mask=""
|
|
130
131
|
aria-hidden="true"
|
|
131
132
|
onClick={onMaskClick}
|
|
@@ -62,6 +62,21 @@ function Nested({ opened, onInner }: { opened: boolean; onInner: () => void }) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
describe('Overlay', () => {
|
|
65
|
+
it('遮罩固定在弹层根的底层,不依赖面板入场动画或定位方式', async () => {
|
|
66
|
+
await mount(<Overlay open onDismiss={vi.fn()} placement="none" panelClassName="fixed bottom-0">
|
|
67
|
+
<p>详情正文</p>
|
|
68
|
+
<footer className="sticky bottom-0"><button type="button">立即参与</button></footer>
|
|
69
|
+
</Overlay>);
|
|
70
|
+
const overlay = document.querySelector('[data-tbox-overlay]') as HTMLElement;
|
|
71
|
+
const mask = overlay.querySelector('[data-tbox-overlay-mask]') as HTMLElement;
|
|
72
|
+
const panel = overlay.querySelector('[data-tbox-overlay-panel]') as HTMLElement;
|
|
73
|
+
expect(overlay.classList.contains('fixed')).toBe(true);
|
|
74
|
+
expect(overlay.classList.contains('z-[1100]')).toBe(true);
|
|
75
|
+
expect(mask.classList.contains('-z-[1]')).toBe(true);
|
|
76
|
+
expect(panel.classList.contains('fixed')).toBe(true);
|
|
77
|
+
expect(panel.classList.contains('relative')).toBe(false);
|
|
78
|
+
});
|
|
79
|
+
|
|
65
80
|
it('传送进 body,面板带 role/aria 与题注', async () => {
|
|
66
81
|
await mount(<Sheet onDismiss={vi.fn()} />);
|
|
67
82
|
const dialog = document.querySelector('[role="dialog"]') as HTMLElement;
|