feat(S6-P21): 组件族参数化(13族/44成员/导航族15文件同源/79→48概念组件)
【本次核心 · S6-P21】 - 族层数据:families.json + 44 份契约注入 family/familyRole/familyParams; data.json / data.js / site/details 同步。13 族 / 44 成员 / 35 独立 → 概念组件 79→48。 - 79 个 slug 全保留、集合逐一不变(铁律 5 对外承诺未破);frameworks 仍 395 文件、薄壳仍 79。 - 归族判据为契约中可核对字段(semanticTypeCandidates 重叠 / anatomy 为同一骨架子集 / 变体维度同构 / doNotInvent 显式从属声明),每族 mergeBasis 写明依据,不按名字猜。 - 实现层合并(导航族端到端切片):tools/gen-family-impl.mjs 从 5 端模板生成 TopMenu / SideMenu / MixedNavigation 共 15 文件,参数 direction=top|side|mixed; 三份 CSS md5 完全相同 = 一份样式表服务三个组件。 - 新增 tools/gen-families.mjs、tools/gen-family-impl.mjs、tools/verify-families.mjs、 tools/lib/family-model.mjs、tools/lib/family-impl/nav-menu/*.tpl。 【同时清掉此前已完成但未提交的批次】 生成物(data.json / data.js / site/sources / site/components 薄壳 / sitemap.xml / tests 报告) 跨阶段交织,无法拆成互相自洽的多个提交,故按既有批量风格合并提交: - Package:三端可 import(S5-P18)+ 发布到私有 npm 源 - Docs site:导航语言改下拉(S5-P19)、详情页代码块默认展开、中英切换完整性 - Security:生产部署链审计修复(2026-09-19)+ 线上部署 - Theme modes 日间/夜间/自动;S1-P4 data.js 瘦身;S2-P5 暗色;S2-P6 跨端一致性; S2-P7 行为断言;S2-P9 FAQ;S3-P8 RTL;S3-P9 契约缺口解释层;S4-P12 发布流程 - 补入 tools/pack-deploy.mjs、run-site-smoke.mjs、verify-*.mjs,.dockerignore、 安全审计修复与待决策项.md 【验收】 - node tools/verify-families.mjs → OK: 族层端到端一致(13 族 / 44 成员 / 79 组件不变 / 395 文件不变) - node tools/verify-cross-platform.mjs → 79/79 identical(HEAD 基线 high 44) - node tools/run-regression.mjs → 100%(79/79 页,1017/1017 断言,N/A 34),连跑 8 次一致,0 超时 - 逐页实测:topmenu / sidemenu / mixednavigation 各 13/13,帧内 direction 参数正确,0 JS 错误 - 零运行时依赖 OK;build-site.ps1 ASCII-only OK 【未纳入】site/components/<slug>/ 平台薄壳 316 个 —— 历史从未跟踪且属构建产物,保持现状。
This commit is contained in:
+187
-13
@@ -1,13 +1,187 @@
|
||||
/* Aurora Admin MixedNavigation 样式 — 顶部一级 + 侧边二级混合导航 */
|
||||
.aa-mixed { font-family: var(--font-family, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif); border: 1px solid var(--au-color-border); border-radius: 8px; overflow: hidden; background: var(--au-color-card-bg); }
|
||||
.aa-mixed-top { display: flex; gap: 4px; background: var(--au-color-card-bg); border-bottom: 1px solid var(--au-color-border); padding: 0 8px; }
|
||||
.aa-mixed-topitem { padding: 12px 16px; cursor: pointer; color: var(--au-color-text-body); font-size: 14px; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
|
||||
.aa-mixed-topitem:hover { color: var(--au-color-brand); }
|
||||
.aa-mixed-topitem.is-active { color: var(--au-color-brand); border-bottom-color: var(--au-color-brand); font-weight: 600; }
|
||||
.aa-mixed-body { display: flex; min-height: 240px; }
|
||||
.aa-mixed-side { width: 168px; background: var(--au-color-table-header-bg); border-inline-end: 1px solid var(--au-color-border); padding: 8px 0; }
|
||||
.aa-mixed-sideitem { padding: 10px 16px; cursor: pointer; color: var(--au-color-text-body); font-size: 14px; border-inline-start: 3px solid transparent; transition: background .15s, color .15s; }
|
||||
.aa-mixed-sideitem:hover { background: var(--au-color-page-bg); }
|
||||
.aa-mixed-sideitem.is-active { background: var(--au-color-brand-bg); color: var(--au-color-brand); border-left-color: var(--au-color-brand); font-weight: 500; }
|
||||
.aa-mixed-content { flex: 1; padding: 18px 22px; color: var(--au-color-text-tertiary); font-size: 14px; line-height: 1.7; }
|
||||
.aa-mixed-content h4 { margin: 0 0 6px; color: var(--au-color-text-title); }
|
||||
/* Aurora Admin Menu 族样式 — 由 tools/gen-family-impl.mjs 从族模板生成,勿手改。
|
||||
*
|
||||
* @generated by tools/gen-family-impl.mjs
|
||||
* 族:nav-menu(基座 Menu + direction 参数)。
|
||||
* 本文件服务:sidemenu / topmenu / mixednavigation。
|
||||
*
|
||||
* 三个组件的 CSS 是同一份样式表 —— 差异全部由根元素的 data-direction /
|
||||
* data-collapsed 参数表达,不再各自手写一遍。改样式请改模板后重跑生成器:
|
||||
* node tools/gen-family-impl.mjs nav-menu
|
||||
*/
|
||||
|
||||
/* ---------- 基础:方向无关 ---------- */
|
||||
.aa-menu {
|
||||
font-family: var(--font-family, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
|
||||
color: var(--au-color-text-body);
|
||||
background: var(--au-color-card-bg);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.aa-menu-item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
color: var(--au-color-text-body);
|
||||
transition: background .15s, color .15s, border-color .15s;
|
||||
}
|
||||
.aa-menu-item:hover { background: var(--au-color-page-bg); }
|
||||
.aa-menu-item.is-active { color: var(--au-color-brand); font-weight: 500; }
|
||||
.aa-menu-item.is-disabled { color: var(--au-color-text-disabled); cursor: not-allowed; }
|
||||
.aa-menu-item.is-disabled:hover { background: none; }
|
||||
|
||||
.aa-menu-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 15px; }
|
||||
.aa-menu-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.aa-menu-badge {
|
||||
background: var(--au-color-error);
|
||||
color: var(--au-color-text-inverse);
|
||||
font-size: 11px;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
border-radius: var(--au-radius-large);
|
||||
padding: 0 5px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.aa-menu-arrow { color: var(--au-color-text-secondary); font-size: 12px; transition: transform .15s; }
|
||||
.aa-menu-item.is-open > .aa-menu-arrow { transform: rotate(90deg); }
|
||||
|
||||
.aa-menu-children { background: var(--au-color-table-header-bg); }
|
||||
.aa-menu-children .aa-menu-item { height: 40px; padding-inline-start: 40px; font-size: 13px; }
|
||||
|
||||
/* 折叠态悬浮浮层(side 方向专用) */
|
||||
.aa-menu-pop {
|
||||
position: absolute;
|
||||
inset-inline-start: 56px;
|
||||
top: 0;
|
||||
min-width: 180px;
|
||||
background: var(--au-color-card-bg);
|
||||
border: 1px solid var(--au-color-border);
|
||||
border-radius: var(--au-radius-medium);
|
||||
box-shadow: var(--au-shadow-medium, 0 4px 12px rgba(0, 0, 0, .12));
|
||||
padding: 4px 0;
|
||||
z-index: 200;
|
||||
}
|
||||
.aa-menu-pop-title { padding: 6px 16px; font-size: 12px; color: var(--au-color-text-secondary); }
|
||||
.aa-menu-pop .aa-menu-item { height: 40px; padding: 0 16px; }
|
||||
|
||||
/* ---------- direction=top:水平导航,选中态底部指示条 ---------- */
|
||||
.aa-menu[data-direction="top"] {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
border-bottom: 1px solid var(--au-color-border);
|
||||
padding: 0 8px;
|
||||
}
|
||||
.aa-menu[data-direction="top"] > .aa-menu-item { height: 48px; padding: 0 16px; }
|
||||
.aa-menu[data-direction="top"] > .aa-menu-item:hover { background: none; color: var(--au-color-brand); }
|
||||
.aa-menu[data-direction="top"] > .aa-menu-item.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset-inline: 12px;
|
||||
bottom: 0;
|
||||
height: 2px;
|
||||
background: var(--au-color-brand);
|
||||
}
|
||||
/* top 方向的下拉:绝对定位面板,hover / focus-within 展开(键盘同样可达) */
|
||||
.aa-menu[data-direction="top"] .aa-menu-children {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
inset-inline-start: 0;
|
||||
display: none;
|
||||
min-width: 160px;
|
||||
background: var(--au-color-card-bg);
|
||||
border: 1px solid var(--au-color-border);
|
||||
border-radius: var(--au-radius-medium);
|
||||
box-shadow: var(--au-shadow-medium, 0 4px 12px rgba(0, 0, 0, .08));
|
||||
padding: 4px;
|
||||
z-index: 50;
|
||||
}
|
||||
.aa-menu[data-direction="top"] .aa-menu-item:hover > .aa-menu-children,
|
||||
.aa-menu[data-direction="top"] .aa-menu-item:focus-within > .aa-menu-children { display: block; }
|
||||
.aa-menu[data-direction="top"] .aa-menu-children .aa-menu-item {
|
||||
height: auto;
|
||||
padding: 8px 12px;
|
||||
font-size: 13px;
|
||||
border-radius: var(--au-radius-small);
|
||||
}
|
||||
.aa-menu[data-direction="top"] .aa-menu-children .aa-menu-item:hover {
|
||||
background: var(--au-color-brand-bg);
|
||||
color: var(--au-color-brand);
|
||||
}
|
||||
.aa-menu[data-direction="top"] .aa-menu-children .aa-menu-item.is-active {
|
||||
background: var(--au-color-brand-bg);
|
||||
}
|
||||
|
||||
/* ---------- direction=side:侧边栏,选中态品牌底 + 侧指示条 ---------- */
|
||||
.aa-menu[data-direction="side"] {
|
||||
width: 220px;
|
||||
border-inline-end: 1px solid var(--au-color-border);
|
||||
}
|
||||
.aa-menu[data-direction="side"] > .aa-menu-item { height: 44px; padding: 0 16px; }
|
||||
.aa-menu[data-direction="side"] > .aa-menu-item.is-active { background: var(--au-color-brand-bg); }
|
||||
.aa-menu[data-direction="side"] > .aa-menu-item.is-active::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset-inline-start: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: var(--au-color-brand);
|
||||
}
|
||||
|
||||
/* ---------- direction=mixed:顶部一级 + 侧边二级 ---------- */
|
||||
.aa-menu[data-direction="mixed"] {
|
||||
border: 1px solid var(--au-color-border);
|
||||
border-radius: var(--au-radius-large);
|
||||
overflow: hidden;
|
||||
}
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-top {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
border-bottom: 1px solid var(--au-color-border);
|
||||
padding: 0 8px;
|
||||
}
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-top > .aa-menu-item { height: 48px; padding: 0 16px; }
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-top > .aa-menu-item:hover { background: none; }
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-top > .aa-menu-item.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset-inline: 12px;
|
||||
bottom: 0;
|
||||
height: 2px;
|
||||
background: var(--au-color-brand);
|
||||
}
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-side {
|
||||
width: 168px;
|
||||
min-height: 200px;
|
||||
background: var(--au-color-table-header-bg);
|
||||
border-inline-end: 1px solid var(--au-color-border);
|
||||
padding: 8px 0;
|
||||
}
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-side > .aa-menu-item { height: 40px; padding: 0 16px; }
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-side > .aa-menu-item.is-active {
|
||||
background: var(--au-color-brand-bg);
|
||||
}
|
||||
.aa-menu[data-direction="mixed"] > .aa-menu-side > .aa-menu-item.is-active::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset-inline-start: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: var(--au-color-brand);
|
||||
}
|
||||
|
||||
/* ---------- 参数:collapsed(仅 side 方向生效) ---------- */
|
||||
.aa-menu[data-direction="side"][data-collapsed="true"] { width: 56px; }
|
||||
.aa-menu[data-direction="side"][data-collapsed="true"] .aa-menu-label,
|
||||
.aa-menu[data-direction="side"][data-collapsed="true"] .aa-menu-badge,
|
||||
.aa-menu[data-direction="side"][data-collapsed="true"] .aa-menu-arrow { display: none; }
|
||||
.aa-menu[data-direction="side"][data-collapsed="true"] > .aa-menu-item { justify-content: center; padding: 0; }
|
||||
.aa-menu[data-direction="side"][data-collapsed="true"] > .aa-menu-item.is-active::before { display: none; }
|
||||
|
||||
/* 嵌套 children 的层级缩进(side 方向展开时) */
|
||||
.aa-menu[data-direction="side"] > .aa-menu-item > .aa-menu-children .aa-menu-item.is-active::before { display: none; }
|
||||
|
||||
Reference in New Issue
Block a user