Files
heroui-vue/docs/upstream.md
T
2026-10-21 22:33:19 +08:00

53 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 上游基线与移植来源
- 项目:https://github.com/heroui-inc/heroui
- 基线版本:3.2.6
- 提交:ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960
- 本次更新:2026-10-21
## 已移植
- packages/styles/components/{button,close-button,card,input,textarea,switch,switch-group,label,description,surface,link,spinner,avatar,avatar-group,skeleton,separator,kbd,chip,badge,alert}.css:只将组件类名加 hv- 前缀;Vue 状态适配集中在样式入口和组件层。
- packages/styles/themes/default/variables.css、themes/shared/theme.css:主题变量、OKLCH 颜色、派生公式和圆角尺寸。
- packages/styles/utilities、variants:焦点、禁用、减少动画等构建规则。
- packages/styles/src/components/{button,card,input,textarea,switch,surface,link,spinner,close-button,avatar,avatar-group,skeleton,separator,kbd,chip,badge,alert}/*.styles.ts:变体与类名映射,增加命名空间。
- apps/docs/content/docs/cn/react/components 下 Button/Card/Input/Switch/Surface/Link/Spinner/CloseButton/Avatar/AvatarGroup/Skeleton/Separator/Kbd/Chip/Badge/Alert 的标题、说明、示例顺序和 API 描述;React 特有部分转换为 Vue 用法。
- apps/docs/src/demos/cn 下 Button/Card/Input/Switch/Surface/Link/Spinner/CloseButton/Avatar/AvatarGroup/Skeleton/Separator/Kbd/Chip/Badge/Alert 文档引用的基线示例文案与布局;文档由新项目 SFC 实现。
- packages/react/src/components/kbd/kbd.constants.ts 的 KbdKey、kbdKeysMap、kbdKeysLabelMap:按键符号与无障碍 title 映射。
- packages/react/src/components/icons.tsx 的 InfoIcon/SuccessIcon/WarningIcon/DangerIcon:Alert 默认状态指示图标。
- packages/react/src/components/icons.tsx 的 ExternalLinkIcon:LinkIcon 默认外部箭头图标;CloseIcon:CloseButton 默认关闭图标。
- packages/react/src/components/spinner/spinner.tsx 的 SpinnerPrimitive SVG(渐变路径)。
- apps/docs/public/fonts/Inter-{Regular,Medium,Bold}.ttf:文档字体资源。
- apps/docs/src/app/global.css 的 `animate-shine` / `shine` 关键帧与 Skeleton 演示用 `shadow-panel`:放在文档 utilities.css,不进入组件包。
## 来源声明
上游清单标注 MIT,但本地根 LICENSE 实际为 Apache-2.0(含 Copyright 2025 NextUI Inc.)。本项目保留原始全文于 third-party/HEROUI-LICENSE,样式包也携带 LICENSE;不能继续沿用早期文档中未经核对的 MIT 结论。移植文件保留来源并标注命名空间与 Vue 适配修改。
构建与运行不依赖相邻 React 仓库。完整源样式移植记录以本文件及源码顶部声明为准。
## 本批文档适配
- Card 的头像改用本库 Avatar/AvatarImage/AvatarFallback(内部为 Reka Avatar);图片沿用上游 CDN URL,不复制媒体文件。关闭按钮改用本库 CloseButton(默认基线 CloseIcon)。
- Card 链接使用本库 Link + LinkIcon(默认基线图标)。
- Card 表单使用原生 form/label 与 Input 组合,提交仅展示本地反馈,不实现登录与密码找回服务。忘记密码链接使用 Link 与本地反馈。
- SwitchGroup 的方向布局 CSS 来自同一基线。Switch 的 native/ARIA 校验、表单 checkbox、reset、属性与事件透传由 Vue 状态层实现;FieldError 暂仅接入 Switch。
- Surface 搭配表单示例使用 Input 与 TextArea 的 secondary 变体;TextArea 为本批为演示移植的最小实现。
- Link 自定义图标示例将上游 `@gravity-ui/icons` 的 ArrowUpRightFromSquare / Link 替换为 Tabler `IconExternalLink` / `IconLink`(MIT),与项目图标约定一致。
- Spinner 内部 SVG 来自基线 SpinnerPrimitive,不属于演示图标;Button 加载示例改用 Spinner(`color="current" size="sm"`),与上游 CN loading 示例一致。
- CloseButton 自定义图标示例将上游 `@gravity-ui/icons` 的 CircleXmark / Xmark 替换为 Tabler `IconCircleX` / `IconX`;默认关闭图标为移植的基线 CloseIcon。
- Avatar 回退/变体与 AvatarGroup 自定义样式示例中的 Person 图标替换为 Tabler `IconUser`。Avatar 自定义图片组件示例以本地 FrameworkImage 演示 asChild,对应上游 Next.js Image 组合。Avatar 变体示例中的分隔线使用公共 Separator。
- Skeleton 演示沿用上游 `shadow-panel` 与 `animate-shine` 类名,并在文档 utilities.css 中提供对应定义(上游放在 docs global.css)。
- Separator `render` 示例改用 Vue `as-child` + 自定义 `div` 根节点,保留 `data-custom="foo"`。
- Chip 演示将上游 `@gravity-ui/icons` 的 CircleFill / CircleInfo / Check / TriangleExclamation / Ban / CircleCheckFill / Clock / Xmark / ChevronDown / CircleDashed 替换为 Tabler `IconCircleFilled` / `IconInfoCircle` / `IconCheck` / `IconAlertTriangle` / `IconBan` / `IconCircleCheckFilled` / `IconClock` / `IconX` / `IconChevronDown` / `IconCircleDashed`(MIT)。
- Badge 带内容示例的 Bell 图标替换为 Tabler `IconBell`。Alert 默认指示图标为移植的基线 SVG,非 Tabler。
- 图标统一使用 @tabler/icons-vue(MIT)的官方组件,未移植 React 图标依赖;尚未完成自动逐像素对比。
## FORM-01 字段与表单基础
- `packages/react/src/components/{textfield,form,label,description,field-error}`:公共语义与组合设计;Vue 以原生控件与类型化上下文实现,不移植 React Aria runtime。
- `packages/styles/components/{textfield,field-error}.css`:移植为 hv- 命名空间,保留 Apache-2.0 来源与许可头。
- `apps/docs/src/demos/cn/textfield/{basic,with-description,validation}.tsx`:三个基线演示,保留文案/布局,仅把状态与事件改为 Vue。
- Form/字段验证页的 `form-foundation.vue` 为本库基础设施回归场景,未冒充上游完整 Form 示例。
- 原 Switch 专属 FieldError 移到通用 field 目录;复用 fieldContextKey,而非复制一套说明/错误基础组件。具体差异与 SSR 包装边界见 decisions/field-form-foundation.md。