You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a DialogWidget for modal overlays — the TUI equivalent of HTML <dialog>. Use cases: confirmation prompts ("Are you sure?"), alerts, modal input forms.
Expected API
typeDialogWidgetOptions={x?,y?,width?,height?: TuiSizeValue;open?: boolean;// controlled open statemodal?: boolean;// default true — blocks input to widgets behinddismissable?: boolean;// default true — Escape / backdrop click closes// children: composable like Box (Dialog is a container)};
Behavior
Modal overlay: when modal: true, widgets behind the dialog do not receive input events. The scene's painter's-algorithm zIndex already supports layering (see TuiScene); needs an input-blocking overlay layer on top.
Summary
Add a
DialogWidgetfor modal overlays — the TUI equivalent of HTML<dialog>. Use cases: confirmation prompts ("Are you sure?"), alerts, modal input forms.Expected API
Behavior
modal: true, widgets behind the dialog do not receive input events. The scene's painter's-algorithmzIndexalready supports layering (seeTuiScene); needs an input-blocking overlay layer on top.dismissable. Backdrop click closes whendismissable && modal.closeevent with{reason: 'escape' | 'backdrop' | 'programmatic'}.Open design questions
zIndexsufficient?modal: false(modeless panels) be supported in v1?Context
Identified in the now-removed
docs/missing-widgets.mdas an important widget for TUI UX. Depends on the focus infrastructure from #32.Affected directory:
packages/core/src/widgets/dialog/(new)概要
新增
DialogWidget模态覆盖层 —— HTML<dialog>的 TUI 等价物。典型场景:确认提示("是否确定?")、警告框、模态输入表单。期望 API
行为
modal: true时,对话框后方的 widget 不接收输入事件。Scene 的画家算法zIndex已支持分层(参见TuiScene);需要在之上增加输入拦截层。dismissable时按 Escape 关闭;当dismissable && modal时点击背景关闭。close事件携带{reason: 'escape' | 'backdrop' | 'programmatic'}。待定设计问题
zIndex已足够?modal: false(非模态面板)?背景
此项来自已移除的
docs/missing-widgets.md,识别为重要的 TUI UX widget。依赖 #32 提供的焦点基础设施。受影响目录:
packages/core/src/widgets/dialog/(新增)