feat: migrate public TimeField with shared date input parts

This commit is contained in:
maoyingjie
2026-10-26 17:56:41 +08:00
parent d74ad1b711
commit 97263d82e1
45 changed files with 2415 additions and 61 deletions
+8
View File
@@ -252,3 +252,11 @@ CSS/tv 仅加 `hv-` 前缀与 Vue 状态适配,保留 Apache-2.0 来源。TagR
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 仓库。
## TIME-FIELD(2026-10-26)
固定 HeroUI 3.2.6 / `ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960`:`packages/react/src/components/time-field/{index.ts,time-field.tsx}`、共享 date-input-group、`packages/styles/components/time-field.css` 与 `packages/styles/src/components/time-field/time-field.styles.ts`,中文 `(date-and-time)/time-field.mdx` 和 `demos/cn/time-field` 全部15例。
TimeField CSS/variants 仅加 hv- 前缀,保留 Apache-2.0 来源;DateInputGroup 沿用已移植样式,未重复复制。Vue 使用已安装 Reka UI 2.11.0 的公开 TimeFieldRoot/Input/context 和 @internationalized/date 3.12.4,不修改依赖或运行 React。输入六部件仍复用 DateInputGroup,只增加私有底座选择;共享接受值协议拓展为不可变 Time 值,不增加另一套表单/校验/重置状态。默认 TimeValue 子集、精度与 ARIA 适配见组件说明。
演示图标以 Tabler 官方 IconClock/IconChevronDown 替代源 Gravity 图标。render 示例改 as/原生 attrs;表单示例保留1500ms模拟提交,增加实际提交值反馈并清理计时器。无新增依赖,构建不依赖相邻 React 仓库。