docs: close documentation facts, structure and related-component mapping

HD-04 scope, against heroui ce90ea3 cn sources:

- stale/fictional content: input.md no longer claims TextField is
  unmigrated; color-field.md no longer claims ColorPicker is private;
  header.md drops the fictional Header.Root subcomponent and the stale
  'menus not migrated' wording (MenuSection label registration is now
  documented from HeaderRoot source); radio-group.md drops three copied
  CheckboxGroup wordings (variant override is Radio's, scalar emits,
  native single-value submit); input-otp.md drops the fictional
  data-complete state and lists the real missing upstream props
- toggle-button disabled row now matches the real CSS hooks
  (:disabled / [aria-disabled], with data-disabled as a marker only)
- part API / CSS classes / interactive states restored per pinned
  sources: button (full class lists + real variable-based global CSS),
  accordion (per-part tables + variant/state lists), card (per-part
  tables + variant list), switch (SwitchGroup snippet + Switch/
  SwitchGroup class lists + states), color-field Group (class list +
  states), input-otp (variant notes, global CSS, class/state lists);
  input-group gains the two upstream usage chapters
- RelatedComponents restored from the pinned componentRelationships
  (first-3, filtered against componentsMap): 64 pages rewritten,
  list-box/slider sections added, 7 empty-mapping pages' fabricated
  entries removed; RelatedShowcases left unmigrated with its real data
  inventory recorded (2 cases, showcase-site cards)
- defaults unified on implementation evidence: granularity (inferred
  day/minute) and visibleYears (full min-max span, no "or 20" fallback);
  HD-03 hand-offs resolved (trigger focus-visible noted for HD-06,
  width guards kept)
- new demos: header-collection-grouping (MenuSection/ListBoxSection
  label wiring), empty-state-collection (collection empty slot);
  empty-state page deduplicated with a boundary compatibility note
- ComponentPreview minHeight/isBgSolid restored per the 30 upstream
  marks; tabs-overflow max-w-full kept after measuring internal scroll
- tests: +3 header registration/demo cases, +1 empty-state collection
  case; full suite 110 files / 1630 tests, typecheck and build:docs
  pass
This commit is contained in:
maoyingjie
2026-10-28 22:32:10 +08:00
parent 2c6d871354
commit 145a208687
76 changed files with 912 additions and 352 deletions
+14 -8
View File
@@ -25,7 +25,7 @@ import { Header } from "@heroui-vue/components";
`Header` 是集合/分组标题部件,不是带 Logo、导航和用户菜单的应用顶栏。固定基线的 React Aria Components `Header` 渲染原生 `<header>` 元素(不是任意 heading 级别),常出现在 Dropdown、ListBox、ComboBox、Autocomplete 的分组中。
Vue 版导出 `Header` 与 `HeaderRoot`(同一实现)。菜单 / ListBox 尚未迁移时,可用语义容器解释组合边界,例如在分组列表或表单分区前放置标题:
Vue 版导出 `Header` 与 `HeaderRoot`(同一实现)。在真实集合分组中,`Header` 自动充当分组标签:位于 `DropdownSection` / `MenuSection` 内时自动生成 id 并注册为分组的 `aria-labelledby` 目标(显式传入 `id` 时沿用并注册该 id,卸载时注销);位于 `ListBoxSection` 内时由分组扫描子节点取 `Header` 的 id 关联 `aria-labelledby`。脱离集合使用时它就是普通标题元素,也可用语义容器解释组合边界,例如在分组列表或表单分区前放置标题:
<ComponentPreview name="header-semantic" />
@@ -46,6 +46,12 @@ import { Header } from "@heroui-vue/components";
## 示例
### 集合分组
在 `DropdownSection`(菜单分组)与 `ListBoxSection`(列表分组)中,`Header` 自动成为分组标签:菜单分组经注册表把 `Header` 的 id 关联到 `aria-labelledby`,列表分组扫描子节点取 `Header` 的 id 关联。查看示例 DOM 可见分组元素的 `aria-labelledby` 指向对应 `Header`。
<ComponentPreview name="header-collection-grouping" />
### 自定义 class
<ComponentPreview name="header-custom-class" />
@@ -82,16 +88,16 @@ import { Header } from "@heroui-vue/components";
| `class` | `string \| Array \| Object` | - | 附加 CSS 类 |
| 默认插槽 | - | - | 标题内容 |
根元素同时接收其余 `$attrs`(`aria-*`、`data-*`、`id`、`style`、事件等)。本组件没有业务值,不提供 `v-model`、表单提交或焦点状态。
根元素同时接收其余 `$attrs`(`aria-*`、`data-*`、`id`、`style`、事件等)。本组件没有业务值,不提供 `v-model`、表单提交或焦点状态。`id` 在 `MenuSection` / `DropdownSection` 内未显式传入时自动生成,并注册为该分组的 `aria-labelledby` 标签;其他场景不主动输出 id。
### 上游差异
| 上游 React 能力 | Vue 实现 |
| --------------------------- | ------------------------------------------ |
| `Header.Root` 对象子部件 | 独立具名导出 `Header` / `HeaderRoot` |
| RAC Collection 叶子节点 | 语义 HTML 封装;集合上下文由未来菜单族提供 |
| `className` / `children` | `class` / 默认插槽 |
| `render` / `DOMRenderProps` | `as` 更换元素,属性直接透传 |
| 上游 React 能力 | Vue 实现 |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| 具名导出 `Header`(无 `.Root` 对象子部件) | 具名导出 `Header` / `HeaderRoot`(同一实现) |
| RAC Collection 叶子节点(分组标题注册) | `MenuSection` 内自动注册 id 为分组标签;`ListBoxSection` 扫描子节点取 `Header` id 关联 `aria-labelledby` |
| `className` / `children` | `class` / 默认插槽 |
| `render` / `DOMRenderProps` | `as` 更换元素,属性直接透传 |
## 无障碍