fix: complete Avatar image composition and fallback migration

This commit is contained in:
maoyingjie
2026-10-27 18:05:26 +08:00
parent 6de246de49
commit fa8b22719e
16 changed files with 366 additions and 23 deletions
+4
View File
@@ -320,3 +320,7 @@ CSS/tv 仅加 `hv-` 前缀与 Apache-2.0 来源,`size/variant/layout` 默认 `
CSS/tv 仅加 `hv-` 前缀与 Apache-2.0 来源;`colorPickerVariants` 保持基线的 base/trigger/popover 三槽、无 size/variant。差异有记录的适配:`origin-(--trigger-anchor-point)` → `--reka-popper-transform-origin`,`data-placement^` 方向动画 → `data-side`,弹层 `max-height` 取 `--reka-popover-content-available-height`,退出动画保留 `pointer-events: none` 与 reduced-motion 停用。
行为契约审计了固定依赖的官方发布源码(`react-aria-components@1.21.1` 的 ColorPicker 私有实现与类型声明、`react-stately` `useColorPickerState`),未安装或执行 React。要点:无值时默认 `#000000`(`props.defaultValue || '#000000'`)、受控 `null` 视为非受控、`setColor(null)` 改写为 `#000000`;本库共享 owner 拒绝空提案并保持接受颜色(差异已记录)。固定源 Root 经 `DialogTrigger` 内部管理展开,`open`/`isOpen`/`defaultOpen` 受控展开为 Vue 适配扩展;Trigger 的 Button render props 收敛为 `color`/`isDisabled` 插槽状态;`name`/`form` 单值提交与 `isDisabled`/`isReadOnly` 为 Vue 扩展,不冒充 RAC 原能力。来源与差异见 [任务结果](tasks/results/COLOR-PICKER.md)。
## AVATAR 迁移补齐(2026-10-27)
重新核对固定提交 `ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960` 的 `packages/react/src/components/avatar/{avatar.tsx,index.ts}`、Avatar CSS/variants、中文 `(media)/avatar.mdx` 与 `apps/docs/src/demos/cn/avatar` 全7例。保留既有来源/许可与hv命名空间、全部视觉数值;补Image默认插槽、可选src、Root别名/部件替换/原生事件类型及零延迟适配。仍用Reka处理图片状态,框架/预加载差异见组件文档与 [结果](tasks/results/AVATAR.md)。