feat: migrate ColorSwatch and public color boundary

This commit is contained in:
maoyingjie
2026-10-26 13:25:21 +08:00
parent 60af6ee40b
commit 270dea5cff
29 changed files with 1427 additions and 18 deletions
+8
View File
@@ -244,3 +244,11 @@ CSS/tv 仅加 `hv-` 前缀与 Vue 状态适配,保留 Apache-2.0 来源。TagR
## B02c Autocomplete(2026-10-25)
固定 ce90ea3 的 `packages/react/src/components/autocomplete/autocomplete.tsx`、`packages/styles/components/autocomplete.css`、`packages/styles/src/components/autocomplete/autocomplete.styles.ts`、中文 `(pickers)/autocomplete.mdx` 与 `demos/cn/autocomplete` 24 例。CSS/tv 仅加 `hv-` 前缀;默认 chevron 与清除图标沿用基线 `icons.tsx` 路径。Vue 侧把 `SearchFieldInput` 组合成弹层内的 combobox 控件;弹层宽度用本批 `useTriggerWidth`(ResizeObserver)实测,不依赖 Reka 未启用的 size 中间件;未移植 RAC 的 `useFilter`(默认谓词等价)与 `Virtualizer`(用 ListBox 的 items/virtualized)。示例的本地异步源、Value 作用域插槽与虚拟化适配已在报告 12.2 逐项记录,不运行时依赖相邻仓库。
## COLOR-SWATCH ColorSwatch(2026-10-26)
固定 HeroUI 3.2.6 / `ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960`:`packages/react/src/components/color-swatch/{index.ts,color-swatch.tsx}`、`packages/styles/components/color-swatch.css`、`packages/styles/src/components/color-swatch/color-swatch.styles.ts`,中文 `(colors)/color-swatch.mdx` 与 `demos/cn/color-swatch` 全部 7 例(basic/sizes/shapes/transparency/render-function/accessibility/custom-styles)。
CSS/tv 仅加 `hv-` 前缀与 Apache-2.0 来源;`circle/square`、`xs/sm/md/lg/xl` 默认值与类名保持基线。组件复用已有 `components/color/value.ts` 的不可变 `Color`/`parseColor`,并从包根公开实际支持的 `Color`、`ColorValue`、`ColorChannel`、`ColorSpace`、`ColorInput` 子集;没有移植 React Stately 全量 `Color` 辅助方法、色名表或 React Aria 的 React 状态。`ColorSwatch` 省略 `color` 时读取最近的共享颜色 owner,显式 `color` 覆盖它;显式 `null`/空字符串清空继承。
上游 `render` 映射为 `as`/`asChild` 与原生 attrs;`style` render prop 的函数形式在 Vue 模板中改为 `styleFn`(Vue 编译器会规整保留的 `style` 函数值),普通样式仍用 `style`。默认作用域插槽接收 `{ color }`。未迁移 ColorSwatchPicker 的 `ColorSwatchContext`(该家族不在本任务范围),也没有运行时依赖相邻 React 仓库。