iter(e04): 新增 empty 空状态组件

This commit is contained in:
HIsheR
2026-10-23 18:11:47 +08:00
parent 62d4ce648d
commit fd4ee018e6
12 changed files with 172 additions and 9 deletions
+32 -2
View File
@@ -1,6 +1,6 @@
{
"$schema": "ui-arch-registry-index/0.1",
"generatedAt": "2026-10-23T10:03:21.198Z",
"generatedAt": "2026-10-23T10:11:22.346Z",
"repoRoot": ".",
"packages": [
{
@@ -169,6 +169,7 @@
"tabs(props):标签页,active 信号双向绑定,滑动指示条 + 方向键环形导航,支持禁用页签",
"stepper(props):步骤条,done/current/upcoming 三态,active 信号双向绑定,clickable 时已完成步骤可回跳",
"rate(props):评分星标,value 信号双向绑定,hover 预览移出还原,键盘方向键调节,max 可配",
"empty(props):空状态占位,title/description 可选,action 放操作区",
"modal(props, ...children):弹窗,open 信号驱动显隐,Esc / 遮罩 / × 关闭,size 三档宽度,footer 提供底部操作区",
"drawer(props, ...children):抽屉,open 信号驱动侧滑面板,placement 左右可配、width 可调、footer 操作区,遮罩 / × / Esc 关闭",
"form(props, items):表单容器,布局 + 聚合校验,全部通过才触发 onSubmit",
@@ -1181,6 +1182,34 @@
"max 可调整星标总数;disabled 支持布尔或信号禁用"
]
},
{
"id": "empty",
"title": "空状态 Empty",
"demo": "sec-empty",
"props": [
{
"n": "title",
"t": "string",
"d": "主标题;缺省不渲染"
},
{
"n": "description",
"t": "string",
"d": "补充说明;缺省不渲染"
},
{
"n": "action",
"t": "unknown",
"d": "操作区内容(常见为按钮);缺省不渲染"
}
],
"example": "empty({ title: '暂无数据', description: '调整筛选条件后再试', action: button({ label: '重置筛选', variant: 'ghost' }) })",
"steps": [
"在列表 / 表格 / 筛选结果为空时渲染 empty 占位",
"title 一句话说明状态,description 补充原因或建议",
"action 传入 DOM(如 ghost 按钮)引导用户下一步操作"
]
},
{
"id": "pagination",
"title": "分页器 Pagination",
@@ -1482,6 +1511,7 @@
"ua docs:生成人类文档站 apps/docs/index.html + demo.html 与 Agent 全量文档 llms-full.txt",
"ua style:注释规范门禁(导出必须 /*** ***/、接口字段行尾注释、行注释中文),违规退出码 1",
"ua verify:清单一致性门禁(id 唯一 / exports 对应 / props 必带 n t d / steps≥3 / demo 锚点存在)",
"ua commit-lint <文件|message>:提交信息门禁(type 枚举 / scope 规则 / subject 中文祈使 ≤50 字符),规范见 COMMITTING.md,违规退出码 1",
"ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components"
],
"keyTypes": [
@@ -1489,7 +1519,7 @@
"MCP tool 入参 schema"
]
},
"usage": "node packages/tools/cli/bin/ua.js <index|list|info <name>|docs|style|verify|mcp>;仓库内等价于 npm run index / docs / style / verify",
"usage": "node packages/tools/cli/bin/ua.js <index|list|info <name>|docs|style|verify|commit-lint|mcp>;仓库内等价于 npm run index / docs / style / verify",
"conventions": [
"零依赖:只用 node 标准库,Node >= 18",
"清单是单一来源:代码注释、文档站、llms-full.txt、MCP 全部从 ua.manifest.json 派生",