diff --git a/AGENTS.md b/AGENTS.md
index 757a903..8e6d721 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -446,3 +446,17 @@ Vaul Vue 官方已说明停止维护并推荐 Reka Drawer;新项目不采用 V
- 正常 HTTP 页面恢复访问后,Select 已完成重点浏览器补验,可以按本轮验证结果集成 main;上一节“留在任务分支”的要求是此前阻断阶段,不再适用。
- 不能只断言焦点正确:Floating 首次定位前 scrollIntoView 可能无效。定位后的动画开始及无动画路径重新检查当前焦点可见性;尊重取消、不抢焦点、忽略子动画、清理帧回调。长列表同时核对 activeElement、滚动区边界和 scrollTop。
+
+## DATE-01 日期基建(2026-10-23)
+
+- 日期任务从同步 main `3c878d2` 新建 feat/date-calendar-foundation,先读[日期基建决策](docs/decisions/date-calendar-foundation.md)。当前仅私有值/接受值协议和安装版探针,尚未公开 DateField/Calendar 或宣称文档完成。
+- DateField 与独立 DateInputGroup 共用分段部件;日期、时间、范围与 Picker 不再各自建值、表单或焦点模型。Calendar 的 week/day view、YearPicker 和非公历不能被普通月历替代。
+- 已实测底座受控拒绝后分段前移、reset 不恢复、秒/zone/非公历提交差异。接受值与显示 wire 分开,wire 只能是接受值副本;唯一提交层保留完整日期序列化,显示粒度不裁剪模型。
+- disabled/unavailable、locale/calendar/timeZone、纯日期/DateTime/ZonedDateTime 分别建模;SSR 使用明确值/placeholder 验证,不把 Node 本地时区或 UTC 强加给用户日期。
+- Calendar runtime 多选事件与安装版声明不一致;键盘导航使用 code 并在子项停止冒泡。公共 API 类型及事件取消须重新验证,不能把探针中的已知缺口当公共契约。
+
+## DATE-02 与下一任务(2026-10-23)
+
+DateField/DateInputGroup 已公开,先读[DATE-02 报告](docs/migrations/DATE-02-date-field.md)。空值受控拒绝不能靠重新传 null 触发底座 watch;回归完整提案、部分草稿和 reset,保留原节点/焦点。使用 shallowRef 保留日期类类型,完整 ISO 原生提交不跟显示粒度裁剪。Reka Root asChild/导航取消、完整日期粘贴和 13 月/era 差异必须保留说明。
+
+用户最新要求:完成 DateField 后暂停组件迁移,先对齐文档站整体架构、结构、布局与公共控件;已经具备的 HeroUI Vue 组件用于文档壳层,暂缺的保留现有实现,不为文档任务插入 Calendar。
diff --git a/apps/docs/.vitepress/theme/Layout.vue b/apps/docs/.vitepress/theme/Layout.vue
index 889bbcc..e669c35 100644
--- a/apps/docs/.vitepress/theme/Layout.vue
+++ b/apps/docs/.vitepress/theme/Layout.vue
@@ -62,6 +62,7 @@ const groups = [
{ title: "CheckboxGroup 复选框组", url: "/components/checkbox-group" },
{ title: "Chip 标签", url: "/components/chip" },
{ title: "CloseButton 关闭按钮", url: "/components/close-button" },
+ { title: "DateField 日期字段", url: "/components/date-field" },
{ title: "Description 描述", url: "/components/description" },
{ title: "Disclosure 折叠面板", url: "/components/disclosure" },
{
diff --git a/apps/docs/components.md b/apps/docs/components.md
index 5a23a08..99b982e 100644
--- a/apps/docs/components.md
+++ b/apps/docs/components.md
@@ -60,3 +60,5 @@ description: 已迁移组件及文档
- [NumberField 数字输入框](./components/number-field)
- [Slider 滑块](./components/slider)
+
+- [DateField 日期字段](./components/date-field):日期分段输入、描述与表单校验。
diff --git a/apps/docs/components/date-field.md b/apps/docs/components/date-field.md
new file mode 100644
index 0000000..d950a0b
--- /dev/null
+++ b/apps/docs/components/date-field.md
@@ -0,0 +1,477 @@
+---
+title: DateField 日期字段
+description: 日期输入字段,包含标签、说明与校验
+---
+
+## 用法
+
+```ts
+import {
+ DateField,
+ DateFieldGroup,
+ DateFieldInput,
+ DateFieldSegment,
+} from "@heroui-vue/components";
+```
+
+
+
+## 组件结构
+
+```vue
+
+
+
+
+
+
+
+
+
+ 输入日期
+
+
+
+```
+
+> **DateField** 将标签、日期输入、说明与错误信息组合为单个无障碍组件。
+
+## 示例
+
+### 带图标
+
+通过前缀或后缀图标增强日期输入。
+
+
+
+
+
+
+
+### 变体
+
+DateFieldGroup 组件支持两种视觉变体:
+
+- **`primary`**(默认)- 标准样式带阴影,适用于大多数场景
+- **`secondary`** - 低强调变体无阴影,适用于 Surface 组件内
+
+
+
+### 表面样式
+
+在 [Surface](/components/surface) 内使用时,请在 DateFieldGroup 上使用 `variant="secondary"` 以应用适合 Surface 背景的低强调变体。
+
+
+
+### 带描述
+
+
+
+### 必填字段
+
+
+
+### 禁用
+
+
+
+### 宽度充满
+
+
+
+### 表单校验
+
+配合 `FieldError` 使用 `isInvalid` 展示校验消息。
+
+
+
+### 时间粒度
+
+
+
+### 受控组件
+
+使用 `v-model` 控制日期值,以与其他组件或状态管理同步。
+
+
+
+### 表单示例
+
+包含校验与提交的完整表单示例。
+
+
+
+### 带校验
+
+DateField 支持 `minValue`、`maxValue` 与自定义校验逻辑。
+
+
+
+### 渲染函数
+
+
+
+## 自定义样式
+
+### Tailwind CSS
+
+
+
+### 全局 CSS
+
+DateField 默认样式较轻量。覆盖 `.hv-date-field` 类可自定义容器样式。
+
+```css
+@layer components {
+ .hv-date-field {
+ @apply flex flex-col gap-1;
+
+ &[data-invalid="true"],
+ &[aria-invalid="true"] {
+ [data-slot="description"] {
+ @apply hidden;
+ }
+ }
+
+ [data-slot="label"] {
+ @apply w-fit;
+ }
+
+ [data-slot="description"] {
+ @apply px-1;
+ }
+ }
+}
+```
+
+## 样式参考
+
+HeroUI 遵循 [BEM](https://getbem.com/) 方法论,确保组件变体与状态可复用且易于自定义。
+
+### CSS 类
+
+- `.hv-date-field` – 轻量样式的根容器(`flex flex-col gap-1`)
+
+> **Note:** 子组件([Label](/components/label)、[Description](/components/description)、[FieldError](/components/field-error))拥有各自的 CSS 类与样式。自定义方式请参阅对应文档。DateFieldGroup 样式见下文 API 参考。
+
+### 交互状态
+
+DateField 会根据状态自动设置以下 data 属性:
+
+- **Invalid**:`[data-invalid="true"]` 或 `[aria-invalid="true"]` - 无效时自动隐藏 description slot
+- **Required**:`[data-required="true"]` - 当 `isRequired` 为 true 时应用
+- **Disabled**:`[data-disabled="true"]` - 当 `isDisabled` 为 true 时应用
+- **Focus Within**:`[data-focus-within="true"]` - 任一子输入聚焦时应用
+
+## API 参考
+
+### DateField
+
+DateField 使用 Vue 日期值、作用域插槽和共享字段协议。与固定 HeroUI 基线的差异见下方兼容说明。
+
+#### Base Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| ----------- | ---------------- | ------- | ---------------------------------------------------- |
+| 默认插槽 | `DateFieldState` | - | 子组件(Label、DateFieldGroup 等),支持作用域状态。 |
+| `class` | `string` | - | 与组件默认样式合并。 |
+| `style` | `StyleValue` | - | Vue 内联样式。 |
+| `fullWidth` | `boolean` | `false` | 日期字段是否占满容器宽度。 |
+| `id` | `string` | - | 元素的唯一 id。 |
+| `as` | `string` | `"div"` | 自定义容器元素,属性与事件绑定到该容器。 |
+
+#### Value Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| ------------------------------ | ------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------ |
+| `modelValue` / `value` | `DateValue \| null` | - | 当前值(受控)。类型见 [`@internationalized/date`](https://react-aria.adobe.com/internationalized/date/)。 |
+| `defaultValue` | `DateValue \| null` | - | 默认值(非受控)。类型见 [`@internationalized/date`](https://react-aria.adobe.com/internationalized/date/)。 |
+| `update:modelValue` / `change` | `(value: DateValue \| null) => void` | - | 值变化时触发的事件处理函数。 |
+| `placeholderValue` | `DateValue \| null` | - | 影响占位符格式的占位日期。 |
+
+#### Validation Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| -------------------- | ------------------------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------- |
+| `isRequired` | `boolean` | `false` | 是否在提交表单前要求用户输入。 |
+| `isInvalid` | `boolean` | - | 值是否无效。 |
+| `minValue` | `DateValue \| null` | - | 用户可选择最早日期。类型见 [`@internationalized/date`](https://react-aria.adobe.com/internationalized/date/)。 |
+| `maxValue` | `DateValue \| null` | - | 用户可选择最晚日期。类型见 [`@internationalized/date`](https://react-aria.adobe.com/internationalized/date/)。 |
+| `isDateUnavailable` | `(date: DateValue) => boolean` | - | 针对每个日期调用;返回 true 表示该日期不可用。 |
+| `validate` | `(value: DateValue \| null) => string \| string[] \| true \| null \| undefined` | - | 自定义校验函数。 |
+| `validationBehavior` | `'native' \| 'aria'` | `'native'` | 使用原生 HTML 表单校验还是 ARIA 属性。 |
+
+#### Format Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| ------------------------- | ------------- | ------- | ----------------------------------------------------------- |
+| `granularity` | `Granularity` | - | 显示的最小单位。日期默认为 `"day"`,时间默认为 `"minute"`。 |
+| `hourCycle` | `12 \| 24` | - | 以 12 或 24 小时制显示时间;默认由语言环境决定。 |
+| `hideTimeZone` | `boolean` | `false` | 是否隐藏时区缩写。 |
+| `shouldForceLeadingZeros` | `boolean` | - | 是否始终为月、日、小时等显示前导零。 |
+
+#### State Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| ------------ | --------- | ------ | ---------------------- |
+| `isDisabled` | `boolean` | - | 是否禁用输入。 |
+| `isReadOnly` | `boolean` | - | 是否可选中但不可修改。 |
+
+#### Form Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| -------------- | --------- | ------ | ------------------------------------------------------------- |
+| `name` | `string` | - | 输入元素的 name,用于 HTML 表单提交;以 ISO 8601 字符串提交。 |
+| `autoFocus` | `boolean` | - | 是否在渲染后自动聚焦该元素。 |
+| `autoComplete` | `string` | - | 输入应提供的自动完成类型。 |
+
+#### Accessibility Props
+
+| Prop | 类型 | 默认值 | 描述 |
+| ------------------ | -------- | ------ | -------------------------- |
+| `aria-label` | `string` | - | 无可见标签时的无障碍标签。 |
+| `aria-labelledby` | `string` | - | 标注该字段的元素 id。 |
+| `aria-describedby` | `string` | - | 描述该字段的元素 id。 |
+| `aria-details` | `string` | - | 包含额外详情的元素 id。 |
+
+### Composition Components
+
+DateField 与以下独立组件配合使用,请分别导入并直接使用:
+
+- **Label** – 来自 `@heroui-vue/components` 的字段标签
+- **DateFieldGroup** – 日期输入分组(详见下文)
+- **DateFieldInput** – 来自 `@heroui-vue/components` 的分段位编辑输入
+- **DateFieldInputContainer** – 可横向滚动的容器,用于组合多个输入(例如开始/结束范围)
+- **DateFieldSegment** – 单个日期段位(年、月、日等)
+- **DateFieldPrefix** / **DateFieldSuffix** – 输入组的前缀与后缀插槽
+- **Description** – 来自 `@heroui-vue/components` 的辅助说明
+- **FieldError** – 来自 `@heroui-vue/components` 的校验错误信息
+
+这些组件各自有独立的 props API。在 DateField 中直接组合使用:
+
+```vue
+
+
+
+
+
+
+
+
+
+ Select a date from today onwards.
+
+
+
+```
+
+### DateValue Types
+
+DateField 使用 [`@internationalized/date`](https://react-aria.adobe.com/internationalized/date/) 中的类型:
+
+- `CalendarDate` – 不含时间与时区的日期
+- `CalendarDateTime` – 含时间、不含时区
+- `ZonedDateTime` – 含时间与时区
+
+`Time` 仅表示时间,不属于 DateField 的 `DateValue`;后续 TimeField 单独提供。
+
+示例:
+
+```ts
+import { parseDate, today, getLocalTimeZone } from "@internationalized/date";
+const date = parseDate("2024-01-15");
+const todayDate = today(getLocalTimeZone());
+```
+
+> **说明:** DateField 依赖 [`@internationalized/date`](https://react-aria.adobe.com/internationalized/date/) 进行解析、运算与类型定义。更多类型与函数见 [Internationalized Date 文档](https://react-aria.adobe.com/internationalized/date/)。
+
+### Render Props
+
+默认作用域插槽可读取以下状态;`class`、`style` 使用 Vue 绑定表达式。
+
+| Prop | 类型 | 描述 |
+| ------------------ | ------------------- | ---------------------- |
+| `isDisabled` | `boolean` | 字段是否禁用。 |
+| `isInvalid` | `boolean` | 字段当前是否无效。 |
+| `isReadOnly` | `boolean` | 字段是否只读。 |
+| `isRequired` | `boolean` | 字段是否必填。 |
+| `isFocusVisible` | `boolean` | 键盘焦点是否可见。 |
+| `isFocused` | `boolean` | 字段是否聚焦。 |
+| `isFocusWithin` | `boolean` | 是否有子元素聚焦。 |
+| `value` | `DateValue \| null` | 当前接受的日期。 |
+| `validationErrors` | `string[]` | 当前可显示的校验错误。 |
+
+### DateFieldGroup
+
+DateFieldGroup 与独立 DateInputGroup 共用部件,透传原生容器属性,并支持:
+
+| Prop | 类型 | 默认值 | 描述 |
+| ----------- | -------------------------- | ----------- | -------------------------------------------------------------------------------------- |
+| `class` | `string` | - | 与组件样式合并的 Tailwind CSS 类。 |
+| `fullWidth` | `boolean` | `false` | 日期输入组是否占满容器宽度。 |
+| `variant` | `"primary" \| "secondary"` | `"primary"` | 视觉变体。`primary` 为默认带阴影样式;`secondary` 为低强调、无阴影,适合用于 Surface。 |
+
+### DateFieldInput
+
+DateFieldInput 使用默认作用域插槽逐段渲染;省略插槽时自动渲染全部段位。
+
+| Prop | 类型 | 默认值 | 描述 |
+| ------- | -------- | ------- | ---------------------------------- |
+| `class` | `string` | - | 与组件样式合并的 Tailwind CSS 类。 |
+| `as` | `string` | `"div"` | 输入容器元素。 |
+
+`DateFieldInput` 通过 `v-slot="{ segment, index }"` 提供日期段位;每个段位对应日期的一部分(年、月、日等)。
+
+### DateFieldSegment
+
+DateFieldSegment 渲染来自输入作用域插槽的段位:
+
+| Prop | 类型 | 默认值 | 描述 |
+| --------- | ------------- | ------ | ----------------------------------------------------- |
+| `segment` | `DateSegment` | - | 来自 DateFieldInput 作用域插槽的 `DateSegment` 对象。 |
+| `class` | `string` | - | 与组件样式合并的 Tailwind CSS 类。 |
+
+### DateFieldInputContainer
+
+DateFieldInputContainer 接受标准 HTML `div` 属性:
+
+| Prop | 类型 | 默认值 | 描述 |
+| -------- | -------- | ------ | ------------------------------------------------- |
+| `class` | `string` | - | 与组件样式合并的 Tailwind CSS 类。 |
+| 默认插槽 | 默认插槽 | - | 滚动容器中的内容(通常为多个 `DateFieldInput`)。 |
+
+### DateFieldPrefix
+
+DateFieldPrefix 接受标准 HTML `div` 属性:
+
+| Prop | 类型 | 默认值 | 描述 |
+| -------- | -------- | ------ | ---------------------------------- |
+| `class` | `string` | - | 与组件样式合并的 Tailwind CSS 类。 |
+| 默认插槽 | 默认插槽 | - | 前缀插槽中要显示的内容。 |
+
+### DateFieldSuffix
+
+DateFieldSuffix 接受标准 HTML `div` 属性:
+
+| Prop | 类型 | 默认值 | 描述 |
+| -------- | -------- | ------ | ---------------------------------- |
+| `class` | `string` | - | 与组件样式合并的 Tailwind CSS 类。 |
+| 默认插槽 | 默认插槽 | - | 后缀插槽中要显示的内容。 |
+
+## DateFieldGroup Styling
+
+### Customizing the component classes
+
+基础类作用于所有实例,可通过 `@layer components` 一次性覆盖。
+
+```css
+@layer components {
+ .hv-date-input-group {
+ @apply inline-flex h-9 items-center overflow-hidden rounded-field border bg-field text-sm text-field-foreground shadow-field outline-none;
+
+ &:hover,
+ &[data-hovered="true"] {
+ @apply bg-field-hover;
+ }
+
+ &[data-focus-within="true"],
+ &:focus-within {
+ @apply status-focused-field;
+ }
+
+ &[data-invalid="true"] {
+ @apply status-invalid-field;
+ }
+
+ &[data-disabled="true"],
+ &[aria-disabled="true"] {
+ @apply status-disabled;
+ }
+ }
+
+ .hv-date-input-group__input {
+ @apply flex flex-1 items-center gap-px rounded-none border-0 bg-transparent px-3 py-2 shadow-none outline-none;
+ }
+
+ .hv-date-input-group__segment {
+ @apply inline-block rounded-md px-0.5 text-end tabular-nums outline-none;
+
+ &:focus,
+ &[data-focused="true"] {
+ @apply bg-accent-soft text-accent-soft-foreground;
+ }
+ }
+
+ .hv-date-input-group__input-container {
+ @apply flex flex-1 items-center;
+ overflow-x: auto;
+ overflow-y: clip;
+ scrollbar-width: none;
+ }
+
+ .hv-date-input-group__prefix,
+ .hv-date-input-group__suffix {
+ @apply pointer-events-none shrink-0 text-field-placeholder flex items-center;
+ }
+}
+```
+
+### DateFieldGroup CSS Classes
+
+- `.hv-date-input-group` – 根容器样式
+- `.hv-date-input-group__input` – 输入包裹层样式
+- `.hv-date-input-group__input-container` – 用于组合多个输入的滚动容器
+- `.hv-date-input-group__segment` – 单个日期段位样式
+- `.hv-date-input-group__prefix` – 前缀元素样式
+- `.hv-date-input-group__suffix` – 后缀元素样式
+
+### DateFieldGroup Interactive States
+
+- **Hover**:`:hover` 或 `[data-hovered="true"]`
+- **Focus Within**:`[data-focus-within="true"]` 或 `:focus-within`
+- **Invalid**:`[data-invalid="true"]`(与 `aria-invalid` 同步)
+- **Disabled**:`[data-disabled="true"]` 或 `[aria-disabled="true"]`
+- **Segment Focus**:段位上 `:focus` 或 `[data-focused="true"]`
+- **Segment Placeholder**:段位上 `[data-placeholder="true"]`
+
+## 相关组件
+
+[TextField 文本输入框](./text-field) · [NumberField 数字输入框](./number-field) · [Select 选择器](./select)
+
+## Vue 兼容说明
+
+- DateField 七部件与 DateInputGroup 六部件共用实现。React 对象组合名改为具名导出,`render` 改为 `as`,渲染函数改为作用域插槽。
+- 值使用 `v-model` / `update:modelValue`,`change` 是同一次日期提案通知。父组件拒绝更新时显示恢复接受值;未完成的空字段分段输入保留为草稿。显式 `null` / `undefined` 均表示受控空值,初始值只用于非受控状态。
+- 分段按 locale 日历显示,事件与原生 ISO 提交保留原始模型日历、时间精度和命名时区;`granularity` 只改变显示,不截断提交值。可用 `locale` / `dir` 覆盖 ConfigProvider。
+- `autoComplete` 传给视觉隐藏的 ISO 文本提交输入;自动填充的 ISO 输入与普通编辑共用接受值协议,不承诺各浏览器会为分段字段提供日期自动填充建议。
+- 安装版 Reka 2.11.0 的 Root 忽略 `asChild`,内部保留一个无视觉包装;`as`、样式及 DOM 引用归属本库内层容器。原底座左右段位导航不检查 `defaultPrevented`,拦截左右导航时在 Segment 使用 `@keydown.stop.prevent`;仅 `.prevent` 可取消数字/增减编辑,但不能取消祖先底座导航。
+- 本轮支持键盘与输入法数字编辑。底座没有完整日期粘贴解析;不声明支持粘贴任意本地化日期字符串。全格式粘贴、不同日历的 13 月/era 编辑和完整读屏验收仍需后续专项补齐。
+- 默认占位日期采用当前本地日期;SSR 跨时区使用者应传入明确的 `placeholderValue` 或初始日期以固定首屏。
diff --git a/apps/docs/demos/date-field-basic.vue b/apps/docs/demos/date-field-basic.vue
new file mode 100644
index 0000000..d6e77f0
--- /dev/null
+++ b/apps/docs/demos/date-field-basic.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-controlled.vue b/apps/docs/demos/date-field-controlled.vue
new file mode 100644
index 0000000..eb443c7
--- /dev/null
+++ b/apps/docs/demos/date-field-controlled.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+ 当前值:{{ value ? value.toString() : "(空)" }}
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-custom-styles.vue b/apps/docs/demos/date-field-custom-styles.vue
new file mode 100644
index 0000000..e9cc6b6
--- /dev/null
+++ b/apps/docs/demos/date-field-custom-styles.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-disabled.vue b/apps/docs/demos/date-field-disabled.vue
new file mode 100644
index 0000000..9fe5b8f
--- /dev/null
+++ b/apps/docs/demos/date-field-disabled.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+ 该日期字段已禁用
+
+
+
+
+
+
+
+
+ 该日期字段已禁用
+
+
+
diff --git a/apps/docs/demos/date-field-form-example.vue b/apps/docs/demos/date-field-form-example.vue
new file mode 100644
index 0000000..cb3221e
--- /dev/null
+++ b/apps/docs/demos/date-field-form-example.vue
@@ -0,0 +1,70 @@
+
+
+
+
diff --git a/apps/docs/demos/date-field-full-width.vue b/apps/docs/demos/date-field-full-width.vue
new file mode 100644
index 0000000..9df5bdc
--- /dev/null
+++ b/apps/docs/demos/date-field-full-width.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-granularity.vue b/apps/docs/demos/date-field-granularity.vue
new file mode 100644
index 0000000..03bf5f5
--- /dev/null
+++ b/apps/docs/demos/date-field-granularity.vue
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 决定日期选择器显示的最小单位。默认情况下,日期为「日」,时间为「分」。
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-invalid.vue b/apps/docs/demos/date-field-invalid.vue
new file mode 100644
index 0000000..d55b972
--- /dev/null
+++ b/apps/docs/demos/date-field-invalid.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+ 请输入有效日期
+
+
+
+
+
+
+
+
+ 日期须为将来
+
+
+
diff --git a/apps/docs/demos/date-field-on-surface.vue b/apps/docs/demos/date-field-on-surface.vue
new file mode 100644
index 0000000..afd9680
--- /dev/null
+++ b/apps/docs/demos/date-field-on-surface.vue
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+ 输入日期
+
+
+
+
+
+
+
+
+
+
+
+ 输入预约日期
+
+
+
diff --git a/apps/docs/demos/date-field-render-function.vue b/apps/docs/demos/date-field-render-function.vue
new file mode 100644
index 0000000..1de5d52
--- /dev/null
+++ b/apps/docs/demos/date-field-render-function.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-required.vue b/apps/docs/demos/date-field-required.vue
new file mode 100644
index 0000000..ca91a1f
--- /dev/null
+++ b/apps/docs/demos/date-field-required.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 必填项
+
+
+
diff --git a/apps/docs/demos/date-field-variants.vue b/apps/docs/demos/date-field-variants.vue
new file mode 100644
index 0000000..900aca6
--- /dev/null
+++ b/apps/docs/demos/date-field-variants.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-with-description.vue b/apps/docs/demos/date-field-with-description.vue
new file mode 100644
index 0000000..2087640
--- /dev/null
+++ b/apps/docs/demos/date-field-with-description.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+ 输入出生日期
+
+
+
+
+
+
+
+
+ 输入预约日期
+
+
+
diff --git a/apps/docs/demos/date-field-with-prefix-and-suffix.vue b/apps/docs/demos/date-field-with-prefix-and-suffix.vue
new file mode 100644
index 0000000..dccf410
--- /dev/null
+++ b/apps/docs/demos/date-field-with-prefix-and-suffix.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 输入日期
+
+
diff --git a/apps/docs/demos/date-field-with-prefix-icon.vue b/apps/docs/demos/date-field-with-prefix-icon.vue
new file mode 100644
index 0000000..4875762
--- /dev/null
+++ b/apps/docs/demos/date-field-with-prefix-icon.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-with-suffix-icon.vue b/apps/docs/demos/date-field-with-suffix-icon.vue
new file mode 100644
index 0000000..6358720
--- /dev/null
+++ b/apps/docs/demos/date-field-with-suffix-icon.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/docs/demos/date-field-with-validation.vue b/apps/docs/demos/date-field-with-validation.vue
new file mode 100644
index 0000000..8c8e275
--- /dev/null
+++ b/apps/docs/demos/date-field-with-validation.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+ 日期须为今天或将来
+ 输入日期 from today onwards
+
+
+
diff --git a/docs/compatibility.md b/docs/compatibility.md
index 252b3f2..956ee52 100644
--- a/docs/compatibility.md
+++ b/docs/compatibility.md
@@ -2,91 +2,91 @@
基于固定上游提交的公共组件导出清单。验证中不等于完整兼容;目前没有组件完成视觉、浏览器与完整行为验收。
-| 组件 | 状态 | 当前能力 / 差异 |
-| -------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| accordion | 验证中(M23) | Accordion/Item/Heading/Trigger/Panel/Body/Indicator;10/10 基线例;surface/hideSeparator;复用组键协议 |
-| alert-dialog | 验证中(M33) | 11 部件;role=alertdialog;默认不误关;14/14 基线例;Reka Dialog 底座 |
-| autocomplete | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| avatar | 验证中(最小实现) | Reka Avatar 加载/回退;size/color/variant;Image asChild;AvatarGroup 继承仅限直接子级 |
-| avatar-group | 验证中(最小实现) | max 截断与自动计数、显式 Count 不受截断、isGrid、overlap clip/ring;默认无 role=group |
-| badge | 验证中(最小实现) | Badge/BadgeAnchor/BadgeLabel;四角定位、圆点、文本/数字自动包装;Anchor 非链接 |
-| breadcrumbs | 验证中(M17) | Breadcrumbs/BreadcrumbsItem;7/7 基线例;ol+aria-label、末项 current、禁用/无 href span、separator 插槽;onAction 未提供,class 同时落 li/link |
-| button | 验证中(最小实现) | 基线全部 7 种变体、尺寸、isIconOnly/isDisabled/isPending;PressEvent 与 Vue click 差异见文档 |
-| button-group | 验证中(M26) | ButtonGroup/ButtonGroupSeparator;9/9 基线例;直接子 Button 继承 size/variant/isDisabled/fullWidth;嵌套不继承;圆角与 outline 边框处理 |
-| card | 验证中(最小实现) | 4 种表面变体;Header/Title/Description/Content/Footer 已实现;以基线 CSS 为准 |
-| checkbox | 验证中(基线实现) | 原生 label/input;checked/isSelected、半选、primary/secondary、Content/Control/Indicator;15 个基线预览 |
-| checkbox-group | 验证中(基线实现) | 数组模型、同名重复提交、required/readonly/disabled/reset、组标签与成员描述隔离;10 个基线预览 |
-| chip | 验证中(最小实现) | color/size/variant;纯文本/数字自动包装为 ChipLabel;显式部件不重复包装;组合内容可动态切换 |
-| color-area | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| color-field | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| color-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| color-slider | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| color-swatch | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| color-swatch-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| close-button | 验证中(最小实现) | 专用 CSS/变体、默认基线 CloseIcon、插槽替换图标、isDisabled、aria-label 默认 Close;onPress 由 click 适配 |
-| combo-box | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| date-field | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| date-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| date-range-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| drawer | 验证中(M34) | 11 部件;四方向拖动关闭(30%/0.5px/ms);9/9 基线例;Content/Dialog 职责分离 |
-| progress-bar | 验证中(M18) | ProgressBar/Output/Track/Fill;7/7 基线例;确定/未知进度、min/max/formatOptions/valueLabel;custom-value 的 NumberField/Select 为原生临时控件 |
-| progress-circle | 验证中(M19) | ProgressCircle/Track/TrackCircle/FillCircle;7/7 基线例;圆环几何可覆盖;与 ProgressBar 共用取值语义 |
-| time-field | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| disclosure | 验证中(M21) | Disclosure/Heading/Trigger/Content/Body/Indicator;3/3 基线例;v-model:expanded;asChild 触发;高度动画映射测量变量 |
-| disclosure-group | 验证中(M22) | DisclosureGroup + useDisclosureGroupNavigation;3/3 基线例;展开键为数组(string 或 number);单选替换/多选增量 |
-| error-message | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| kbd | 验证中(最小实现) | variant;KbdAbbr keyValue 映射与 title;KbdContent;上下文类名;导出 kbdKeysMap/LabelMap |
-| link | 验证中(最小实现) | 原生 a + LinkIcon;isDisabled/asChild/焦点与 data 状态;默认图标为基线 ExternalLinkIcon;onPress 由 click 适配 |
-| popover | 验证中(OVERLAY-02) | Root/Trigger/Content/Dialog/Heading/Arrow;6/6 基线例;逻辑定位/碰撞/退出/标题;模态 closeAutoFocus 不支持取消恢复,见 OVERLAY-02 |
-| scroll-shadow | 验证中(M24) | 7/7 基线例;fade/方向/尺寸/偏移/受控可见性;VueUse 测量与公开 useScrollShadow,RTL/动态内容;CSS scroll timeline 保留 |
-| separator | 验证中(最小实现) | orientation/variant/decorative;默认 hr + role=separator;asChild 自定义根;Reka Separator |
-| skeleton | 验证中(最小实现) | shimmer/pulse/none、--skeleton-animation 全局默认、父级单次 shimmer;挂载后改 CSS 变量不自动更新 |
-| spinner | 验证中(最小实现) | size/color 变体、role=status、内置渐变 SVG;嵌入 Button 保持 16px;reduced-motion 支持 |
-| surface | 验证中(最小实现) | 4 种变体、data-slot、surfaceContextKey 提供当前变体;Input 文档表面示例已替换为 Surface |
-| toast | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| toggle-button | 验证中(M27) | ToggleButton;7/7 基线例;v-model/isSelected/defaultSelected;data-selected/pressed/hover/focus;Enter/Space;组内 radio 语义 |
-| switch | 验证中(最小实现) | 根字段与组合部件、3 尺寸、ARIA 透传、原生/ARIA 校验、FormData/reset;PressEvent 不等价 |
-| switch-group | 验证中(布局) | vertical/horizontal;不共享选择值,已移植基线 CSS |
-| tabs | 验证中(M25) | 七部件、10/10 基线例;primary/secondary、方向/对齐、受控/键盘/禁用/滚动/指示器;Vue 模型与 ID/集合差异见报告 |
-| tag | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| tag-group | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| toggle-button-group | 验证中(M28) | ToggleButtonGroup/Separator;10/10 基线例;single/multiple、disallowEmptySelection、roving focus;Vue 数组模型替代 Set |
-| toolbar | 验证中(M29) | Toolbar;5/5 基线例;isAttached/orientation/dir;跨组单 Tab 入口与方向键;子组焦点让位;Separator 垂直继承 |
-| tooltip | 验证中(OVERLAY-02) | Root/Trigger/Content/Arrow;6/6 基线例;CSS 延迟/焦点/禁用/替换/定位;Provider warmup 与 RAC 全局调度不同 |
-| input | 验证中(字段接入) | 接入 TextField;复用值恢复/reset/ARIA;独立使用保持兼容;完整消费验收未完成 |
-| input-group | 验证中(字段接入) | Root/Input/TextArea/Prefix/Suffix;复用 useTextControl;变体继承 TextField 可覆盖;前后缀非表单字段 |
-| textarea | 验证中(字段接入) | rows 默认 3;变体/fullWidth/受控/FormData/reset;独立页 7/7 示例;接入 useTextControl |
-| textfield | 验证中(字段接入) | 值/状态/约束/校验/ID;独立页 13/13 示例;render 自定义根类型未支持(data-* 透传) |
-| search-field | 验证中(FORM-02) | 五部件、15 基线例;共享文本内核、clear/submit/IME/reset/SSR,边界见 FORM-02 |
-| typography | 验证中(M15) | Typography/Heading/Paragraph/Code/Prose 具名导出;6/6 基线例;type/as/align/color/weight/truncate;render 映射为 as |
-| label | 验证中(通用字段) | 自动 for、Switch 内 span、状态继承;独立页 2/2 示例 |
-| description | 验证中(通用字段) | 动态 ID 清理、外部 describedby 合并;独立页 2/2 示例;SSR 包装限制见基础协议 |
-| empty-state | 验证中(M16) | 单根 EmptyState;4 个自编示例(基线无页面/示例);默认 fallback;空节点判断与上游 children 真值回退边界不同 |
-| field-error | 验证中(通用字段) | 作用域插槽 validationErrors;独立页 2/2 示例;无完整 validationDetails(见基础协议) |
-| fieldset | 验证中(FORM-02) | 四部件、3 基线例与禁用验证例;响应式禁用、首 Legend 例外,边界见 FORM-02 |
-| form | 验证中(基础设施) | native/aria 校验、FormData/reset、服务端错误;完整基线文档与生态集成未完成 |
-| header | 验证中(M31) | Header/HeaderRoot;原生 `` 集合分组标题;基线无独立文档/演示,自编 3 例并标注;无 v-model |
-| radio | 验证中(基线实现) | 原生 radio + Content/Control/Indicator;须在 RadioGroup 内,成员禁用/只读、作用域状态 |
-| radio-group | 验证中(基线实现) | 标量模型、roving Tab/方向键/dir/loop、原生提交/校验/reset;12 个基线预览 |
-| input-otp | 验证中(M32) | Root/Group/Slot/Separator + 3 正则常量;Reka PinInput 底座;字符串+索引数组;reset/Fieldset/Form/ARIA/mask 已接入;11/11 例;自动填充/IME/读屏未真机验证 |
-| alert | 验证中(最小实现) | status 五态;默认图标随 status;自定义 Indicator 空内容回退;内部 Surface 重置为 default |
-| list-box | 验证中(LISTBOX-01) | 四部件、9/9 基线例;typed key/数组模型、none/single/multiple、键盘/范围/全选、1000 项固定行高虚拟化;差异见 LISTBOX-01 |
-| list-box-item | 验证中(LISTBOX-01) | ListBox 子部件;独立标签/描述作用域、自动分组名称、原生标签替换、状态/指示器;见 LISTBOX-01 |
-| list-box-section | 验证中(LISTBOX-01) | ListBox 子部件;独立标签/描述作用域、自动分组名称、原生标签替换、状态/指示器;见 LISTBOX-01 |
-| dropdown | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| menu | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| menu-item | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| menu-section | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| modal | 验证中(OVERLAY-02) | Root/Trigger/Backdrop/Container/Dialog/Heading/Header/Body/Footer/Icon/Close/CloseTrigger;14/14 基线例;焦点/锁/滚动/退出动画;Vue close 部件替代 React slot |
-| pagination | 验证中(M30) | 组合式 nav 容器(无 total/page 状态机);11 具名部件;9/9 基线例;onPress→@click;显式 aria-current 可覆盖 |
-| number-field | 验证中(NUMBER-01) | 五部件与 17/17 基线例;Reka 数值内核;受控/只读/表单 reset、SSR/水合;差异见 NUMBER-01 报告 |
-| select | 验证中(SELECT-01) | 六部件、19/19 例、单/多选、清空、字段/原生提交/SSR/异步;复用 ListBox + Popover,重点浏览器已验,限制见 SELECT-01 |
-| meter | 验证中(M20) | Meter/Output/Track/Fill;6/6 基线例;role=meter progressbar;无 isIndeterminate;测量语义独立于 Progress |
-| slider | 验证中(SLIDER-01) | 六部件、9/9 基线例;原生 range/局部指针适配,单值/范围、受控/reset/SSR/水合;差异见 SLIDER-01 |
-| table | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| calendar | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| range-calendar | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
-| calendar-year-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| 组件 | 状态 | 当前能力 / 差异 |
+| -------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| accordion | 验证中(M23) | Accordion/Item/Heading/Trigger/Panel/Body/Indicator;10/10 基线例;surface/hideSeparator;复用组键协议 |
+| alert-dialog | 验证中(M33) | 11 部件;role=alertdialog;默认不误关;14/14 基线例;Reka Dialog 底座 |
+| autocomplete | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| avatar | 验证中(最小实现) | Reka Avatar 加载/回退;size/color/variant;Image asChild;AvatarGroup 继承仅限直接子级 |
+| avatar-group | 验证中(最小实现) | max 截断与自动计数、显式 Count 不受截断、isGrid、overlap clip/ring;默认无 role=group |
+| badge | 验证中(最小实现) | Badge/BadgeAnchor/BadgeLabel;四角定位、圆点、文本/数字自动包装;Anchor 非链接 |
+| breadcrumbs | 验证中(M17) | Breadcrumbs/BreadcrumbsItem;7/7 基线例;ol+aria-label、末项 current、禁用/无 href span、separator 插槽;onAction 未提供,class 同时落 li/link |
+| button | 验证中(最小实现) | 基线全部 7 种变体、尺寸、isIconOnly/isDisabled/isPending;PressEvent 与 Vue click 差异见文档 |
+| button-group | 验证中(M26) | ButtonGroup/ButtonGroupSeparator;9/9 基线例;直接子 Button 继承 size/variant/isDisabled/fullWidth;嵌套不继承;圆角与 outline 边框处理 |
+| card | 验证中(最小实现) | 4 种表面变体;Header/Title/Description/Content/Footer 已实现;以基线 CSS 为准 |
+| checkbox | 验证中(基线实现) | 原生 label/input;checked/isSelected、半选、primary/secondary、Content/Control/Indicator;15 个基线预览 |
+| checkbox-group | 验证中(基线实现) | 数组模型、同名重复提交、required/readonly/disabled/reset、组标签与成员描述隔离;10 个基线预览 |
+| chip | 验证中(最小实现) | color/size/variant;纯文本/数字自动包装为 ChipLabel;显式部件不重复包装;组合内容可动态切换 |
+| color-area | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| color-field | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| color-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| color-slider | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| color-swatch | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| color-swatch-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| close-button | 验证中(最小实现) | 专用 CSS/变体、默认基线 CloseIcon、插槽替换图标、isDisabled、aria-label 默认 Close;onPress 由 click 适配 |
+| combo-box | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| date-field | 已迁移(有已知差异) | DateField 七部件与 DateInputGroup 六部件、17 预览;完整 ISO、字段校验、reset、SSR/水合与浏览器重点检查,见 DATE-02 报告;本地化整日期粘贴、13 月/era 编辑等仍待专项。 |
+| date-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| date-range-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| drawer | 验证中(M34) | 11 部件;四方向拖动关闭(30%/0.5px/ms);9/9 基线例;Content/Dialog 职责分离 |
+| progress-bar | 验证中(M18) | ProgressBar/Output/Track/Fill;7/7 基线例;确定/未知进度、min/max/formatOptions/valueLabel;custom-value 的 NumberField/Select 为原生临时控件 |
+| progress-circle | 验证中(M19) | ProgressCircle/Track/TrackCircle/FillCircle;7/7 基线例;圆环几何可覆盖;与 ProgressBar 共用取值语义 |
+| time-field | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| disclosure | 验证中(M21) | Disclosure/Heading/Trigger/Content/Body/Indicator;3/3 基线例;v-model:expanded;asChild 触发;高度动画映射测量变量 |
+| disclosure-group | 验证中(M22) | DisclosureGroup + useDisclosureGroupNavigation;3/3 基线例;展开键为数组(string 或 number);单选替换/多选增量 |
+| error-message | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| kbd | 验证中(最小实现) | variant;KbdAbbr keyValue 映射与 title;KbdContent;上下文类名;导出 kbdKeysMap/LabelMap |
+| link | 验证中(最小实现) | 原生 a + LinkIcon;isDisabled/asChild/焦点与 data 状态;默认图标为基线 ExternalLinkIcon;onPress 由 click 适配 |
+| popover | 验证中(OVERLAY-02) | Root/Trigger/Content/Dialog/Heading/Arrow;6/6 基线例;逻辑定位/碰撞/退出/标题;模态 closeAutoFocus 不支持取消恢复,见 OVERLAY-02 |
+| scroll-shadow | 验证中(M24) | 7/7 基线例;fade/方向/尺寸/偏移/受控可见性;VueUse 测量与公开 useScrollShadow,RTL/动态内容;CSS scroll timeline 保留 |
+| separator | 验证中(最小实现) | orientation/variant/decorative;默认 hr + role=separator;asChild 自定义根;Reka Separator |
+| skeleton | 验证中(最小实现) | shimmer/pulse/none、--skeleton-animation 全局默认、父级单次 shimmer;挂载后改 CSS 变量不自动更新 |
+| spinner | 验证中(最小实现) | size/color 变体、role=status、内置渐变 SVG;嵌入 Button 保持 16px;reduced-motion 支持 |
+| surface | 验证中(最小实现) | 4 种变体、data-slot、surfaceContextKey 提供当前变体;Input 文档表面示例已替换为 Surface |
+| toast | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| toggle-button | 验证中(M27) | ToggleButton;7/7 基线例;v-model/isSelected/defaultSelected;data-selected/pressed/hover/focus;Enter/Space;组内 radio 语义 |
+| switch | 验证中(最小实现) | 根字段与组合部件、3 尺寸、ARIA 透传、原生/ARIA 校验、FormData/reset;PressEvent 不等价 |
+| switch-group | 验证中(布局) | vertical/horizontal;不共享选择值,已移植基线 CSS |
+| tabs | 验证中(M25) | 七部件、10/10 基线例;primary/secondary、方向/对齐、受控/键盘/禁用/滚动/指示器;Vue 模型与 ID/集合差异见报告 |
+| tag | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| tag-group | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| toggle-button-group | 验证中(M28) | ToggleButtonGroup/Separator;10/10 基线例;single/multiple、disallowEmptySelection、roving focus;Vue 数组模型替代 Set |
+| toolbar | 验证中(M29) | Toolbar;5/5 基线例;isAttached/orientation/dir;跨组单 Tab 入口与方向键;子组焦点让位;Separator 垂直继承 |
+| tooltip | 验证中(OVERLAY-02) | Root/Trigger/Content/Arrow;6/6 基线例;CSS 延迟/焦点/禁用/替换/定位;Provider warmup 与 RAC 全局调度不同 |
+| input | 验证中(字段接入) | 接入 TextField;复用值恢复/reset/ARIA;独立使用保持兼容;完整消费验收未完成 |
+| input-group | 验证中(字段接入) | Root/Input/TextArea/Prefix/Suffix;复用 useTextControl;变体继承 TextField 可覆盖;前后缀非表单字段 |
+| textarea | 验证中(字段接入) | rows 默认 3;变体/fullWidth/受控/FormData/reset;独立页 7/7 示例;接入 useTextControl |
+| textfield | 验证中(字段接入) | 值/状态/约束/校验/ID;独立页 13/13 示例;render 自定义根类型未支持(data-* 透传) |
+| search-field | 验证中(FORM-02) | 五部件、15 基线例;共享文本内核、clear/submit/IME/reset/SSR,边界见 FORM-02 |
+| typography | 验证中(M15) | Typography/Heading/Paragraph/Code/Prose 具名导出;6/6 基线例;type/as/align/color/weight/truncate;render 映射为 as |
+| label | 验证中(通用字段) | 自动 for、Switch 内 span、状态继承;独立页 2/2 示例 |
+| description | 验证中(通用字段) | 动态 ID 清理、外部 describedby 合并;独立页 2/2 示例;SSR 包装限制见基础协议 |
+| empty-state | 验证中(M16) | 单根 EmptyState;4 个自编示例(基线无页面/示例);默认 fallback;空节点判断与上游 children 真值回退边界不同 |
+| field-error | 验证中(通用字段) | 作用域插槽 validationErrors;独立页 2/2 示例;无完整 validationDetails(见基础协议) |
+| fieldset | 验证中(FORM-02) | 四部件、3 基线例与禁用验证例;响应式禁用、首 Legend 例外,边界见 FORM-02 |
+| form | 验证中(基础设施) | native/aria 校验、FormData/reset、服务端错误;完整基线文档与生态集成未完成 |
+| header | 验证中(M31) | Header/HeaderRoot;原生 `` 集合分组标题;基线无独立文档/演示,自编 3 例并标注;无 v-model |
+| radio | 验证中(基线实现) | 原生 radio + Content/Control/Indicator;须在 RadioGroup 内,成员禁用/只读、作用域状态 |
+| radio-group | 验证中(基线实现) | 标量模型、roving Tab/方向键/dir/loop、原生提交/校验/reset;12 个基线预览 |
+| input-otp | 验证中(M32) | Root/Group/Slot/Separator + 3 正则常量;Reka PinInput 底座;字符串+索引数组;reset/Fieldset/Form/ARIA/mask 已接入;11/11 例;自动填充/IME/读屏未真机验证 |
+| alert | 验证中(最小实现) | status 五态;默认图标随 status;自定义 Indicator 空内容回退;内部 Surface 重置为 default |
+| list-box | 验证中(LISTBOX-01) | 四部件、9/9 基线例;typed key/数组模型、none/single/multiple、键盘/范围/全选、1000 项固定行高虚拟化;差异见 LISTBOX-01 |
+| list-box-item | 验证中(LISTBOX-01) | ListBox 子部件;独立标签/描述作用域、自动分组名称、原生标签替换、状态/指示器;见 LISTBOX-01 |
+| list-box-section | 验证中(LISTBOX-01) | ListBox 子部件;独立标签/描述作用域、自动分组名称、原生标签替换、状态/指示器;见 LISTBOX-01 |
+| dropdown | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| menu | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| menu-item | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| menu-section | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| modal | 验证中(OVERLAY-02) | Root/Trigger/Backdrop/Container/Dialog/Heading/Header/Body/Footer/Icon/Close/CloseTrigger;14/14 基线例;焦点/锁/滚动/退出动画;Vue close 部件替代 React slot |
+| pagination | 验证中(M30) | 组合式 nav 容器(无 total/page 状态机);11 具名部件;9/9 基线例;onPress→@click;显式 aria-current 可覆盖 |
+| number-field | 验证中(NUMBER-01) | 五部件与 17/17 基线例;Reka 数值内核;受控/只读/表单 reset、SSR/水合;差异见 NUMBER-01 报告 |
+| select | 验证中(SELECT-01) | 六部件、19/19 例、单/多选、清空、字段/原生提交/SSR/异步;复用 ListBox + Popover,重点浏览器已验,限制见 SELECT-01 |
+| meter | 验证中(M20) | Meter/Output/Track/Fill;6/6 基线例;role=meter progressbar;无 isIndeterminate;测量语义独立于 Progress |
+| slider | 验证中(SLIDER-01) | 六部件、9/9 基线例;原生 range/局部指针适配,单值/范围、受控/reset/SSR/水合;差异见 SLIDER-01 |
+| table | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| calendar | 基建中(DATE-01,未公开) | 月历/多选/非公历/键盘/SSR 探针;公共部件、YearPicker 与 19 预览待实施,见日期基建决策 |
+| range-calendar | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
+| calendar-year-picker | 计划 | 待实施时核验子部件、属性、事件、键盘行为与替代底座 |
## 公共导出差异
diff --git a/docs/decisions/date-calendar-foundation.md b/docs/decisions/date-calendar-foundation.md
new file mode 100644
index 0000000..beef90d
--- /dev/null
+++ b/docs/decisions/date-calendar-foundation.md
@@ -0,0 +1,75 @@
+# DATE-01:日期字段与日历基建
+
+2026-10-23,独立目录 `heroui-vue-core`,`feat/date-calendar-foundation`,从同步并推送的 main `3c878d2` 新建。其他 AI 的 Toast/Table 任务与本目录隔离。
+
+## 基线和范围
+
+固定 HeroUI 3.2.6 / `ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960`。核对本地基线的 date-field、date-input-group、calendar、calendar-year-picker、date/time/range/picker 相关导出;对应 CSS/tv、中文正文及演示是后续公共迁移清单。
+
+- DateField 共七部件:Root、Group、Input、InputContainer、Segment、Prefix、Suffix。后六项实际复用 DateInputGroup;不能漏掉独立 DateInputGroup 的六个具名部件,也不能给 TimeField/DatePicker 再建一套分段输入内核。
+- DateField 中文正文 **16** 预览:basic、with-prefix-icon、with-suffix-icon、with-prefix-and-suffix、variants、on-surface、with-description、required、disabled、full-width、invalid、granularity、controlled、form-example、with-validation、custom-styles。目录的 render-function 存在,但不是该正文预览;后续作为补充,不替换任何基线例。
+- Calendar 中文正文 **19** 预览:basic、disabled、read-only、default-value、year-picker、controlled、min-max-dates、unavailable-dates、weeks-in-month、week-view、day-view、multiple-selection、focused-value、with-indicators、custom-icons、multiple-months、booking-calendar、international-calendar、custom-styles。
+- Calendar 为十个日历部件加六个 YearPicker 部件;CalendarYearPicker 独立导出及 Calendar 的便捷别名均须核对。visibleDuration 的 month/week/day、焦点日期、1900–2099 默认年界、非公历和范围族不是普通月历的同义词。
+
+本轮只落地私有日期值边界、接受值薄适配、安装版能力夹具和测试。**没有导出公共 DateField / Calendar,没有复制日期 CSS 或把未完成示例加入导航,不宣称组件或视觉迁移完成。**
+
+## 安装版本与依赖边界
+
+实际安装 Reka **2.11.0**、`@internationalized/date` **3.12.4**(Apache-2.0)。组件包将日期库声明为直接依赖并 external;根测试也显式声明,不依赖上游目录或碰巧提升的传递依赖。保留现有声明路径规范化,后续公开类型继续核对 bundler/NodeNext 正反例。
+
+不转成 JS Date 再还原 CalendarDate,不解析格式化的人类文字作为模型,不把 locale、calendar、timeZone 和 granularity 当作同一概念。
+
+## 真实底座结果
+
+探针为 `tests/date-foundation.test.ts` 和真正 node 的 `date-foundation-ssr.test.ts`。以下已操作实际 DOM / 焦点 / FormData / 事件载荷,未用组件仍挂载代替验收。
+
+| 场景 | Reka 2.11.0 结果 | 接续方案 |
+| ---------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
+| DateField day ArrowUp | 保留 CalendarDate 类并提交 ISO date | 可复用分段交互;公共事件用 DateValue/null |
+| DateField 受控拒绝 | 原生输入仍为父日期,day 分段却前移一天 | 私有接受值适配已证明修复,不保存乐观接受值 |
+| 原生 form.reset | 已编辑分段不恢复初值 | 复用 useChoiceForm,重置接受值并刷新 wire;取消/受控 reset 分开测 |
+| DateTime minute 显示 | 编辑后事件保留秒/毫秒,原生提交截断为 minute | 显示粒度不裁剪模型;唯一序列化层保留完整 toString |
+| ZonedDateTime | 分段可显示 PST,但 datetime-local 提交缺少 offset / zone | 保留完整 DateValue 和 zone,不拿本地 datetime 字符串当完整模型 |
+| 非公历 DateField | 原生输入按 calendar.year/month/day 拼值,与 ISO toString 不同 | 公共提交使用日期库的序列化边界 |
+| required/readonly/disabled | native required 生效;readonly 仍提交;disabled 不提交 | 公共字段仍消费本库 Fieldset/Form,不直接接 Reka FieldRoot 另建协议 |
+| locale 动态切换 | en-US 月/日/年切到 zh-CN 年/月/日 | 可复用格式化;组合部件需同步焦点和 DOM ref |
+| Calendar 闰月/禁用/不可用 | 2 月 29 日存在;方向键跳过 disabled,但可聚焦 unavailable;不可用项不能选择 | disabled 与 unavailable 分开,不能统一过滤成不可聚焦 |
+| Calendar 受控拒绝/重试 | 选择仍由父值控制,两次相同点击均发出提案 | 复用已接受选择语义 |
+| Calendar multiple | runtime 发 DateValue[],声明仍写 scalar emit/defaultValue | 公共 schema 自己定义,不从底座泛型/事件机械提取 |
+| Calendar 键盘取消 | 子 Cell 处理导航并 stopPropagation,Root 的 bubble keydown 无法取消已执行的移动 | 公共层必须先验证真实 asChild 节点取消;若仍过晚再局部适配键盘,不悄悄挪到 capture |
+| Calendar 两个月/fixedWeeks | 两张月表、每月 6 行 | 可复用普通月网格,不据此声称 week/day view 已具备 |
+| Gregorian 值 + Indian locale | 明确 Gregorian placeholder 时仍生成 Gregorian 2 月 29 项网格 | 明确转换视图 calendar,不能只换标题格式或静默改写公共模型 |
+| Calendar node SSR | 可输出选中日、闰月和日期值;CalendarGrid 默认为 role=application | 核对 RAC 真正 ARIA 与原生 asChild 归属后再适配,不能凭名字认定 role=grid |
+
+Calendar 键盘探针同时发送 key/code;安装版用 code 导航。只发 key 的 jsdom 事件不能作为“导航失败”的结论。
+
+## 已落地的私有值协议
+
+`packages/vue/src/components/date/` 不从公共入口导出。
+
+- `value.ts`:复制 CalendarDate / CalendarDateTime / ZonedDateTime,保留 calendar/era/时间精度/zone/offset;日期身份区分纯日期与午夜 DateTime、相同 ISO 下的不同日历。复制数组去重和范围保留不完整草稿,不把清空、未完成和倒置范围混同。
+- `serializeDateValue` 使用完整 toString,null/undefined 为空字符串;未来公共表单须明确单选/多选/范围的 name 规则,底座不再重复提交。
+- `calendarDayState` 按本地 calendar day 比较范围,并区分 disabled/unavailable/selectable。它只负责日历日,不冒充时间字段的精确时刻边界。
+- `dateForLocale` 只转换视图,保留日期类、时间/zone 和瞬时值;公共模型是否转换、变更事件如何返回必须由组件边界明确处理。
+- `model.ts` 复用既有 useChoiceValue:只保存接受值与捕获的初值。wire 为接受值副本,显式空值用 null 避免底座在 undefined 初值下进入 passive。完成提案后重新提供副本,让底座重新同步分段;部分未完成草稿仍留给底座,不在每个按键后清掉。
+- 受控拒绝时真实分段和提交保持父值,同一提案可重试;事件对象与内部值分别复制。非受控 reset 恢复初值,受控 reset 保留父值,不合成 change 事件。沿用 useChoiceForm 的归属/取消/清理,不建第二套 reset 监听器。
+
+`AcceptedDateFieldFoundation.vue` 是适配验证夹具,不是公开字段:它用 nameless 底座输入和一个完整 ISO 隐藏提交值证明边界;尚未实现本库 Label/Description/FieldError、完整字段约束、插槽与主题,不能拿它充数上线。
+
+## 验证与后续批次
+
+本轮新增 **39** 项:10 项值边界、15 项底座探针、10 项接受值/表单/实际 jsdom 水合,以及 4 项真正 node SSR。模型类/秒毫秒/DST/alternate calendar、拒绝重试、取消 reset、SSR 与水合分别断言。最终完整回归数量见 verification.md。
+
+下一步按依赖顺序实施:
+
+1. **DateInputGroup + DateField**:七部件与独立组导出,复用 choice/field;接入 ConfigProvider locale/dir;对 defaultPlaceholder/SSR 时区、受控 null/undefined、不可用日期、原生约束、粘贴/IME、粒度动态切换逐项验证,完成全部 16 例及 granularity 例内 Select/Tooltip 组合。
+2. **Calendar + YearPicker**:先确定 Cell 导航取消/ARIA 适配,再实现月视图、多选、焦点/翻页、week/day view、YearPicker、国际历法及 19 例。不是用普通月表替换所有布局。范围与日期选择弹层沿用同一接受值/字段/overlay 边界。
+3. **Range/Picker/Time** 后续独立批次:未做探针的能力不能从同名导出推断;状态与唯一提交层由集成人维护,适合外包的展示/文档任务再按实际完成度派发。
+
+没有日期公共浏览器验收、自动逐像素、完整读屏/触屏、Nuxt 或日期产物安装结论。Select 本轮的浏览器结果只属于 Select,不能挪作日期家族验收。
+
+## DATE-02 接续更新
+
+本轮公共 DateField/DateInputGroup 已实现,基线正文实际包含 render-function 共 **17** 例,早期 16 例计数更正。新增空值接受协议探针:完整空值提案被拒绝时要清空底座 segmentValues;仅刷新 null 副本不会触发 watch。使用公开注入上下文的局部适配,保持 DOM/焦点不变,见 [DATE-02](../migrations/DATE-02-date-field.md)。该报告和 verification.md 替代本文件此前“没有公开组件验收”的阶段状态。
+
+用户要求暂停后续日期组件;先做文档整体结构/布局/公共组件对齐。Calendar/YearPicker 仍只是底座探针。
diff --git a/docs/migration-handoff.md b/docs/migration-handoff.md
index 94c5166..2269e42 100644
--- a/docs/migration-handoff.md
+++ b/docs/migration-handoff.md
@@ -282,3 +282,11 @@ ListBox 已完成公共首轮实现,见 [报告](migrations/LISTBOX-01-list-bo
## SELECT-01 接续与复核要点
Select 已接入六部件和十九例,见 [报告](migrations/SELECT-01-select.md)。后续集合/日期选择字段复用 CollectionOwner / ListBox、choice/Form 与 overlay,不复制状态或焦点栈。通用弹层 role/ARIA 默认覆盖、非模态 Tab 仍循环、受控 reset 后原生 DOM 不回写、SSR 关闭态缺少元数据、空字符串布尔属性及动态删除留下幽灵提交是本轮重点回归。其他 AI 不自行修改这些共享协议。真实浏览器受 URL 策略阻断,仍待补验,不能把已通过的自动化检查当作最终视觉或交互验收。
+
+## DATE-01 日期基建分工
+
+集成人已开始[日期基建](decisions/date-calendar-foundation.md),尚未导出公开日期组件。其他 AI 的 Toast/Table 任务不依赖这些私有模块;不要修改 date/value/model 或另建日期表单协议。DateInputGroup 与 DateField、Calendar 与 YearPicker 先由集成人纵向验证,公开演示与可派发范围以后续交付为准。
+
+## 当前用户调整
+
+DateField 七部件与 DateInputGroup 六部件、17 例已落地,范围和差异见 [DATE-02](migrations/DATE-02-date-field.md)。历史“未公开”的文字是审计阶段记录。集成人完成本轮后暂停 Calendar,优先对齐文档站结构、布局和公共控件,消费已有库组件;暂缺组件保留现状。其他 AI 的 Toast/Table 与这个壳层任务分别保持任务分支和 checkout。
diff --git a/docs/migrations/DATE-02-date-field.md b/docs/migrations/DATE-02-date-field.md
new file mode 100644
index 0000000..e8c9e22
--- /dev/null
+++ b/docs/migrations/DATE-02-date-field.md
@@ -0,0 +1,22 @@
+# DATE-02 DateField / DateInputGroup
+
+固定来源:HeroUI 3.2.6,ce90ea3ab49d58f6c428f71bfd6fe8ae2a87b960;React date-field/date-input-group、两个同名 CSS/variants、中文正文和 **17** 个演示(包括 render-function)。Apache-2.0 归属保留在 third-party/HEROUI-LICENSE。
+
+## 实现
+
+DateField 七部件及独立 DateInputGroup 六部件共享分段模型和样式。采用已安装 Reka 2.11.0 日期交互与 @internationalized/date 3.12.4,复用 choice/field、Form、Fieldset、ConfigProvider 和 reset 设施。样式数值、状态、变体和中文例顺序来自基线,图标用 Tabler Vue。
+
+接受值与编辑草稿分离:显式 undefined/null 是受控空值;非空拒绝用副本恢复,空值完成提案被拒绝时通过公开 injectDateFieldRootContext 的 segmentValues 引用清空草稿,不替换 DOM 或焦点。未完成草稿保留,reset 则恢复捕获的初值或父接受值。底座升级需回归这一适配。
+
+唯一命名表单输入提交完整 ISO toString,底座截断 datetime-local 不再带 name/required。视觉隐藏 ISO 文本输入支持 autoComplete 透传与 ISO input 更新;分段显示粒度不截断秒、毫秒和 zone。字段约束通过既有无名代理承载,错误关联与标签使用共享协议。视图转换为 locale 日历,事件转回模型原始日历。
+
+## 验证与实际差异
+
+- 私有探针/模型与值协议、公共 DOM/键盘/FormData/reset/受控拒绝/约束/locale/粒度/IME composing、真正 Node SSR、jsdom 水合、17 个同源演示挂载及受控按钮行为分别验收。最终全量结果见 verification.md。
+- 5174 实际浏览器:空字段月/日/年逐段 ArrowUp,ISO 同步;受控设为今天/清空;Select 切到秒并保留 America/Los_Angeles,显示 PST;浅/深色、错误样式与分隔符;示例高亮 369 个样式 span;API 表格无横溢出。没有逐像素或完整读屏/触屏结论。
+- 安装版 Reka Root 忽略 asChild,公共 as/class/element 归属本库内层容器,外层保留无视觉包装。段位数字/增减默认行为可用 preventDefault 取消;底座祖先左右导航忽略取消,阻止导航需要 Segment 的 .stop.prevent。此差异不能写成完整原生取消兼容。
+- 本地化整日期粘贴尚无解析器。非公历 13 月/era 的完整编辑受到底座限制;目前验证的模型/显示日历转换不代表所有历法键盘编辑已完成。
+- autoComplete 透传和 ISO 输入已验,不宣称每个浏览器提供日期补全建议。默认空占位采用本地今天,跨时区 SSR 传明确 placeholderValue/初始值固定首屏。
+- Render 函数改为 Vue as/作用域插槽;DateValue 用 shallowRef 存储以保留 TypeScript 私有品牌;Time 不属于 DateValue。
+
+用户要求此组件完成后暂停:**不继续 Calendar/YearPicker**。下一任务改为文档站整体结构、布局和公共控件对齐,优先使用已经迁移的 HeroUI Vue 组件;缺少的组件保留现有实现。
diff --git a/docs/upstream.md b/docs/upstream.md
index 6b81741..9be1cc5 100644
--- a/docs/upstream.md
+++ b/docs/upstream.md
@@ -180,3 +180,11 @@ M18–M20 的标签桥接在 Vue 使用 indicator 注册表与 SSR 直接/原生
## SELECT-01(2026-10-23)
固定 ce90ea3 的 `packages/react/src/components/select/select.tsx`、`packages/styles/components/select.css`、`packages/styles/src/components/select/select.styles.ts`、`icons.tsx` 的 ChevronDown/Close,以及中文 `(pickers)/select.mdx` 和十九个 `demos/cn/select` 预览。CSS/tv/默认图形沿用 Apache-2.0 声明并加 hv- 前缀,方向/宽度/原点适配 Reka 实际状态。Vue 使用现有 ListBox + Popover + 字段协议;异步 React Stately/Collection 改 Fetch + VueUse(文档包显式声明既有 14.4.0),保留数据接口、分页与错误/取消体验。差异与待验收范围见 [SELECT-01](migrations/SELECT-01-select.md)。
+
+## DATE-01 日期能力审计(2026-10-23)
+
+固定 ce90ea3 的 date-field / date-input-group / calendar / calendar-year-picker 源码、中文正文和 16/19 预览作为公共实施清单。本轮没有移植日期 CSS 或预览;私有日期值/接受值协议是本库实现,底座夹具使用实际 Reka 2.11.0。组件与测试显式使用 @internationalized/date 3.12.4(Apache-2.0)并保持 external;不读取相邻仓库运行依赖。真实差异与限制见[日期基建决策](decisions/date-calendar-foundation.md)。
+
+## DATE-02 来源与适配
+
+移植 ce90ea3 date-field/date-input-group 的 React 部件、CSS、variants、中文正文与全部 17 预览。样式仅加 hv- 前缀及 Vue 状态适配;公开行为与底座差异、原生 ISO 提交、空值拒绝恢复详见 [DATE-02](migrations/DATE-02-date-field.md)。日期库 3.12.4 显式 dependency/external,不依赖上游源码。
diff --git a/docs/verification.md b/docs/verification.md
index dfff0ac..71fb9f1 100644
--- a/docs/verification.md
+++ b/docs/verification.md
@@ -739,3 +739,11 @@ typecheck、build:docs、build:playground、format、diff-check 与 dist 正反
本次定位后焦点修复最终 `pnpm test`:46 文件 / 687 项通过,typecheck 和 build:docs 通过;Prettier/diff 与独立消费回归继续验证。
与远程 main 的 M33–M34 集成后,完整测试 51 文件 / 720 项通过,typecheck、build:docs 通过。导出/样式/脚本/报告均保留双方增量;Select 文档移除 MDX 专用 [!toc] 标记。
+
+## DATE-01/02 日期基建与 DateField(2026-10-23)
+
+- `pnpm test`:**58 文件 / 783 项通过**;typecheck、build:docs、全仓 Prettier 与 git diff --check 通过。文档构建仍有既存 500kB chunk 提示。
+- DateField 七部件 / DateInputGroup 六部件、17 基线预览、公共约束/受控/空值拒绝/原生提交/reset/动态粒度/locale/IME composing、真正 Node SSR 与实际 jsdom 水合分别验证;详细范围与未完成能力见 [DATE-02](migrations/DATE-02-date-field.md)。
+- 5174 浏览器重点验证逐段输入、真实 ISO 值、设为今天/清空、秒粒度 + America/Los_Angeles/PST、深浅色、错误样式、代码高亮与 API 表格无横溢出。截图 `/private/tmp/heroui-date-field-review.png`。未做自动逐像素、完整读屏、触屏及全部历法编辑验收。
+- 两份 tarball 安装至独立 `/private/tmp/heroui-slider-consumer`,DateField ESM/Node SSR/CSS 及 NodeNext/bundler 严格正反类型通过。初次消费发现 Props 未从主入口转出,已补齐并重打包复验;错误值/粒度/变体/范围/segment 反例均实际触发诊断。Select/ListBox/M33–M34 产物消费与 NodeNext 契约回归通过。
+- Date foundation 中 Calendar 仍仅为私有探针,不能据此标记公共 Calendar 完成。按用户要求暂停 Calendar/YearPicker,接下来先调整文档壳层。
diff --git a/package.json b/package.json
index 111e4b5..64810af 100644
--- a/package.json
+++ b/package.json
@@ -15,13 +15,15 @@
"build:docs": "pnpm build && pnpm --filter @heroui-vue/docs build",
"typecheck": "vue-tsc --noEmit",
"test": "vitest run",
- "test:unit": "vitest run tests/choice-demos.test.ts tests/choice-fields.test.ts tests/fieldset-search-field.test.ts tests/components.test.ts tests/composition.test.ts tests/docs-search.test.ts tests/button-demos.test.ts tests/aligned-components.test.ts tests/surface-link-spinner.test.ts tests/close-button-avatar-skeleton.test.ts tests/separator-kbd-chip.test.ts tests/badge-alert.test.ts tests/input-group.test.ts tests/field-docs-textarea.test.ts tests/field-foundation.test.ts tests/typography-empty-breadcrumbs.test.ts tests/progress-meter.test.ts tests/disclosure-accordion.test.ts tests/overlay-foundation.test.ts tests/modal.test.ts tests/popover-tooltip.test.ts tests/overlay-demos.test.ts tests/scroll-tabs.test.ts tests/button-toggle.test.ts tests/m26-review.probe.test.ts tests/toolbar.test.ts tests/m29-review.probe.test.ts tests/m30-m32-review.probe.test.ts tests/pagination.test.ts tests/header.test.ts tests/input-otp.test.ts tests/number-field-foundation.test.ts tests/number-field.test.ts tests/slider-foundation.test.ts tests/slider.test.ts tests/collection-state.test.ts tests/collection-foundation.test.ts tests/list-box.test.ts tests/alert-dialog.test.ts tests/drawer.test.ts tests/m33-m34-review.probe.test.ts tests/m33-m34-lifecycle-review.probe.test.ts tests/m33-m34-coexist.test.ts tests/select.test.ts",
- "test:ssr": "vitest run tests/ssr.test.ts tests/input-otp-ssr.test.ts tests/slider-foundation-ssr.test.ts tests/slider-ssr.test.ts tests/collection-foundation-ssr.test.ts tests/list-box-ssr.test.ts tests/select-ssr.test.ts",
+ "test:unit": "vitest run tests/choice-demos.test.ts tests/choice-fields.test.ts tests/fieldset-search-field.test.ts tests/components.test.ts tests/composition.test.ts tests/docs-search.test.ts tests/button-demos.test.ts tests/aligned-components.test.ts tests/surface-link-spinner.test.ts tests/close-button-avatar-skeleton.test.ts tests/separator-kbd-chip.test.ts tests/badge-alert.test.ts tests/input-group.test.ts tests/field-docs-textarea.test.ts tests/field-foundation.test.ts tests/typography-empty-breadcrumbs.test.ts tests/progress-meter.test.ts tests/disclosure-accordion.test.ts tests/overlay-foundation.test.ts tests/modal.test.ts tests/popover-tooltip.test.ts tests/overlay-demos.test.ts tests/scroll-tabs.test.ts tests/button-toggle.test.ts tests/m26-review.probe.test.ts tests/toolbar.test.ts tests/m29-review.probe.test.ts tests/m30-m32-review.probe.test.ts tests/pagination.test.ts tests/header.test.ts tests/input-otp.test.ts tests/number-field-foundation.test.ts tests/number-field.test.ts tests/slider-foundation.test.ts tests/slider.test.ts tests/collection-state.test.ts tests/collection-foundation.test.ts tests/list-box.test.ts tests/alert-dialog.test.ts tests/drawer.test.ts tests/m33-m34-review.probe.test.ts tests/m33-m34-lifecycle-review.probe.test.ts tests/m33-m34-coexist.test.ts tests/select.test.ts tests/date-value.test.ts tests/date-model.test.ts tests/date-foundation.test.ts tests/date-field.test.ts tests/date-field-demos.test.ts",
+ "test:ssr": "vitest run tests/ssr.test.ts tests/input-otp-ssr.test.ts tests/slider-foundation-ssr.test.ts tests/slider-ssr.test.ts tests/collection-foundation-ssr.test.ts tests/list-box-ssr.test.ts tests/select-ssr.test.ts tests/date-foundation-ssr.test.ts tests/date-field-ssr.test.ts",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"dev:playground": "pnpm build && pnpm --filter @heroui-vue/playground dev"
},
"devDependencies": {
+ "@internationalized/date": "3.12.4",
+ "@types/node": "^22.0.0",
"@vitejs/plugin-vue": "^6.0.0",
"@vue/server-renderer": "^3.5.44",
"@vue/test-utils": "^2.4.6",
@@ -32,7 +34,6 @@
"vite-plugin-dts": "^4.5.4",
"vitest": "^3.2.4",
"vue": "^3.5.44",
- "vue-tsc": "^3.1.0",
- "@types/node": "^22.0.0"
+ "vue-tsc": "^3.1.0"
}
}
diff --git a/packages/styles/components/date-field.css b/packages/styles/components/date-field.css
new file mode 100644
index 0000000..42e8a58
--- /dev/null
+++ b/packages/styles/components/date-field.css
@@ -0,0 +1,21 @@
+/* Adapted from HeroUI ce90ea3, Apache-2.0; hv- prefix. */
+/* Date field styles */
+.hv-date-field {
+ @apply flex flex-col gap-1;
+
+ &[data-invalid="true"],
+ &[aria-invalid="true"] {
+ [data-slot="description"] {
+ @apply hidden;
+ }
+ }
+
+ [data-slot="label"] {
+ @apply w-fit;
+ }
+}
+
+/* Full width modifier */
+.hv-date-field--full-width {
+ @apply w-full;
+}
diff --git a/packages/styles/components/date-input-group.css b/packages/styles/components/date-input-group.css
new file mode 100644
index 0000000..4b33fdd
--- /dev/null
+++ b/packages/styles/components/date-input-group.css
@@ -0,0 +1,183 @@
+/* Adapted from HeroUI ce90ea3, Apache-2.0; hv- prefix. */
+/* Date input group styles */
+.hv-date-input-group {
+ @apply inline-flex h-9 items-center overflow-hidden rounded-field border bg-field text-sm text-field-foreground shadow-field outline-none;
+ border-width: var(--border-width-field);
+ border-color: var(--field-border);
+
+ /**
+ * Transitions
+ * CRITICAL: motion-reduce must be AFTER transition for correct override specificity
+ */
+ transition:
+ background-color 150ms var(--ease-smooth),
+ border-color 150ms var(--ease-smooth),
+ box-shadow 150ms var(--ease-out);
+ @apply motion-reduce:transition-none;
+
+ /* Hover state */
+ @media (hover: hover) {
+ &:hover:not(:focus-within),
+ &[data-hovered="true"]:not([data-focus-within="true"]) {
+ @apply bg-field-hover;
+ border-color: var(--field-border-hover);
+ }
+ }
+
+ /* Focus within state */
+ &[data-focus-within="true"]:not(
+ :has(
+ [data-slot="date-picker-trigger"]:focus,
+ [data-slot="date-picker-trigger"][data-focused="true"],
+ [data-slot="date-range-picker-trigger"]:focus,
+ [data-slot="date-range-picker-trigger"][data-focused="true"]
+ )
+ ),
+ &:focus-within:not(
+ :has(
+ [data-slot="date-picker-trigger"]:focus,
+ [data-slot="date-picker-trigger"][data-focused="true"],
+ [data-slot="date-range-picker-trigger"]:focus,
+ [data-slot="date-range-picker-trigger"][data-focused="true"]
+ )
+ ) {
+ @apply status-focused-field;
+ }
+
+ /* Invalid state */
+ &[data-invalid="true"] {
+ @apply status-invalid-field;
+ background-color: var(--field-focus);
+ border-color: var(--color-field-border-invalid);
+ }
+
+ /* Disabled state */
+ &[data-disabled="true"],
+ &[aria-disabled="true"] {
+ @apply status-disabled;
+ }
+}
+
+.hv-date-input-group__input {
+ @apply flex flex-1 cursor-text items-center gap-px rounded-none border-0 bg-transparent px-3 py-2 text-base shadow-none outline-none sm:text-sm;
+
+ /* Remove border radius on left side when prefix is present */
+ .hv-date-input-group:has([data-slot="date-input-group-prefix"]) & {
+ @apply rounded-s-none ps-2;
+ }
+
+ /* Remove border radius on right side when suffix is present */
+ .hv-date-input-group:has([data-slot="date-input-group-suffix"]) & {
+ @apply rounded-e-none pe-2;
+ }
+
+ .hv-date-input-group:has(.hv-date-range-picker__range-separator) & {
+ &[slot="start"] {
+ @apply flex-none pe-0;
+ }
+ &[slot="end"] {
+ @apply ps-0;
+ }
+ }
+
+ /* Focus state - handled by group */
+ &:focus,
+ &:focus-visible {
+ @apply outline-none;
+ }
+}
+
+.hv-date-input-group__input-container {
+ @apply flex flex-1 scrollbar-none items-center;
+ width: fit-content;
+ overflow-x: auto;
+ overflow-y: clip;
+}
+
+.hv-date-input-group__segment {
+ @apply inline-block rounded-md px-0.5 text-end text-nowrap outline-none;
+
+ /* Segment separators styling "/" */
+ &[data-type="literal"] {
+ @apply p-0 text-muted;
+ }
+
+ /* Placeholder styling */
+ &[data-placeholder="true"] {
+ @apply text-field-placeholder;
+ }
+
+ /* Focused segment */
+ &:focus,
+ &[data-focused="true"] {
+ @apply bg-accent-soft text-accent-soft-foreground;
+ }
+
+ /* Disabled segment */
+ &[data-disabled="true"] {
+ @apply opacity-50;
+ }
+
+ /* Invalid segment */
+ &[data-invalid="true"] {
+ @apply text-danger;
+
+ /* Focused segment */
+ &:focus,
+ &[data-focused="true"] {
+ @apply bg-danger-soft text-danger-soft-foreground;
+ }
+ }
+}
+
+.hv-date-input-group__prefix {
+ @apply pointer-events-none shrink-0 text-field-placeholder;
+ @apply ms-3 me-0 flex items-center;
+}
+
+.hv-date-input-group__suffix {
+ @apply pointer-events-none shrink-0 text-field-placeholder;
+ @apply me-3 flex items-center;
+}
+
+/* Variant property definitions */
+.hv-date-input-group--primary {
+ /* Default styles */
+}
+
+.hv-date-input-group--secondary {
+ @apply shadow-none;
+ background-color: var(--date-input-group-bg);
+
+ --date-input-group-bg: var(--default);
+ --date-input-group-bg-hover: var(--default-hover);
+ --date-input-group-bg-focus: var(--default);
+
+ @media (hover: hover) {
+ &:hover:not(:focus-within),
+ &[data-hovered="true"]:not([data-focus-within="true"]) {
+ background-color: var(--date-input-group-bg-hover);
+ }
+ }
+
+ &:focus-within,
+ &[data-focus-within="true"] {
+ background-color: var(--date-input-group-bg-focus);
+ }
+
+ /* Invalid state */
+ &[data-invalid="true"] {
+ @apply status-invalid-field;
+ border-color: var(--color-field-border-invalid);
+ background-color: var(--date-input-group-bg-focus);
+ }
+
+ [data-slot="date-input-group-input"] {
+ @apply bg-transparent;
+ }
+}
+
+/* Full width modifier */
+.hv-date-input-group--full-width {
+ @apply w-full;
+}
diff --git a/packages/styles/index.css b/packages/styles/index.css
index 8600db6..dff10c6 100644
--- a/packages/styles/index.css
+++ b/packages/styles/index.css
@@ -149,3 +149,6 @@
@import "./components/list-box-section.css" layer(components);
@import "./components/select.css" layer(components);
+
+@import "./components/date-input-group.css" layer(components);
+@import "./components/date-field.css" layer(components);
diff --git a/packages/styles/src/index.ts b/packages/styles/src/index.ts
index 7ee3392..7cf4925 100644
--- a/packages/styles/src/index.ts
+++ b/packages/styles/src/index.ts
@@ -1453,3 +1453,31 @@ export const selectVariants = tv({
});
export type SelectVariants = VariantProps;
+
+export const dateFieldVariants = tv({
+ base: "hv-date-field",
+ defaultVariants: { fullWidth: false },
+ variants: { fullWidth: { true: "hv-date-field--full-width", false: "" } },
+});
+export type DateFieldVariants = VariantProps;
+export const dateInputGroupVariants = tv({
+ slots: {
+ base: "hv-date-input-group",
+ input: "hv-date-input-group__input",
+ inputContainer: "hv-date-input-group__input-container",
+ segment: "hv-date-input-group__segment",
+ prefix: "hv-date-input-group__prefix",
+ suffix: "hv-date-input-group__suffix",
+ },
+ defaultVariants: { fullWidth: false, variant: "primary" },
+ variants: {
+ fullWidth: { true: { base: "hv-date-input-group--full-width" }, false: {} },
+ variant: {
+ primary: { base: "hv-date-input-group--primary" },
+ secondary: { base: "hv-date-input-group--secondary" },
+ },
+ },
+});
+export type DateInputGroupVariants = VariantProps<
+ typeof dateInputGroupVariants
+>;
diff --git a/packages/vue/package.json b/packages/vue/package.json
index d41d240..da1ba2e 100644
--- a/packages/vue/package.json
+++ b/packages/vue/package.json
@@ -20,6 +20,7 @@
},
"dependencies": {
"@heroui-vue/styles": "workspace:*",
+ "@internationalized/date": "3.12.4",
"@vueuse/core": "14.4.0",
"reka-ui": "^2.11.0"
},
diff --git a/packages/vue/src/components/date-field/DateField.vue b/packages/vue/src/components/date-field/DateField.vue
new file mode 100644
index 0000000..7fcabc2
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateField.vue
@@ -0,0 +1,383 @@
+
diff --git a/packages/vue/src/components/date-field/DateInputGroup.vue b/packages/vue/src/components/date-field/DateInputGroup.vue
new file mode 100644
index 0000000..dd68c0f
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateInputGroup.vue
@@ -0,0 +1,51 @@
+
diff --git a/packages/vue/src/components/date-field/DateInputGroupInput.vue b/packages/vue/src/components/date-field/DateInputGroupInput.vue
new file mode 100644
index 0000000..04bbb4e
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateInputGroupInput.vue
@@ -0,0 +1,72 @@
+
diff --git a/packages/vue/src/components/date-field/DateInputGroupInputContainer.vue b/packages/vue/src/components/date-field/DateInputGroupInputContainer.vue
new file mode 100644
index 0000000..5c714ed
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateInputGroupInputContainer.vue
@@ -0,0 +1,22 @@
+
diff --git a/packages/vue/src/components/date-field/DateInputGroupPrefix.vue b/packages/vue/src/components/date-field/DateInputGroupPrefix.vue
new file mode 100644
index 0000000..1715a78
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateInputGroupPrefix.vue
@@ -0,0 +1,22 @@
+
diff --git a/packages/vue/src/components/date-field/DateInputGroupSegment.vue b/packages/vue/src/components/date-field/DateInputGroupSegment.vue
new file mode 100644
index 0000000..f1ca494
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateInputGroupSegment.vue
@@ -0,0 +1,84 @@
+
diff --git a/packages/vue/src/components/date-field/DateInputGroupSuffix.vue b/packages/vue/src/components/date-field/DateInputGroupSuffix.vue
new file mode 100644
index 0000000..0bd9f09
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateInputGroupSuffix.vue
@@ -0,0 +1,22 @@
+
diff --git a/packages/vue/src/components/date-field/DateSegments.ts b/packages/vue/src/components/date-field/DateSegments.ts
new file mode 100644
index 0000000..172198b
--- /dev/null
+++ b/packages/vue/src/components/date-field/DateSegments.ts
@@ -0,0 +1,20 @@
+import { computed, defineComponent, provide, type PropType } from "vue";
+import type { DateFieldInputProps } from "reka-ui";
+import { dateSegmentsKey } from "./context";
+export default defineComponent({
+ props: {
+ segments: {
+ type: Array as PropType<
+ { part: DateFieldInputProps["part"]; value: string }[]
+ >,
+ required: true,
+ },
+ },
+ setup(props, { slots }) {
+ provide(
+ dateSegmentsKey,
+ computed(() => props.segments),
+ );
+ return () => slots.default?.();
+ },
+});
diff --git a/packages/vue/src/components/date-field/PrimitiveNode.ts b/packages/vue/src/components/date-field/PrimitiveNode.ts
new file mode 100644
index 0000000..7f698ba
--- /dev/null
+++ b/packages/vue/src/components/date-field/PrimitiveNode.ts
@@ -0,0 +1,51 @@
+import { defineComponent, h, mergeProps, type PropType } from "vue";
+/** Keep consumer handlers at the real node and before Reka's defaults.
+ * Reka date handlers don't themselves check defaultPrevented. */
+export default defineComponent({
+ name: "DatePrimitiveNode",
+ inheritAttrs: false,
+ props: {
+ as: { type: String, default: "span" },
+ consumer: Object as PropType>,
+ overrides: Object as PropType>,
+ },
+ setup(props, { attrs, slots, expose }) {
+ let element: HTMLElement | undefined;
+ expose({
+ get element() {
+ return element;
+ },
+ });
+ return () => {
+ const ordinary: Record = {},
+ events: Record = {};
+ for (const [key, value] of Object.entries(attrs)) {
+ if (/^on[A-Z]/.test(key))
+ events[key] = (event: Event) => {
+ if (event.defaultPrevented) return;
+ for (const handler of Array.isArray(value) ? value : [value]) {
+ if (typeof handler === "function") handler(event);
+ }
+ };
+ else ordinary[key] = value;
+ }
+ return h(
+ props.as,
+ mergeProps(
+ ordinary,
+ props.consumer ?? {},
+ events,
+ props.overrides ?? {},
+ {
+ ref: (node: unknown) => {
+ element = node as HTMLElement | undefined;
+ const receive = props.overrides?.ref;
+ if (typeof receive === "function") receive(element);
+ },
+ },
+ ),
+ slots.default?.(),
+ );
+ };
+ },
+});
diff --git a/packages/vue/src/components/date-field/context.ts b/packages/vue/src/components/date-field/context.ts
new file mode 100644
index 0000000..253562c
--- /dev/null
+++ b/packages/vue/src/components/date-field/context.ts
@@ -0,0 +1,37 @@
+import { inject, type ComputedRef, type InjectionKey } from "vue";
+import type { DateValue } from "@internationalized/date";
+import type { DateFieldInputProps } from "reka-ui";
+import type { dateInputGroupVariants } from "@heroui-vue/styles";
+export interface DateSegment {
+ part: DateFieldInputProps["part"];
+ type: DateFieldInputProps["part"];
+ value: string;
+ text: string;
+ isPlaceholder: boolean;
+ isEditable: boolean;
+}
+export interface DateFieldContext {
+ value: ComputedRef;
+ disabled: ComputedRef;
+ readOnly: ComputedRef;
+ required: ComputedRef;
+ invalid: ComputedRef;
+ leadingZeros: () => boolean | undefined;
+ labelledBy: () => string | undefined;
+ describedBy: () => string | undefined;
+ ariaLabel: () => unknown;
+}
+export const dateFieldKey: InjectionKey =
+ Symbol("hv-date-field");
+export const dateGroupKey: InjectionKey<
+ ComputedRef>
+> = Symbol("hv-date-group");
+export function useDateField() {
+ const value = inject(dateFieldKey, undefined);
+ if (!value) throw new Error("Date input parts require a DateField root.");
+ return value;
+}
+
+export const dateSegmentsKey: InjectionKey<
+ ComputedRef<{ part: DateFieldInputProps["part"]; value: string }[]>
+> = Symbol("hv-date-segments");
diff --git a/packages/vue/src/components/date/EmptyDateBridge.ts b/packages/vue/src/components/date/EmptyDateBridge.ts
new file mode 100644
index 0000000..e7e4887
--- /dev/null
+++ b/packages/vue/src/components/date/EmptyDateBridge.ts
@@ -0,0 +1,25 @@
+import { defineComponent, watch } from "vue";
+import { injectDateFieldRootContext } from "reka-ui";
+
+/** Reka does not watch equal primitive null values after a rejected edit.
+ * Clear its existing segment refs without replacing DOM, focus or IDs. */
+export default defineComponent({
+ name: "EmptyDateBridge",
+ props: { revision: { type: Number, required: true } },
+ setup(props) {
+ const base = injectDateFieldRootContext();
+ watch(
+ () => props.revision,
+ () => {
+ base.segmentValues.value = Object.fromEntries(
+ Object.keys(base.segmentValues.value).map((part) => [
+ part,
+ part === "dayPeriod" ? "AM" : null,
+ ]),
+ ) as typeof base.segmentValues.value;
+ },
+ { flush: "post" },
+ );
+ return () => null;
+ },
+});
diff --git a/packages/vue/src/components/date/model.ts b/packages/vue/src/components/date/model.ts
new file mode 100644
index 0000000..ae8ec2e
--- /dev/null
+++ b/packages/vue/src/components/date/model.ts
@@ -0,0 +1,60 @@
+import { computed, nextTick, ref } from "vue";
+import type { DateValue } from "@internationalized/date";
+import { useChoiceValue } from "../choice/shared";
+import { copyDateValue, sameDateValue } from "./value";
+
+/** One accepted model, with a copied wire value to resynchronize editable
+ * Reka segments after a completed proposal. Partial drafts stay in the base. */
+export function useAcceptedDateValue(options: {
+ value: () => DateValue | null | undefined;
+ defaultValue: () => DateValue | null | undefined;
+ onChange: (value: DateValue | null) => void;
+ disabled?: () => boolean;
+ readOnly?: () => boolean;
+}) {
+ const model = useChoiceValue(
+ () => copyDateValue(options.value()),
+ () => copyDateValue(options.defaultValue() ?? null),
+ ["modelValue", "model-value", "value"],
+ (value) => options.onChange(copyDateValue(value ?? null)),
+ );
+ const revision = ref(0);
+ const emptyRevision = ref(0);
+ let requestId = 0;
+ const value = computed(() => {
+ const copy = copyDateValue(model.value.value ?? null);
+ return copy ? (Object.freeze(copy) as DateValue) : null;
+ });
+ const wire = computed(() => {
+ void revision.value;
+ return copyDateValue(value.value);
+ });
+ function restore() {
+ revision.value++;
+ // Parent props and the base's segment edit both settle before this copy.
+ void nextTick(() => {
+ revision.value++;
+ });
+ }
+ function request(next: DateValue | null | undefined) {
+ if (
+ !options.disabled?.() &&
+ !options.readOnly?.() &&
+ !sameDateValue(value.value, next)
+ )
+ model.request(copyDateValue(next ?? null));
+ restore();
+ const id = ++requestId;
+ if (next != null)
+ void nextTick(() => {
+ if (id === requestId && value.value === null) emptyRevision.value++;
+ });
+ }
+ function reset() {
+ requestId++;
+ model.reset();
+ restore();
+ if (value.value === null) emptyRevision.value++;
+ }
+ return { value, wire, emptyRevision, request, reset };
+}
diff --git a/packages/vue/src/components/date/value.ts b/packages/vue/src/components/date/value.ts
new file mode 100644
index 0000000..9ca7213
--- /dev/null
+++ b/packages/vue/src/components/date/value.ts
@@ -0,0 +1,112 @@
+import {
+ DateFormatter,
+ createCalendar,
+ toCalendar,
+ toCalendarDate,
+ type CalendarIdentifier,
+ type DateValue,
+} from "@internationalized/date";
+
+/** Private date boundary: preserve calendar/time/zone, never round-trip JS Date. */
+export function copyDateValue(
+ value: T,
+): T {
+ return (value == null ? value : value.copy()) as T;
+}
+export function dateValueKey(value: DateValue | null | undefined): string {
+ if (value == null) return "empty";
+ const time =
+ "hour" in value
+ ? [value.hour, value.minute, value.second, value.millisecond]
+ : [];
+ const zone = "timeZone" in value ? [value.timeZone, value.offset] : [];
+ return JSON.stringify([
+ value.calendar.identifier,
+ value.era,
+ value.year,
+ value.month,
+ value.day,
+ ...time,
+ ...zone,
+ ]);
+}
+export function sameDateValue(
+ a: DateValue | null | undefined,
+ b: DateValue | null | undefined,
+): boolean {
+ return dateValueKey(a) === dateValueKey(b);
+}
+export function copyDateValues(values: readonly T[]): T[] {
+ const seen = new Set();
+ return values
+ .filter((value) => {
+ const key = dateValueKey(value);
+ if (seen.has(key)) return false;
+ seen.add(key);
+ return true;
+ })
+ .map(copyDateValue);
+}
+/** Full ISO boundary; display granularity must not truncate the accepted model. */
+export function serializeDateValue(
+ value: DateValue | null | undefined,
+): string {
+ return value?.toString() ?? "";
+}
+export interface CalendarDayRules {
+ minValue?: DateValue;
+ maxValue?: DateValue;
+ isDisabled?: boolean;
+ isDateDisabled?: (value: DateValue) => boolean;
+ isDateUnavailable?: (value: DateValue) => boolean;
+}
+export function calendarDayState(
+ value: DateValue,
+ rules: CalendarDayRules = {},
+) {
+ const day = toCalendarDate(value);
+ const outOfRange = !!(
+ (rules.minValue && day.compare(toCalendarDate(rules.minValue)) < 0) ||
+ (rules.maxValue && day.compare(toCalendarDate(rules.maxValue)) > 0)
+ );
+ const isDisabled = !!(
+ rules.isDisabled ||
+ outOfRange ||
+ rules.isDateDisabled?.(value)
+ );
+ const isUnavailable = !!rules.isDateUnavailable?.(value);
+ return {
+ isDisabled,
+ isUnavailable,
+ isSelectable: !isDisabled && !isUnavailable,
+ };
+}
+export interface DateRangeValue {
+ start: T | null;
+ end: T | null;
+}
+export function copyDateRange(
+ range: DateRangeValue,
+): DateRangeValue {
+ return { start: copyDateValue(range.start), end: copyDateValue(range.end) };
+}
+/** Calendar ranges compare local calendar days; time-field bounds are separate. */
+export function calendarRangeStatus(
+ range: DateRangeValue,
+): "empty" | "incomplete" | "inverted" | "valid" {
+ if (!range.start && !range.end) return "empty";
+ if (!range.start || !range.end) return "incomplete";
+ return toCalendarDate(range.start).compare(toCalendarDate(range.end)) > 0
+ ? "inverted"
+ : "valid";
+}
+
+/** View-calendar conversion is explicit and must not replace the public model. */
+export function dateForLocale(
+ value: T,
+ locale: string,
+): T {
+ const identifier = new DateFormatter(locale).resolvedOptions()
+ .calendar as CalendarIdentifier;
+ return toCalendar(value, createCalendar(identifier)) as T;
+}
diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts
index 5bffe13..f71a16d 100644
--- a/packages/vue/src/index.ts
+++ b/packages/vue/src/index.ts
@@ -749,3 +749,56 @@ export type {
SelectClearButtonProps,
SelectPopoverProps,
} from "./types";
+
+export {
+ default as DateField,
+ default as DateFieldRoot,
+} from "./components/date-field/DateField.vue";
+export {
+ default as DateInputGroup,
+ default as DateFieldGroup,
+} from "./components/date-field/DateInputGroup.vue";
+export {
+ default as DateInputGroupInput,
+ default as DateFieldInput,
+} from "./components/date-field/DateInputGroupInput.vue";
+export {
+ default as DateInputGroupSegment,
+ default as DateFieldSegment,
+} from "./components/date-field/DateInputGroupSegment.vue";
+export {
+ default as DateInputGroupInputContainer,
+ default as DateFieldInputContainer,
+} from "./components/date-field/DateInputGroupInputContainer.vue";
+export {
+ default as DateInputGroupPrefix,
+ default as DateFieldPrefix,
+} from "./components/date-field/DateInputGroupPrefix.vue";
+export {
+ default as DateInputGroupSuffix,
+ default as DateFieldSuffix,
+} from "./components/date-field/DateInputGroupSuffix.vue";
+export type { DateSegment } from "./components/date-field/context";
+
+export {
+ dateFieldVariants,
+ dateInputGroupVariants,
+ type DateFieldVariants,
+ type DateInputGroupVariants,
+} from "@heroui-vue/styles";
+export type {
+ DateFieldProps,
+ DateFieldRootProps,
+ DateFieldGroupProps,
+ DateFieldInputProps,
+ DateFieldSegmentProps,
+ DateFieldInputContainerProps,
+ DateFieldPrefixProps,
+ DateFieldSuffixProps,
+ DateInputGroupProps,
+ DateInputGroupInputProps,
+ DateInputGroupSegmentProps,
+ DateInputGroupInputContainerProps,
+ DateInputGroupPrefixProps,
+ DateInputGroupSuffixProps,
+} from "./types";
diff --git a/packages/vue/src/types.ts b/packages/vue/src/types.ts
index c399fee..6dbd361 100644
--- a/packages/vue/src/types.ts
+++ b/packages/vue/src/types.ts
@@ -616,3 +616,32 @@ export type SelectPopoverProps = InstanceType<
(typeof import("./components/select/SelectPopover.vue"))["default"]
>["$props"];
export type SelectRootProps = SelectProps;
+
+export type DateFieldProps = InstanceType<
+ (typeof import("./components/date-field/DateField.vue"))["default"]
+>["$props"];
+export type DateInputGroupProps = InstanceType<
+ (typeof import("./components/date-field/DateInputGroup.vue"))["default"]
+>["$props"];
+export type DateInputGroupInputProps = InstanceType<
+ (typeof import("./components/date-field/DateInputGroupInput.vue"))["default"]
+>["$props"];
+export type DateInputGroupSegmentProps = InstanceType<
+ (typeof import("./components/date-field/DateInputGroupSegment.vue"))["default"]
+>["$props"];
+export type DateInputGroupInputContainerProps = InstanceType<
+ (typeof import("./components/date-field/DateInputGroupInputContainer.vue"))["default"]
+>["$props"];
+export type DateInputGroupPrefixProps = InstanceType<
+ (typeof import("./components/date-field/DateInputGroupPrefix.vue"))["default"]
+>["$props"];
+export type DateInputGroupSuffixProps = InstanceType<
+ (typeof import("./components/date-field/DateInputGroupSuffix.vue"))["default"]
+>["$props"];
+export type DateFieldRootProps = DateFieldProps;
+export type DateFieldGroupProps = DateInputGroupProps;
+export type DateFieldInputProps = DateInputGroupInputProps;
+export type DateFieldSegmentProps = DateInputGroupSegmentProps;
+export type DateFieldInputContainerProps = DateInputGroupInputContainerProps;
+export type DateFieldPrefixProps = DateInputGroupPrefixProps;
+export type DateFieldSuffixProps = DateInputGroupSuffixProps;
diff --git a/packages/vue/tests/fixtures/AcceptedDateFieldFoundation.vue b/packages/vue/tests/fixtures/AcceptedDateFieldFoundation.vue
new file mode 100644
index 0000000..f86a231
--- /dev/null
+++ b/packages/vue/tests/fixtures/AcceptedDateFieldFoundation.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
diff --git a/packages/vue/tests/fixtures/CalendarFoundation.vue b/packages/vue/tests/fixtures/CalendarFoundation.vue
new file mode 100644
index 0000000..f7eb644
--- /dev/null
+++ b/packages/vue/tests/fixtures/CalendarFoundation.vue
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ day }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/vue/tests/fixtures/DateFieldFoundation.vue b/packages/vue/tests/fixtures/DateFieldFoundation.vue
new file mode 100644
index 0000000..fd4f159
--- /dev/null
+++ b/packages/vue/tests/fixtures/DateFieldFoundation.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+ {{ segment.value }}
+
+
+
diff --git a/packages/vue/vite.config.ts b/packages/vue/vite.config.ts
index 4ad43e4..0b761a8 100644
--- a/packages/vue/vite.config.ts
+++ b/packages/vue/vite.config.ts
@@ -32,7 +32,13 @@ export default defineConfig({
build: {
lib: { entry: "src/index.ts", formats: ["es"], fileName: "index" },
rollupOptions: {
- external: ["vue", "reka-ui", "@heroui-vue/styles", "@vueuse/core"],
+ external: [
+ "vue",
+ "reka-ui",
+ "@heroui-vue/styles",
+ "@vueuse/core",
+ "@internationalized/date",
+ ],
},
},
});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fad2329..89da266 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -8,6 +8,9 @@ importers:
.:
devDependencies:
+ '@internationalized/date':
+ specifier: 3.12.4
+ version: 3.12.4
'@types/node':
specifier: ^22.0.0
version: 22.20.5
@@ -116,6 +119,9 @@ importers:
'@heroui-vue/styles':
specifier: workspace:*
version: link:../styles
+ '@internationalized/date':
+ specifier: 3.12.4
+ version: 3.12.4
'@vueuse/core':
specifier: 14.4.0
version: 14.4.0(vue@3.5.44(typescript@5.9.3))
diff --git a/tests/date-field-demos.test.ts b/tests/date-field-demos.test.ts
new file mode 100644
index 0000000..1fcf2a5
--- /dev/null
+++ b/tests/date-field-demos.test.ts
@@ -0,0 +1,74 @@
+import { describe, expect, it } from "vitest";
+import { mount, flushPromises } from "@vue/test-utils";
+import { readFileSync } from "node:fs";
+const demos = import.meta.glob("../apps/docs/demos/date-field-*.vue", {
+ eager: true,
+ import: "default",
+});
+const expected = [
+ "basic",
+ "with-prefix-icon",
+ "with-suffix-icon",
+ "with-prefix-and-suffix",
+ "variants",
+ "on-surface",
+ "with-description",
+ "required",
+ "disabled",
+ "full-width",
+ "invalid",
+ "granularity",
+ "controlled",
+ "form-example",
+ "with-validation",
+ "render-function",
+ "custom-styles",
+];
+describe("DateField documentation", () => {
+ it("includes every pinned preview and uses the displayed SFC as its implementation", () => {
+ const md = readFileSync("apps/docs/components/date-field.md", "utf8");
+ expect(
+ [...md.matchAll(/ match[1],
+ ),
+ ).toEqual(expected);
+ expect(md).not.toContain("[!toc]");
+ expect(Object.keys(demos)).toHaveLength(17);
+ });
+ it("mounts all seventeen examples without warnings or missing date controls", async () => {
+ const warnings: string[] = [];
+ for (const demo of Object.values(demos)) {
+ const w = mount(demo as never, {
+ global: {
+ config: { warnHandler: (message) => warnings.push(message) },
+ },
+ });
+ await flushPromises();
+ expect(w.find('[data-slot="date-field"]').exists()).toBe(true);
+ expect(w.find('[data-slot="date-input-group-segment"]').exists()).toBe(
+ true,
+ );
+ w.unmount();
+ }
+ expect(warnings).toEqual([]);
+ });
+});
+it("the controlled example's action buttons update and clear the real date", async () => {
+ const component = demos["../apps/docs/demos/date-field-controlled.vue"];
+ const w = mount(component as never);
+ try {
+ await w.get("button").trigger("click");
+ await flushPromises();
+ expect(
+ (w.get('[data-slot="date-field-value"]').element as HTMLInputElement)
+ .value,
+ ).toMatch(/^\d{4}-\d{2}-\d{2}$/);
+ expect(w.get('[data-slot="description"]').text()).not.toContain("(空)");
+ await w.findAll("button")[1].trigger("click");
+ await flushPromises();
+ expect(w.get('[data-slot="description"]').text()).toContain("(空)");
+ expect(w.findAll('[data-placeholder="true"]')).toHaveLength(3);
+ } finally {
+ w.unmount();
+ }
+});
diff --git a/tests/date-field-ssr.test.ts b/tests/date-field-ssr.test.ts
new file mode 100644
index 0000000..3a571d2
--- /dev/null
+++ b/tests/date-field-ssr.test.ts
@@ -0,0 +1,45 @@
+// @vitest-environment node
+import { expect, it } from "vitest";
+import { createSSRApp, h } from "vue";
+import { renderToString } from "@vue/server-renderer";
+import { parseZonedDateTime } from "@internationalized/date";
+import {
+ DateField,
+ DateFieldGroup,
+ DateFieldInput,
+ Label,
+ Description,
+} from "../packages/vue/src";
+it("renders public DateField and complete ISO values on Node with stable, unique field associations", async () => {
+ expect(typeof window).toBe("undefined");
+ const date = parseZonedDateTime(
+ "2024-03-10T01:30:45-08:00[America/Los_Angeles]",
+ );
+ const field = () =>
+ h(
+ DateField,
+ {
+ defaultValue: date,
+ name: "date",
+ granularity: "minute",
+ locale: "en-US",
+ },
+ () => [
+ h(Label, () => "Date"),
+ h(DateFieldGroup, () => h(DateFieldInput)),
+ h(Description, () => "Help"),
+ ],
+ );
+ const app = () =>
+ createSSRApp({ render: () => h("form", [field(), field()]) });
+ const html = await renderToString(app());
+ expect(html).toBe(await renderToString(app()));
+ expect(html.match(/name="date"/g)).toHaveLength(2);
+ expect(
+ html.match(/value="2024-03-10T01:30:45-08:00\[America\/Los_Angeles\]"/g),
+ ).toHaveLength(2);
+ const ids = [...html.matchAll(/ id="([^"]+)"/g)].map((match) => match[1]);
+ expect(new Set(ids).size).toBe(ids.length);
+ expect(html).toContain("aria-labelledby=");
+ expect(html).toContain("aria-describedby=");
+});
diff --git a/tests/date-field.test.ts b/tests/date-field.test.ts
new file mode 100644
index 0000000..454a4cb
--- /dev/null
+++ b/tests/date-field.test.ts
@@ -0,0 +1,331 @@
+import { afterEach, describe, expect, it } from "vitest";
+import { mount, flushPromises } from "@vue/test-utils";
+import { createSSRApp, defineComponent, ref } from "vue";
+import { renderToString } from "@vue/server-renderer";
+import {
+ CalendarDate,
+ CalendarDateTime,
+ parseZonedDateTime,
+ PersianCalendar,
+ toCalendar,
+} from "@internationalized/date";
+import {
+ DateField,
+ DateFieldGroup,
+ DateFieldInput,
+ DateFieldSegment,
+ DateFieldPrefix,
+ Label,
+ Description,
+ FieldError,
+ Fieldset,
+ Form,
+ ConfigProvider,
+} from "../packages/vue/src";
+const components = {
+ DateField,
+ DateFieldGroup,
+ DateFieldInput,
+ DateFieldSegment,
+ DateFieldPrefix,
+ Label,
+ Description,
+ FieldError,
+ Fieldset,
+ Form,
+ ConfigProvider,
+};
+const content =
+ 'Help';
+const initial = new CalendarDate(2024, 2, 10);
+const wrappers: ReturnType[] = [];
+afterEach(() => {
+ wrappers.splice(0).forEach((w) => w.unmount());
+ document.body.innerHTML = "";
+});
+function fixture(template: string, setup = () => ({})) {
+ const w = mount(defineComponent({ components, template, setup }), {
+ attachTo: document.body,
+ });
+ wrappers.push(w);
+ return w;
+}
+const part = (w: ReturnType, type = "day") =>
+ w.get(`[data-type="${type}"]`);
+const values = (w: ReturnType) =>
+ new FormData(w.get("form").element as HTMLFormElement).getAll("date");
+describe("DateField", () => {
+ it("renders separators and shares field state/name/description on the actual group", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ expect(w.findAll('[data-type="literal"]')).toHaveLength(2);
+ const root = w.get('[data-slot="date-field"]');
+ expect(root.attributes("aria-labelledby")).toContain(
+ w.get('[data-slot="label"]').attributes("id"),
+ );
+ expect(root.attributes("aria-describedby")).toContain(
+ w.get('[data-slot="description"]').attributes("id"),
+ );
+ expect(values(w)).toEqual(["2024-02-10"]);
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(values(w)).toEqual(["2024-02-11"]);
+ expect(part(w).text()).toBe("11");
+ });
+ it("restores rejected nonempty and empty completed proposals with stable DOM/focus", async () => {
+ const value = ref(null);
+ const w = fixture(
+ ``,
+ () => ({ initial, value }),
+ );
+ const el = part(w, "year").element as HTMLElement;
+ el.focus();
+ for (const type of ["month", "day", "year"])
+ await part(w, type).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(part(w, "year").element).toBe(el);
+ expect(document.activeElement).toBe(el);
+ expect(part(w).attributes("data-placeholder")).toBe("true");
+ expect(values(w)).toEqual([""]);
+ const field = w.getComponent(DateField);
+ value.value = initial;
+ await flushPromises();
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(part(w).text()).toBe("10");
+ expect(values(w)).toEqual(["2024-02-10"]);
+ });
+ it("keeps time precision and the named zone at day granularity", async () => {
+ const value = ref(
+ parseZonedDateTime("2024-03-10T01:30:45.123-08:00[America/Los_Angeles]"),
+ );
+ const w = fixture(
+ ``,
+ () => ({ value }),
+ );
+ expect(w.find('[data-type="hour"]').exists()).toBe(false);
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(value.value.timeZone).toBe("America/Los_Angeles");
+ expect(value.value.second).toBe(45);
+ expect(value.value.millisecond).toBe(123);
+ expect(values(w)).toEqual([value.value.toString()]);
+ });
+ it("preserves the model calendar while editing in the locale calendar", async () => {
+ const value = ref(toCalendar(initial, new PersianCalendar()));
+ const w = fixture(
+ ``,
+ () => ({ value }),
+ );
+ expect(part(w, "year").text()).toBe("2024");
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(value.value.calendar.identifier).toBe("persian");
+ expect(values(w)).toEqual(["2024-02-11"]);
+ });
+ it("uses provider locale and updates segment order", async () => {
+ const locale = ref("en-US");
+ const w = fixture(
+ `${content}`,
+ () => ({ locale, initial }),
+ );
+ expect(
+ w
+ .findAll('[data-slot="date-input-group-segment"]')[0]
+ .attributes("data-type"),
+ ).toBe("month");
+ locale.value = "zh-CN";
+ await flushPromises();
+ expect(
+ w
+ .findAll('[data-slot="date-input-group-segment"]')[0]
+ .attributes("data-type"),
+ ).toBe("year");
+ });
+ it("resets values and partial drafts; respects cancelled reset", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(values(w)).toEqual(["2024-02-10"]);
+ expect(part(w).text()).toBe("10");
+ });
+ it("validates required, range and custom constraints with FieldError and native invalid focus", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ const input = w.get(".hv-choice-validation").element as HTMLInputElement;
+ expect(input.checkValidity()).toBe(false);
+ await flushPromises();
+ expect(w.get('[data-slot="date-field"]').attributes("aria-invalid")).toBe(
+ "true",
+ );
+ expect(w.get('[data-slot="field-error"]').text()).toContain("请填写");
+ expect(document.activeElement).toBe(part(w, "month").element);
+ });
+ it("supports aria validation and server errors with accepted edit dismissal", async () => {
+ const errors = ref({ date: "Server error" });
+ const w = fixture(
+ ``,
+ () => ({ initial, errors }),
+ );
+ expect(w.get('[data-slot="field-error"]').text()).toContain("Server error");
+ expect(
+ (
+ w.get(".hv-choice-validation").element as HTMLInputElement
+ ).checkValidity(),
+ ).toBe(true);
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(w.find('[data-slot="field-error"]').exists()).toBe(false);
+ });
+ it("readonly submits and fieldset disabled omits; neither edits", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ expect(values(w)).toEqual([]);
+ expect(part(w).attributes("contenteditable")).toBe("false");
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ expect(w.getComponent(DateField).emitted("change")).toBeUndefined();
+ });
+ it("honors segment cancellation and explicit stop before the base navigation", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ const el = part(w).element as HTMLElement;
+ el.focus();
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(values(w)).toEqual(["2024-02-10"]);
+ part(w).element.dispatchEvent(
+ new KeyboardEvent("keydown", {
+ key: "ArrowRight",
+ bubbles: true,
+ cancelable: true,
+ }),
+ );
+ expect(document.activeElement).toBe(el);
+ });
+ it("updates granularity/hourCycle without dropping precision, supports leading zeros", async () => {
+ const value = ref(new CalendarDateTime(2024, 2, 3, 13, 4, 5));
+ const granularity = ref<"day" | "second">("day");
+ const cycle = ref<12 | 24>(12);
+ const w = fixture(
+ ``,
+ () => ({ value, granularity, cycle }),
+ );
+ expect(part(w).text()).toBe("03");
+ granularity.value = "second";
+ cycle.value = 24;
+ await flushPromises();
+ expect(part(w, "hour").text()).toBe("13");
+ expect(part(w, "second").text()).toBe("05");
+ expect(values(w)).toEqual(["2024-02-03T13:04:05"]);
+ });
+ it("hydrates explicit date content with unique IDs and stable nodes", async () => {
+ const component = defineComponent({
+ components,
+ setup: () => ({ initial }),
+ template: `${content}`,
+ });
+ const host = document.createElement("div");
+ host.innerHTML = await renderToString(createSSRApp(component));
+ document.body.append(host);
+ const before = host.querySelector('[data-type="day"]');
+ const warnings: string[] = [];
+ const app = createSSRApp(component);
+ app.config.warnHandler = (message) => warnings.push(message);
+ app.mount(host);
+ await flushPromises();
+ try {
+ expect(warnings).toEqual([]);
+ expect(host.querySelector('[data-type="day"]')).toBe(before);
+ } finally {
+ app.unmount();
+ }
+ });
+});
+
+it("applies min/max and unavailable constraints to the shared native validator", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ expect(w.get('[data-slot="field-error"]').text()).toContain("不能早于");
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(w.find('[data-slot="field-error"]').exists()).toBe(false);
+});
+it("keeps read-only submission and blocks edits without invalid constraints", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ expect(values(w)).toEqual(["2024-02-10"]);
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ expect(w.getComponent(DateField).emitted("change")).toBeUndefined();
+ expect(part(w).attributes("contenteditable")).toBe("false");
+ expect(
+ (w.get(".hv-choice-validation").element as HTMLInputElement).disabled,
+ ).toBe(true);
+});
+it("uses value alias, gives explicit modelValue priority and accepts explicit undefined empty", () => {
+ const value = ref(undefined);
+ const w = fixture(
+ ``,
+ () => ({ value, initial }),
+ );
+ expect(values(w)).toEqual([""]);
+ expect(part(w).attributes("data-placeholder")).toBe("true");
+});
+it("preserves accepted controlled values on reset and honors prevented reset", async () => {
+ const value = ref(initial);
+ const w = fixture(
+ ``,
+ () => ({ value, initial }),
+ );
+ await part(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(part(w).text()).toBe("11");
+ expect(values(w)).toEqual(["2024-02-11"]);
+});
+it("uses one externally associated ISO value and restores after native autofill rejection", async () => {
+ const w = fixture(
+ `${content}
`,
+ () => ({ initial }),
+ );
+ const input = w.get('[data-slot="date-field-value"]');
+ await input.setValue("2024-02-12");
+ await flushPromises();
+ expect(values(w)).toEqual(["2024-02-10"]);
+ expect((input.element as HTMLInputElement).value).toBe("2024-02-10");
+ expect(w.getComponent(DateField).emitted("change")).toHaveLength(1);
+});
+it("keeps IME composition keys out of the accepted model", async () => {
+ const w = fixture(
+ ``,
+ () => ({ initial }),
+ );
+ part(w).element.dispatchEvent(
+ new KeyboardEvent("keydown", {
+ key: "2",
+ isComposing: true,
+ bubbles: true,
+ cancelable: true,
+ }),
+ );
+ await flushPromises();
+ expect(values(w)).toEqual(["2024-02-10"]);
+ expect(part(w).text()).toBe("10");
+});
diff --git a/tests/date-foundation-ssr.test.ts b/tests/date-foundation-ssr.test.ts
new file mode 100644
index 0000000..59fdfdd
--- /dev/null
+++ b/tests/date-foundation-ssr.test.ts
@@ -0,0 +1,63 @@
+// @vitest-environment node
+import { describe, it, expect } from "vitest";
+import { createSSRApp, h } from "vue";
+import { renderToString } from "@vue/server-renderer";
+import { CalendarDate, parseZonedDateTime } from "@internationalized/date";
+import Field from "../packages/vue/tests/fixtures/DateFieldFoundation.vue";
+import Calendar from "../packages/vue/tests/fixtures/CalendarFoundation.vue";
+import Accepted from "../packages/vue/tests/fixtures/AcceptedDateFieldFoundation.vue";
+const initial = new CalendarDate(2024, 2, 10);
+describe("date foundation actual node SSR", () => {
+ it("renders full segmented date without browser globals", async () => {
+ expect(typeof window).toBe("undefined");
+ const html = await renderToString(
+ createSSRApp(Field, {
+ defaultValue: initial,
+ locale: "en-US",
+ name: "date",
+ }),
+ );
+ expect(html.match(/role="spinbutton"/g)).toHaveLength(3);
+ expect(html).toContain('value="2024-02-10"');
+ expect(html).toContain('aria-label="Date audit"');
+ });
+ it("renders leap month cells and selected date on the server", async () => {
+ const html = await renderToString(
+ createSSRApp(Calendar, {
+ defaultValue: initial,
+ defaultPlaceholder: initial,
+ locale: "en-US",
+ }),
+ );
+ expect(html).toContain('data-value="2024-02-29"');
+ expect(html).toContain('data-selected="true"');
+ // Installed CalendarGrid uses application, not grid; public ARIA needs explicit review.
+ expect(html).toContain('role="application"');
+ expect(html).toContain('role="gridcell"');
+ });
+ it("keeps SSR IDs stable and independent across same-page instances", async () => {
+ const app = () =>
+ createSSRApp({
+ render: () =>
+ h("main", [
+ h(Field, { defaultValue: initial }),
+ h(Field, { defaultValue: initial }),
+ ]),
+ });
+ const first = await renderToString(app());
+ expect(first).toBe(await renderToString(app()));
+ const ids = [...first.matchAll(/ id="([^"]+)"/g)].map((m) => m[1]);
+ expect(new Set(ids).size).toBe(ids.length);
+ });
+ it("serializes the adapted complete zone-bearing model on SSR", async () => {
+ const value = parseZonedDateTime(
+ "2024-03-10T01:30:45-08:00[America/Los_Angeles]",
+ );
+ const html = await renderToString(
+ createSSRApp(Accepted, { defaultValue: value, name: "date" }),
+ );
+ expect(html).toContain(
+ 'type="hidden" name="date" value="2024-03-10T01:30:45-08:00[America/Los_Angeles]"',
+ );
+ });
+});
diff --git a/tests/date-foundation.test.ts b/tests/date-foundation.test.ts
new file mode 100644
index 0000000..2120aae
--- /dev/null
+++ b/tests/date-foundation.test.ts
@@ -0,0 +1,227 @@
+import { afterEach, describe, it, expect } from "vitest";
+import { mount, flushPromises } from "@vue/test-utils";
+import { defineComponent, ref } from "vue";
+import {
+ CalendarDate,
+ CalendarDateTime,
+ parseZonedDateTime,
+ toCalendar,
+ PersianCalendar,
+} from "@internationalized/date";
+import DateFieldFoundation from "../packages/vue/tests/fixtures/DateFieldFoundation.vue";
+import CalendarFoundation from "../packages/vue/tests/fixtures/CalendarFoundation.vue";
+const wrappers: ReturnType[] = [];
+afterEach(async () => {
+ wrappers.splice(0).forEach((w) => w.unmount());
+ await flushPromises();
+ document.body.innerHTML = "";
+});
+function field(template: string, setup = () => ({})) {
+ const w = mount(
+ defineComponent({ components: { DateFieldFoundation }, template, setup }),
+ { attachTo: document.body },
+ );
+ wrappers.push(w);
+ return w;
+}
+const initial = new CalendarDate(2024, 2, 10);
+const segment = (w: ReturnType, part: string) =>
+ w.get(`[data-reka-date-field-segment="${part}"]`);
+const day = (w: ReturnType, value: string) =>
+ w.get(
+ `[data-reka-calendar-cell-trigger][data-value="${value}"]:not([data-outside-view])`,
+ );
+function calendar(props: Record = {}) {
+ const w = mount(CalendarFoundation, {
+ props: { defaultPlaceholder: initial, ...props },
+ attachTo: document.body,
+ });
+ wrappers.push(w);
+ return w;
+}
+describe("installed Reka DateField capability probes (not public acceptance)", () => {
+ it("edits a day while retaining CalendarDate type and native date serialization", async () => {
+ const w = field(
+ '',
+ () => ({ initial }),
+ );
+ await segment(w, "day").trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ const emitted = w
+ .getComponent(DateFieldFoundation)
+ .emitted("update:modelValue")!
+ .at(-1)![0] as CalendarDate;
+ expect(emitted).toBeInstanceOf(CalendarDate);
+ expect(emitted.toString()).toBe("2024-02-11");
+ expect(
+ new FormData(w.get("form").element as HTMLFormElement).get("date"),
+ ).toBe("2024-02-11");
+ });
+ it("documents that raw DateField reset does not restore displayed segments", async () => {
+ const w = field(
+ '',
+ () => ({ initial }),
+ );
+ await segment(w, "day").trigger("keydown", { key: "ArrowUp" });
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(segment(w, "day").text()).toBe("11");
+ });
+ it("documents controlled rejection leaving optimistic segment text", async () => {
+ const w = field('', () => ({
+ initial,
+ }));
+ await segment(w, "day").trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(segment(w, "day").text()).toBe("11");
+ expect(w.get("input").element.value).toBe("2024-02-10");
+ });
+ it("retains seconds in the emitted datetime but truncates native minute submission", async () => {
+ const value = new CalendarDateTime(2024, 2, 10, 13, 14, 45, 123);
+ const w = field(
+ '',
+ () => ({ value }),
+ );
+ await segment(w, "day").trigger("keydown", { key: "ArrowUp" });
+ const next = w
+ .getComponent(DateFieldFoundation)
+ .emitted("update:modelValue")!
+ .at(-1)![0] as CalendarDateTime;
+ expect(next.second).toBe(45);
+ expect(next.millisecond).toBe(123);
+ expect(
+ new FormData(w.get("form").element as HTMLFormElement).get("date"),
+ ).toBe("2024-02-11T13:14");
+ });
+ it("documents native datetime-local losing zone metadata", () => {
+ const value = parseZonedDateTime(
+ "2024-03-10T01:30-08:00[America/Los_Angeles]",
+ );
+ const w = field(
+ '',
+ () => ({ value }),
+ );
+ expect(w.get("input").element.value).toBe("2024-03-10T01:30");
+ expect(w.text()).toContain("PST");
+ });
+ it("documents alternate-calendar native fields not using ISO Gregorian serialization", () => {
+ const value = toCalendar(initial, new PersianCalendar());
+ const w = field(
+ '',
+ () => ({ value }),
+ );
+ expect(w.get("input").element.value).not.toBe(value.toString());
+ });
+ it("supports native required and disabled omission but readonly remains submitted", () => {
+ const required = field(
+ '',
+ () => ({ initial }),
+ );
+ expect(
+ required.get("input").element.checkValidity(),
+ ).toBe(false);
+ const readonly = field(
+ '',
+ () => ({ initial }),
+ );
+ expect(segment(readonly, "day").attributes("contenteditable")).toBe(
+ "false",
+ );
+ expect(
+ new FormData(readonly.get("form").element as HTMLFormElement).get("date"),
+ ).toBe("2024-02-10");
+ const disabled = field(
+ '',
+ () => ({ initial }),
+ );
+ expect(
+ new FormData(disabled.get("form").element as HTMLFormElement).has("date"),
+ ).toBe(false);
+ });
+ it("updates segment ordering and content when locale changes", async () => {
+ const locale = ref("en-US");
+ const w = field(
+ '',
+ () => ({ locale, initial }),
+ );
+ const parts = () =>
+ w
+ .findAll('[role="spinbutton"]')
+ .map((e) => e.attributes("data-reka-date-field-segment"));
+ expect(parts()).toEqual(["month", "day", "year"]);
+ locale.value = "zh-CN";
+ await flushPromises();
+ expect(parts()).toEqual(["year", "month", "day"]);
+ });
+});
+describe("installed Reka Calendar capability probes (not public acceptance)", () => {
+ it("renders leap-month dates, skips disabled days and focuses unavailable days", async () => {
+ const w = calendar({
+ defaultValue: initial,
+ isDateDisabled: (value: CalendarDate) => value.day === 11,
+ isDateUnavailable: (value: CalendarDate) => value.day === 12,
+ });
+ expect(day(w, "2024-02-29").element.textContent).toContain("29");
+ day(w, "2024-02-10").element.focus();
+ await day(w, "2024-02-10").trigger("keydown", {
+ key: "ArrowRight",
+ code: "ArrowRight",
+ });
+ await flushPromises();
+ expect(document.activeElement).toBe(day(w, "2024-02-12").element);
+ await day(w, "2024-02-12").trigger("click");
+ expect(w.emitted("update:modelValue")).toBeUndefined();
+ });
+ it("keeps a controlled rejected selection visually accepted only by the parent", async () => {
+ const w = calendar({ modelValue: initial });
+ await day(w, "2024-02-13").trigger("click");
+ await day(w, "2024-02-13").trigger("click");
+ expect(w.emitted("update:modelValue")).toHaveLength(2);
+ expect(day(w, "2024-02-10").attributes("data-selected")).toBe("true");
+ expect(day(w, "2024-02-13").attributes("data-selected")).toBeUndefined();
+ });
+ it("supports multiple dates at runtime despite the scalar emit declaration", async () => {
+ const w = calendar({ multiple: true, modelValue: [initial] });
+ await day(w, "2024-02-13").trigger("click");
+ const next = w.emitted("update:modelValue")!.at(-1)![0] as CalendarDate[];
+ expect(Array.isArray(next)).toBe(true);
+ expect(next.map((v) => v.toString())).toEqual(["2024-02-10", "2024-02-13"]);
+ });
+ it("respects min/max and allows readonly navigation without selection", async () => {
+ const w = calendar({
+ readonly: true,
+ minValue: initial,
+ maxValue: initial.add({ days: 5 }),
+ });
+ expect(day(w, "2024-02-09").attributes("data-disabled")).toBeDefined();
+ await day(w, "2024-02-13").trigger("click");
+ expect(w.emitted("update:modelValue")).toBeUndefined();
+ });
+ it("documents cancellation happening after the internal keyboard focus movement", async () => {
+ const w = calendar({
+ defaultValue: initial,
+ onKeydown: (event: KeyboardEvent) => event.preventDefault(),
+ });
+ day(w, "2024-02-10").element.focus();
+ await day(w, "2024-02-10").trigger("keydown", {
+ key: "ArrowRight",
+ code: "ArrowRight",
+ });
+ await flushPromises();
+ expect(document.activeElement).toBe(day(w, "2024-02-11").element);
+ });
+ it("supports two month grids and fixed six-week views", () => {
+ const w = calendar({ numberOfMonths: 2, fixedWeeks: true });
+ expect(w.findAll("table")).toHaveLength(2);
+ expect(w.findAll("tbody tr")).toHaveLength(12);
+ });
+});
+
+it("records that an explicit Gregorian placeholder keeps a Gregorian month grid under an Indian locale", () => {
+ const w = calendar({ defaultValue: initial, locale: "hi-IN-u-ca-indian" });
+ const current = w.findAll(
+ "[data-reka-calendar-cell-trigger]:not([data-outside-view])",
+ );
+ expect(current[0].attributes("data-value")).toBe("2024-02-01");
+ expect(current).toHaveLength(29);
+});
diff --git a/tests/date-model.test.ts b/tests/date-model.test.ts
new file mode 100644
index 0000000..2bfefa6
--- /dev/null
+++ b/tests/date-model.test.ts
@@ -0,0 +1,192 @@
+import { afterEach, describe, it, expect } from "vitest";
+import { mount, flushPromises } from "@vue/test-utils";
+import { createSSRApp, defineComponent, ref } from "vue";
+import { renderToString } from "@vue/server-renderer";
+import { CalendarDate, parseZonedDateTime } from "@internationalized/date";
+import Field from "../packages/vue/tests/fixtures/AcceptedDateFieldFoundation.vue";
+const wrappers: ReturnType[] = [];
+afterEach(() => {
+ wrappers.splice(0).forEach((w) => w.unmount());
+ document.body.innerHTML = "";
+});
+const initial = new CalendarDate(2024, 2, 10);
+function fixture(template: string, setup = () => ({})) {
+ const w = mount(defineComponent({ components: { Field }, template, setup }), {
+ attachTo: document.body,
+ });
+ wrappers.push(w);
+ return w;
+}
+const day = (w: ReturnType) =>
+ w.get('[data-reka-date-field-segment="day"]');
+const data = (w: ReturnType) =>
+ new FormData(w.get("form").element as HTMLFormElement).getAll("date");
+describe("private accepted date wire adapter", () => {
+ it("restores rejected segments and emits identical retries without native value drift", async () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(day(w).text()).toBe("10");
+ expect(data(w)).toEqual(["2024-02-10"]);
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ const events = w.getComponent(Field).emitted("update:modelValue")!;
+ expect(events.map((args) => (args[0] as CalendarDate).toString())).toEqual([
+ "2024-02-11",
+ "2024-02-11",
+ ]);
+ expect(initial.day).toBe(10);
+ });
+ it("accepts parent replacements and updates full native submission once", async () => {
+ const value = ref(initial);
+ const w = fixture(
+ '',
+ () => ({ value }),
+ );
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(day(w).text()).toBe("11");
+ expect(data(w)).toEqual(["2024-02-11"]);
+ value.value = initial.add({ days: 10 });
+ await flushPromises();
+ expect(day(w).text()).toBe("20");
+ });
+ it("resets uncontrolled values and displayed segments without synthetic change events", async () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(day(w).text()).toBe("10");
+ expect(data(w)).toEqual(["2024-02-10"]);
+ expect(w.getComponent(Field).emitted("update:modelValue")).toHaveLength(1);
+ });
+ it("keeps accepted parent values on controlled reset", async () => {
+ const value = ref(initial);
+ const w = fixture(
+ '',
+ () => ({ value }),
+ );
+ value.value = initial.add({ days: 2 });
+ await flushPromises();
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(day(w).text()).toBe("12");
+ expect(data(w)).toEqual(["2024-02-12"]);
+ });
+ it("honors cancelled reset", async () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(day(w).text()).toBe("11");
+ });
+ it("submits complete ZonedDateTime including seconds and time zone", () => {
+ const value = parseZonedDateTime(
+ "2024-03-10T01:30:45-08:00[America/Los_Angeles]",
+ );
+ const w = fixture(
+ '',
+ () => ({ value }),
+ );
+ expect(data(w)).toEqual([value.toString()]);
+ });
+ it("treats explicit undefined as controlled empty rather than defaultValue", () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ expect(day(w).attributes("data-placeholder")).toBeDefined();
+ expect(data(w)).toEqual([""]);
+ });
+ it("blocks readonly edits and keeps the accepted submission", async () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ expect(data(w)).toEqual(["2024-02-10"]);
+ expect(w.getComponent(Field).emitted("update:modelValue")).toBeUndefined();
+ });
+});
+
+it("omits disabled native values", () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ expect(data(w)).toEqual([]);
+});
+it("hydrates the accepted date and segment identities without mismatch", async () => {
+ const Component = defineComponent({
+ components: { Field },
+ setup: () => ({ initial }),
+ template: '',
+ });
+ const host = document.createElement("div");
+ host.innerHTML = await renderToString(createSSRApp(Component));
+ document.body.append(host);
+ const before = host.querySelector('[data-reka-date-field-segment="day"]');
+ const warnings: string[] = [];
+ const app = createSSRApp(Component);
+ app.config.warnHandler = (message) => warnings.push(message);
+ app.mount(host);
+ await flushPromises();
+ try {
+ expect(warnings).toEqual([]);
+ expect(host.querySelector('[data-reka-date-field-segment="day"]')).toBe(
+ before,
+ );
+ expect(before?.textContent).toBe("10");
+ } finally {
+ app.unmount();
+ }
+});
+
+it("preserves partial drafts but clears a completed rejected empty proposal without losing focus", async () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ const month = () => w.get('[data-reka-date-field-segment="month"]');
+ const year = () => w.get('[data-reka-date-field-segment="year"]');
+ await month().trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(month().text()).toBe("2");
+ expect(data(w)).toEqual([""]);
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ (year().element as HTMLElement).focus();
+ const focused = year().element;
+ await year().trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(w.getComponent(Field).emitted("update:modelValue")).toHaveLength(1);
+ expect(month().attributes("data-placeholder")).toBeDefined();
+ expect(day(w).attributes("data-placeholder")).toBeDefined();
+ expect(year().attributes("data-placeholder")).toBeDefined();
+ expect(document.activeElement).toBe(focused);
+ for (const part of [month(), day(w), year()])
+ await part.trigger("keydown", { key: "ArrowUp" });
+ await flushPromises();
+ expect(w.getComponent(Field).emitted("update:modelValue")).toHaveLength(2);
+});
+it("clears an incomplete uncontrolled draft on reset", async () => {
+ const w = fixture(
+ '',
+ () => ({ initial }),
+ );
+ await day(w).trigger("keydown", { key: "ArrowUp" });
+ expect(day(w).text()).toBe("10");
+ (w.get("form").element as HTMLFormElement).reset();
+ await flushPromises();
+ expect(day(w).attributes("data-placeholder")).toBeDefined();
+});
diff --git a/tests/date-value.test.ts b/tests/date-value.test.ts
new file mode 100644
index 0000000..e7abd5f
--- /dev/null
+++ b/tests/date-value.test.ts
@@ -0,0 +1,107 @@
+import { describe, it, expect } from "vitest";
+import {
+ CalendarDate,
+ CalendarDateTime,
+ parseZonedDateTime,
+ toCalendar,
+ PersianCalendar,
+} from "@internationalized/date";
+import {
+ dateForLocale,
+ copyDateValue,
+ dateValueKey,
+ sameDateValue,
+ copyDateValues,
+ serializeDateValue,
+ calendarDayState,
+ copyDateRange,
+ calendarRangeStatus,
+} from "../packages/vue/src/components/date/value";
+const day = new CalendarDate(2024, 2, 29);
+describe("private calendar date boundary", () => {
+ it("copies dates without mutating caller or losing date class", () => {
+ const copy = copyDateValue(day);
+ expect(copy).not.toBe(day);
+ expect(copy).toBeInstanceOf(CalendarDate);
+ expect(copy.add({ years: 1 }).toString()).toBe("2025-02-28");
+ expect(day.toString()).toBe("2024-02-29");
+ });
+ it("keeps null/undefined empty and distinguishes date from midnight datetime", () => {
+ expect(copyDateValue(null)).toBeNull();
+ expect(copyDateValue(undefined)).toBeUndefined();
+ expect(sameDateValue(null, undefined)).toBe(true);
+ expect(sameDateValue(day, new CalendarDateTime(2024, 2, 29))).toBe(false);
+ });
+ it("retains sub-minute precision independently from display granularity", () => {
+ const value = new CalendarDateTime(2024, 2, 29, 13, 14, 15, 123);
+ expect(serializeDateValue(copyDateValue(value))).toBe(
+ "2024-02-29T13:14:15.123",
+ );
+ });
+ it("retains DST offset, zone and wall-clock value", () => {
+ const value = parseZonedDateTime(
+ "2024-03-10T01:30-08:00[America/Los_Angeles]",
+ );
+ const copy = copyDateValue(value);
+ expect(copy.timeZone).toBe(value.timeZone);
+ expect(copy.offset).toBe(-28800000);
+ expect(copy.add({ hours: 1 }).hour).toBe(3);
+ expect(serializeDateValue(copy)).toContain("-08:00[America/Los_Angeles]");
+ });
+ it("keeps alternate calendar identity even when ISO serialization is equal", () => {
+ const persian = toCalendar(day, new PersianCalendar());
+ expect(persian.toString()).toBe(day.toString());
+ expect(sameDateValue(day, persian)).toBe(false);
+ expect(copyDateValue(persian).calendar.identifier).toBe("persian");
+ });
+ it("deduplicates copied values without sharing mutable date objects", () => {
+ const values = copyDateValues([day, day.copy(), day.add({ days: 1 })]);
+ expect(values).toHaveLength(2);
+ expect(values[0]).not.toBe(day);
+ expect(dateValueKey(values[0])).toBe(dateValueKey(day));
+ });
+ it("keeps unavailable distinct from disabled calendar days", () => {
+ expect(calendarDayState(day, { isDateUnavailable: () => true })).toEqual({
+ isDisabled: false,
+ isUnavailable: true,
+ isSelectable: false,
+ });
+ expect(calendarDayState(day, { isDateDisabled: () => true })).toEqual({
+ isDisabled: true,
+ isUnavailable: false,
+ isSelectable: false,
+ });
+ });
+ it("compares calendar bounds by local day including equivalent alternate calendars", () => {
+ expect(
+ calendarDayState(toCalendar(day, new PersianCalendar()), {
+ minValue: day,
+ maxValue: day,
+ }).isSelectable,
+ ).toBe(true);
+ expect(
+ calendarDayState(day, { minValue: day.add({ days: 1 }) }).isDisabled,
+ ).toBe(true);
+ });
+ it("copies ranges and preserves incomplete drafts", () => {
+ const range = copyDateRange({ start: day, end: null });
+ expect(range.start).not.toBe(day);
+ expect(calendarRangeStatus(range)).toBe("incomplete");
+ expect(calendarRangeStatus({ start: null, end: null })).toBe("empty");
+ expect(
+ calendarRangeStatus({ start: day, end: day.subtract({ days: 1 }) }),
+ ).toBe("inverted");
+ expect(calendarRangeStatus({ start: day, end: day })).toBe("valid");
+ });
+});
+
+it("converts the calendar for locale display without altering the incoming model or instant", () => {
+ const original = parseZonedDateTime(
+ "2024-03-10T01:30-08:00[America/Los_Angeles]",
+ );
+ const indian = dateForLocale(original, "hi-IN-u-ca-indian");
+ expect(indian.calendar.identifier).toBe("indian");
+ expect(indian.timeZone).toBe(original.timeZone);
+ expect(indian.toString()).toBe(original.toString());
+ expect(original.calendar.identifier).toBe("gregory");
+});
diff --git a/tests/package/README.md b/tests/package/README.md
index 89ff065..da6b505 100644
--- a/tests/package/README.md
+++ b/tests/package/README.md
@@ -21,3 +21,5 @@ LISTBOX-01 增加 `consume-list-box.mjs` / `list-box-contract.ts`。同样复制
M33–M34 使用 consume-m33-m34.mjs / m33-m34-contract.ts;同样复制到独立 tarball 消费工程,分别运行 node 与两种解析模式的 tsc。包括所有公开部件、真正 node SSR、CSS 关键帧与策略/尺寸/方向的正反类型检查。集成验证目录为 /private/tmp/heroui-m33-consumer,不复用其他并行任务的临时产物。
SELECT-01 增加 `consume-select.mjs` / `select-contract.ts`。新 tarball 安装后运行 ESM/SSR/CSS 脚本,两种模块解析模式都纳入类型正反例;数字/字符串/空 key、六部件、validate 与事件载荷推断不应退化。保留旧组件消费回归。
+
+DATE-02 增加 `consume-date-field.mjs` / `date-field-contract.ts`。独立消费者显式安装 `@internationalized/date@3.12.4`,运行完整 ISO 时区提交/SSR/样式检查,分别用 NodeNext 与 bundler 验证 DateValue、粒度、变体、范围和 segment 的正反类型,不从源码 alias 取公共类型。
diff --git a/tests/package/consume-date-field.mjs b/tests/package/consume-date-field.mjs
new file mode 100644
index 0000000..d9d6ec1
--- /dev/null
+++ b/tests/package/consume-date-field.mjs
@@ -0,0 +1,58 @@
+import assert from "node:assert/strict";
+import { createSSRApp, h } from "vue";
+import { renderToString } from "@vue/server-renderer";
+import { parseZonedDateTime } from "@internationalized/date";
+import * as c from "@heroui-vue/components";
+import { readFile } from "node:fs/promises";
+for (const key of [
+ "DateField",
+ "DateFieldRoot",
+ "DateFieldGroup",
+ "DateFieldInput",
+ "DateFieldSegment",
+ "DateFieldPrefix",
+ "DateFieldSuffix",
+ "DateFieldInputContainer",
+ "DateInputGroup",
+ "DateInputGroupInput",
+ "DateInputGroupSegment",
+ "DateInputGroupInputContainer",
+ "DateInputGroupPrefix",
+ "DateInputGroupSuffix",
+])
+ assert.ok(c[key], key);
+const date = parseZonedDateTime(
+ "2024-03-10T01:30:45-08:00[America/Los_Angeles]",
+);
+const html = await renderToString(
+ createSSRApp({
+ render: () =>
+ h(
+ c.DateField,
+ { defaultValue: date, granularity: "minute", name: "date" },
+ () => [
+ h(c.Label, () => "Date"),
+ h(c.DateFieldGroup, () => h(c.DateFieldInput)),
+ h(c.Description, () => "Help"),
+ ],
+ ),
+ }),
+);
+assert.ok(
+ html.includes('value="2024-03-10T01:30:45-08:00[America/Los_Angeles]"'),
+);
+assert.equal((html.match(/name="date"/g) || []).length, 1);
+assert.ok(html.includes("aria-labelledby="));
+assert.ok(html.includes("aria-describedby="));
+const css = await readFile(
+ import.meta.resolve("@heroui-vue/styles/css").replace("file://", ""),
+ "utf8",
+);
+for (const name of [
+ "hv-date-field",
+ "hv-date-input-group",
+ "hv-date-input-group__segment",
+ "hv-date-input-group--secondary",
+])
+ assert.ok(css.includes(name), name);
+console.log("DateField tarball ESM/SSR/CSS: passed");
diff --git a/tests/package/date-field-contract.ts b/tests/package/date-field-contract.ts
new file mode 100644
index 0000000..0c0084d
--- /dev/null
+++ b/tests/package/date-field-contract.ts
@@ -0,0 +1,55 @@
+import {
+ DateField,
+ DateFieldGroup,
+ DateFieldInput,
+ DateFieldSegment,
+ DateInputGroup,
+ type DateFieldProps,
+ type DateFieldGroupProps,
+ type DateFieldSegmentProps,
+ type DateSegment,
+} from "@heroui-vue/components";
+import { parseDate } from "@internationalized/date";
+const date = parseDate("2024-02-10");
+const props: DateFieldProps = {
+ modelValue: date,
+ granularity: "minute",
+ hourCycle: 24,
+ placeholderValue: date,
+ validate: (value) => (value ? value.toString() : "Missing"),
+};
+const group: DateFieldGroupProps = { variant: "secondary", fullWidth: true };
+// @ts-expect-error DateValue is not a date string
+const wrongDate: DateFieldProps = { modelValue: "2024-02-10" };
+// @ts-expect-error no milliseconds granularity
+const wrongGranularity: DateFieldProps = { granularity: "millisecond" };
+// @ts-expect-error no arbitrary variants
+const wrongVariant: DateFieldGroupProps = { variant: "outline" };
+// @ts-expect-error a DateField is not a range
+const wrongRange: DateFieldProps = { modelValue: [date, date] };
+const segment: DateSegment = {
+ part: "day",
+ type: "day",
+ text: "10",
+ value: "10",
+ isEditable: true,
+ isPlaceholder: false,
+};
+const segmentProps: DateFieldSegmentProps = { segment };
+// @ts-expect-error DateSegment has real properties
+const wrongSegment: DateFieldSegmentProps = { segment: "day" };
+void [
+ DateField,
+ DateFieldGroup,
+ DateFieldInput,
+ DateFieldSegment,
+ DateInputGroup,
+ props,
+ group,
+ segmentProps,
+ wrongDate,
+ wrongGranularity,
+ wrongVariant,
+ wrongRange,
+ wrongSegment,
+];