iter: b02 新增 toast 消息提示组件(四语义工厂 + 右上角堆叠 + 3s 自动消失)
This commit is contained in:
+2
-2
@@ -14,8 +14,8 @@
|
||||
"title": "新增 toast 消息提示组件",
|
||||
"motivation": "alert 是常驻块级元素,缺少轻量转瞬即逝的全局反馈;操作成功/失败场景刚需",
|
||||
"acceptance": "新增 toast.ts:toast.success/error/warning/info 四个工厂函数,入参 {message, duration?},默认 3s 自动消失,右上角堆叠,语义色复用四档 variant,出入场微动画 + prefers-reduced-motion 兜底;导出、manifest、文档、llms-full.txt 同步;npm run check 全绿",
|
||||
"status": "open",
|
||||
"notes": ""
|
||||
"status": "done",
|
||||
"notes": "对外暴露 toast.info/success/warning/error(message, duration?) 四工厂 + showToast(props) 完整入参版;全局堆叠容器懒创建,role=status 无障碍;退场用 transitionend 移除并带 320ms 兜底(覆盖 reduced-motion 下 transition 不触发的情况);样式复用 alert 语义色 color-mix 模式,reduced-motion 列表已补 .ua-toast;demo 新增 sec-toast 区块"
|
||||
},
|
||||
{
|
||||
"id": "b03",
|
||||
|
||||
+35
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "ui-arch-registry-index/0.1",
|
||||
"generatedAt": "2026-10-23T07:34:01.200Z",
|
||||
"generatedAt": "2026-10-23T07:49:42.422Z",
|
||||
"repoRoot": ".",
|
||||
"packages": [
|
||||
{
|
||||
@@ -130,7 +130,7 @@
|
||||
{
|
||||
"name": "@ui-arch/ui",
|
||||
"type": "skin-dom",
|
||||
"description": "DOM 皮肤组件库:button / textField / textarea / checkbox / switch / select / radioGroup / card / badge / alert / tooltip / spinner / progress / tabs / modal / form / formItem / dataTable,构建在 @ui-arch/frame 与 @ui-arch/table-core 之上,样式只消费 --ua-* 令牌。",
|
||||
"description": "DOM 皮肤组件库:button / textField / textarea / checkbox / switch / select / radioGroup / card / badge / alert / toast / tooltip / spinner / progress / tabs / modal / form / formItem / dataTable,构建在 @ui-arch/frame 与 @ui-arch/table-core 之上,样式只消费 --ua-* 令牌。",
|
||||
"tags": [
|
||||
"components",
|
||||
"dom",
|
||||
@@ -152,6 +152,7 @@
|
||||
"card(props, ...children):卡片容器",
|
||||
"badge(props):徽标,variant = default | success | warning | danger",
|
||||
"alert(props):提示条,variant = info | success | warning | danger",
|
||||
"toast.info/success/warning/error(message, duration?):消息提示工厂,右上角堆叠,默认 3s 自动消失,出入场微动画;showToast(props) 为完整入参版本",
|
||||
"tooltip(props, trigger):悬浮提示,包裹触发器,hover / focus 延迟 150ms 出场,移出 / 失焦 / Esc 收起",
|
||||
"spinner(props):加载指示器,size 控制直径",
|
||||
"progress(props):进度条,轨道 + 渐变流动填充,value 信号驱动 0-100,满格切 success 色",
|
||||
@@ -173,6 +174,7 @@
|
||||
"CardProps",
|
||||
"BadgeProps",
|
||||
"AlertProps",
|
||||
"ToastProps",
|
||||
"TooltipProps",
|
||||
"SpinnerProps",
|
||||
"ProgressProps",
|
||||
@@ -192,7 +194,7 @@
|
||||
"语义色 variant 四档:default|info / success / warning / danger,一律来自令牌,禁止硬编码颜色"
|
||||
],
|
||||
"docs": {
|
||||
"intro": "17 个 DOM 组件,统一用法:组件是普通函数,传入 props 返回 DOM 节点;需要状态时先创建 signal 再双向绑定。引入 CSS:import '@ui-arch/ui/ui.css'(内部已消费 tokens)。",
|
||||
"intro": "18 个 DOM 组件,统一用法:组件是普通函数,传入 props 返回 DOM 节点;需要状态时先创建 signal 再双向绑定。引入 CSS:import '@ui-arch/ui/ui.css'(内部已消费 tokens)。",
|
||||
"steps": [
|
||||
"安装依赖:pnpm add @ui-arch/ui @ui-arch/frame(workspace 内自动链接)",
|
||||
"引入样式:在应用入口 import '@ui-arch/ui/ui.css',暗色主题在根元素设 data-theme='dark'",
|
||||
@@ -487,6 +489,36 @@
|
||||
"传入 message 即可,入场自带下滑动画"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "toast",
|
||||
"title": "消息提示 Toast",
|
||||
"demo": "sec-toast",
|
||||
"props": [
|
||||
{
|
||||
"n": "message",
|
||||
"t": "string",
|
||||
"r": 1,
|
||||
"d": "提示文案"
|
||||
},
|
||||
{
|
||||
"n": "duration",
|
||||
"t": "number",
|
||||
"d": "自动消失毫秒;缺省 3000"
|
||||
},
|
||||
{
|
||||
"n": "variant",
|
||||
"t": "'info' | 'success' | 'warning' | 'danger'",
|
||||
"d": "语义色;缺省 info(toast.error 对应 danger)"
|
||||
}
|
||||
],
|
||||
"example": "toast.success('保存成功'); toast.error('网络请求失败', 5000)",
|
||||
"steps": [
|
||||
"直接调用语义工厂:toast.info / success / warning / error(message, duration?),无需先建容器",
|
||||
"不传 duration 时默认停留 3 秒后自动淡出并移除节点",
|
||||
"多条消息在右上角自动纵向堆叠,互不遮挡",
|
||||
"需要完整入参(含 variant)时用 showToast(props);组件挂载容器由内部懒创建,样式随 ui.css 一起引入"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tooltip",
|
||||
"title": "悬浮提示 Tooltip",
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
{"time":"2026-10-23T15:47:00+08:00","id":"b01","result":"done","summary":"新增 tooltip 悬浮提示组件(包裹式 API / 150ms 延迟 / Esc 收起 / reduced-motion 兜底),同步 manifest + llms-full.txt + demo 区块,并修复 ua style 对 URL 中 // 的误判;npm run check 全绿"}
|
||||
{"time":"2026-10-23T15:50:03+08:00","id":"b02","result":"done","summary":"新增 toast 消息提示组件:四语义工厂 + showToast,右上角堆叠,默认 3s 自动消失,微动画 + reduced-motion 兜底;manifest/docs/llms 同步,check 全绿"}
|
||||
|
||||
Reference in New Issue
Block a user