7.3 KiB
7.3 KiB
11 组:Vue 独有页面 empty-state、header
事实记录:上游文档缺失此页
- 上游
heroui/apps/docs/content/docs/{en,cn}/react/components/下没有 empty-state、header 的组件页(无同名 mdx,分组 meta.json 无条目)。 - 但上游有完整实现与样式:
heroui/packages/react/src/components/empty-state/{empty-state.tsx,index.ts}、heroui/packages/react/src/components/header/{header.tsx,index.ts}(components/index.ts:63、67 导出)heroui/packages/styles/components/{empty-state,header}.css+heroui/packages/styles/src/components/{empty-state,header}/*.styles.ts
- 上游只是在别的页零散引用:
(data-display)/table.mdx「空状态」段:Table.Body的renderEmptyState(未单独讲 EmptyState 组件)(collections)/dropdown.mdx:24,41、(collections)/list-box.mdx:24,34,193:分组结构里import { Header }、<Header />(无独立 Header 页与演示)
- 因此 Vue 的
heroui-vue/apps/docs/components/empty-state.md、header.md属自编页面;两页均已带自编声明(empty-state.md「基线说明」、header.md「说明」),/tmp/audit/up_examples.json也无这两页条目(vue_examples.json有:empty-state 4 例、header 3 例)。此事实本身按简报要求记录,自编不判为硬差异。
empty-state
- [API] 未发现虚构:上游
EmptyStateRootProps = DOMRenderProps<E,"undefined"> + children/className,E默认"div",无任何变体(empty-state.styles.ts仅tv({base:"empty-state"}))。Vue 表as(默认'div')/class/默认插槽与heroui-vue/packages/vue/src/components/empty-state/EmptyState.vue的 props 一致;heroui-vue/packages/styles/src/index.ts:701emptyStateVariants同为 base-only。无虚构变体/slot/事件。 - [实现](轻微)回退语义与上游不一致且文档未标注:上游
empty-state.tsx为children || "No results found"真值判断 ——children={0}会回退默认文案、纯空白字符串" "(truthy)原样渲染;VueEmptyState.vue的isMeaningful把0视为有效内容照常渲染、纯空白/注释回退默认文案。empty-state.md「只要存在有效内容(文本、数字或元素),就渲染调用方内容」写的是 Vue 语义,在 0 与空白字符串两个边界上与上游||语义相反。 - [样式] 无硬差异:
heroui/packages/styles/components/empty-state.css与heroui-vue/packages/styles/components/empty-state.css均为.empty-state{@apply p-2 text-sm text-muted}(hv-前缀归一化后 diff 仅剩许可注释);/tmp/audit/css_semantic2.txt无 empty-state 条目。empty-state.md「样式参考」的类名与p-2 text-sm text-muted与 CSS 一致,"基线没有尺寸、颜色、变体或图标插槽"表述准确。 - [示例] 4 例(default / custom-content / conditional / custom-styles,
heroui-vue/apps/docs/demos/empty-state-*.vue)全为自编(上游无官方演示),内容与真实能力吻合、未虚构 API/变体(只用 class + 默认插槽);conditional 例演示的 v-if 回退与组件行为一致。覆盖缺口:上游真实消费场景是table.stories.tsx:421的renderEmptyState(图标 + 文案No results found)与 combo-box/autocomplete stories 的空集合占位,empty-state.md 未给"集合为空"组合示例(table-empty-state.vue似在 table 页覆盖,归属待核实)。 - [动画][配色] 无。
header
- [API](文档事实错误,虚构上游能力)
header.md「上游差异」表写"Header.Root对象子部件"属于上游能力,但上游heroui/packages/react/src/components/header/index.ts是export const Header = HeaderRoot,没有.Root(只有 EmptyState 用Object.assign(EmptyStateRoot, {Root}))。该行描述的是不存在的上游 API。 - [API] 其余一致:上游
HeaderRootProps = ComponentPropsWithRef<typeof HeaderPrimitive>,无变体(header.styles.ts仅tv({base:"header"}));Vue 表as(默认'header')/class/默认插槽与heroui-vue/packages/vue/src/components/header/HeaderRoot.vue一致;index.ts:1199headerVariantsbase-only。 - [API](琐碎)Vue 额外导出
type HeaderVariants(heroui-vue/packages/vue/src/index.ts:627),上游header/index.ts只导出headerVariants无该类型(EmptyState 才有 Variants 类型)。可忽略。 - [实现] Vue 多一段未入文档的行为:
HeaderRoot.vueinject(menuSectionLabelKey)在 MenuSection 内自动useId()并registerLabel(id)(卸载时注销);上游由 RAC CollectionHeaderNode承担,属底座适配,但header.mdAPI 表未记录"id 自动生成/注册为分组标签"这一行为。 - [文档](stale,与仓库现状不符)
header.md称"菜单 / ListBox 尚未迁移时,可用语义容器解释组合边界"、上游差异表写"集合上下文由未来菜单族提供",但heroui-vue/packages/vue/src/components/已有menu、menu-section、list-box、combo-box、dropdown,且 HeaderRoot 本身就import { menuSectionLabelKey } from "../menu/context"。 - [文档](正确性核对通过)
header.md称 RACHeader默认渲染原生<header>:已核 react-aria-componentssrc/Header.tsx(dom.header,HeaderProps extends HTMLAttributes<HTMLElement> & DOMRenderProps<"header", undefined>,createLeafComponent(HeaderNode)),表述正确;render→as属框架映射。 - [样式] 无硬差异:双方
.header{@apply w-full px-2 pt-1.5 pb-1 text-start text-xs font-medium text-muted}(heroui/packages/styles/components/header.cssvsheroui-vue/packages/styles/components/header.css,归一化 diff 仅注释:Vue 注释多 "(collection / group section heading)" 说明);css_semantic2.txt无 header 条目;header.md「样式参考」数值与 CSS 一致。 - [示例] 3 例(basic / custom-class / semantic,
heroui-vue/apps/docs/demos/header-*.vue)为自编,未虚构变体(只用 class 覆盖)。文案操作、危险区域恰与上游唯一真实用法heroui/apps/docs/src/demos/cn/dropdown/with-sections.tsx:15,45的<Header>操作</Header>、<Header>危险区域</Header>对应,内容合理。覆盖缺口:3 例都没在已迁移的 Dropdown.Section / MenuSection / ListBox 分组里演示 Header(上游 Header 的实际使用场景就是这些集合分组的标题,见 dropdown.mdx/list-box.mdx 的<Header />),示例只用自造<section>/<div>模拟。 - [动画][配色] 无。
本组小结
header.md「上游差异」表虚构上游Header.Root对象子部件(上游header/index.ts无.Root)—— 本组唯一虚构上游 API。header.md关于"菜单 / ListBox 尚未迁移、集合上下文由未来菜单族提供"的描述已过期:menu/list-box/combo-box/dropdown 均已迁移,HeaderRoot 已接 MenuSection label 注册,且该行为未写入 API 表。- EmptyState 回退边界与上游
children || "No results found"有差异(0上游回退/Vue 渲染;纯空白字符串上游渲染/Vue 回退),文档按 Vue 语义描述且未标注差异。 - 两页均自编但已声明;CSS 与 tv 映射与上游逐字一致(仅 hv- 前缀与注释),无样式/动画/配色硬差异。
- 示例覆盖合理但缺上游典型场景:header 未放进 Dropdown/ListBox 分组,empty-state 未给集合为空组合示例。