iter: b01 新增 tooltip 悬浮提示组件
- packages/skin/ui/src/tooltip.ts:包裹式 API tooltip(props, trigger),hover/focus 150ms 延迟出场,移出/失焦/Esc 收起 - types.ts 增 TooltipProps;index.ts 导出;ui.css 增气泡样式(纯 --ua-* 令牌 + 出入场过渡 + reduced-motion 兜底) - ua.manifest.json / llms-full.txt / .ua/index.json / llms.txt 同步;demo 增 sec-tooltip 区块 - backlog b01 置 done,iterations.log 留痕
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@ui-arch/ui",
|
||||
"type": "skin-dom",
|
||||
"description": "DOM 皮肤组件库:button / textField / textarea / checkbox / switch / select / radioGroup / card / badge / alert / 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 / tooltip / spinner / progress / tabs / modal / form / formItem / dataTable,构建在 @ui-arch/frame 与 @ui-arch/table-core 之上,样式只消费 --ua-* 令牌。",
|
||||
"tags": [
|
||||
"components",
|
||||
"dom",
|
||||
@@ -23,6 +23,7 @@
|
||||
"card(props, ...children):卡片容器",
|
||||
"badge(props):徽标,variant = default | success | warning | danger",
|
||||
"alert(props):提示条,variant = info | success | warning | danger",
|
||||
"tooltip(props, trigger):悬浮提示,包裹触发器,hover / focus 延迟 150ms 出场,移出 / 失焦 / Esc 收起",
|
||||
"spinner(props):加载指示器,size 控制直径",
|
||||
"progress(props):进度条,轨道 + 渐变流动填充,value 信号驱动 0-100,满格切 success 色",
|
||||
"tabs(props):标签页,active 信号双向绑定,滑动指示条 + 方向键环形导航,支持禁用页签",
|
||||
@@ -43,6 +44,7 @@
|
||||
"CardProps",
|
||||
"BadgeProps",
|
||||
"AlertProps",
|
||||
"TooltipProps",
|
||||
"SpinnerProps",
|
||||
"ProgressProps",
|
||||
"TabsProps",
|
||||
@@ -61,7 +63,7 @@
|
||||
"语义色 variant 四档:default|info / success / warning / danger,一律来自令牌,禁止硬编码颜色"
|
||||
],
|
||||
"docs": {
|
||||
"intro": "16 个 DOM 组件,统一用法:组件是普通函数,传入 props 返回 DOM 节点;需要状态时先创建 signal 再双向绑定。引入 CSS:import '@ui-arch/ui/ui.css'(内部已消费 tokens)。",
|
||||
"intro": "17 个 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'",
|
||||
@@ -356,6 +358,44 @@
|
||||
"传入 message 即可,入场自带下滑动画"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "tooltip",
|
||||
"title": "悬浮提示 Tooltip",
|
||||
"demo": "sec-tooltip",
|
||||
"props": [
|
||||
{
|
||||
"n": "content",
|
||||
"t": "string",
|
||||
"r": 1,
|
||||
"d": "提示文案(纯文本)"
|
||||
},
|
||||
{
|
||||
"n": "placement",
|
||||
"t": "'top' | 'bottom'",
|
||||
"d": "气泡方位;缺省 top(触发器上方)"
|
||||
},
|
||||
{
|
||||
"n": "delay",
|
||||
"t": "number",
|
||||
"d": "出场延迟毫秒;缺省 150,传 0 立即显示"
|
||||
},
|
||||
{
|
||||
"n": "trigger",
|
||||
"t": "HTMLElement",
|
||||
"r": 1,
|
||||
"d": "第二个参数:被包裹的触发器元素(按钮 / 输入框等任意 DOM)"
|
||||
}
|
||||
],
|
||||
"example": "tooltip({ content: '保存后立即生效' }, button({ label: '保存', onClick: save }))",
|
||||
"steps": [
|
||||
"先创建触发器元素,如 const btn = button({ label: '保存' })",
|
||||
"用 tooltip(props, trigger) 包一层:返回带气泡的包裹元素,原触发器仍是独立节点",
|
||||
"鼠标移入或键盘聚焦约 150ms 后出场,移出 / 失焦立即收起;按 Esc 可立刻关闭",
|
||||
"气泡默认在上方,空间不足或需要避让时传 placement: 'bottom'",
|
||||
"气泡 pointer-events: none 不抢指针;判读依赖 aria-describedby + role='tooltip',读屏可读",
|
||||
"只做展示:不要在气泡里放可点击元素,需要交互请用 modal 或自绘弹层"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "spinner",
|
||||
"title": "加载指示器 Spinner",
|
||||
|
||||
Reference in New Issue
Block a user