docs: close documentation facts, structure and related-component mapping

HD-04 scope, against heroui ce90ea3 cn sources:

- stale/fictional content: input.md no longer claims TextField is
  unmigrated; color-field.md no longer claims ColorPicker is private;
  header.md drops the fictional Header.Root subcomponent and the stale
  'menus not migrated' wording (MenuSection label registration is now
  documented from HeaderRoot source); radio-group.md drops three copied
  CheckboxGroup wordings (variant override is Radio's, scalar emits,
  native single-value submit); input-otp.md drops the fictional
  data-complete state and lists the real missing upstream props
- toggle-button disabled row now matches the real CSS hooks
  (:disabled / [aria-disabled], with data-disabled as a marker only)
- part API / CSS classes / interactive states restored per pinned
  sources: button (full class lists + real variable-based global CSS),
  accordion (per-part tables + variant/state lists), card (per-part
  tables + variant list), switch (SwitchGroup snippet + Switch/
  SwitchGroup class lists + states), color-field Group (class list +
  states), input-otp (variant notes, global CSS, class/state lists);
  input-group gains the two upstream usage chapters
- RelatedComponents restored from the pinned componentRelationships
  (first-3, filtered against componentsMap): 64 pages rewritten,
  list-box/slider sections added, 7 empty-mapping pages' fabricated
  entries removed; RelatedShowcases left unmigrated with its real data
  inventory recorded (2 cases, showcase-site cards)
- defaults unified on implementation evidence: granularity (inferred
  day/minute) and visibleYears (full min-max span, no "or 20" fallback);
  HD-03 hand-offs resolved (trigger focus-visible noted for HD-06,
  width guards kept)
- new demos: header-collection-grouping (MenuSection/ListBoxSection
  label wiring), empty-state-collection (collection empty slot);
  empty-state page deduplicated with a boundary compatibility note
- ComponentPreview minHeight/isBgSolid restored per the 30 upstream
  marks; tabs-overflow max-w-full kept after measuring internal scroll
- tests: +3 header registration/demo cases, +1 empty-state collection
  case; full suite 110 files / 1630 tests, typecheck and build:docs
  pass
This commit is contained in:
maoyingjie
2026-10-28 22:32:10 +08:00
parent 2c6d871354
commit 145a208687
76 changed files with 912 additions and 352 deletions
+49 -5
View File
@@ -266,23 +266,67 @@ color.toString("hex");
color.getChannelValue("red");
```
本页部件和 Props,以及 `ColorFieldRenderProps`、`ColorFieldRenderState`、`ColorFieldSlots`、`ColorFieldExpose`、`colorFieldVariants`、`colorInputGroupVariants`、`ColorFieldVariants`、`ColorInputGroupVariants` 均从包根公开。ColorInputGroup 与 ColorField 的对应部件共享实现。[ColorSwatchPicker 颜色色块选择器](/components/color-swatch-picker) 已公开;ColorPicker 尚未公开。
本页部件和 Props,以及 `ColorFieldRenderProps`、`ColorFieldRenderState`、`ColorFieldSlots`、`ColorFieldExpose`、`colorFieldVariants`、`colorInputGroupVariants`、`ColorFieldVariants`、`ColorInputGroupVariants` 均从包根公开。ColorInputGroup 与 ColorField 的对应部件共享实现。[ColorSwatchPicker 颜色色块选择器](/components/color-swatch-picker) 与 [ColorPicker 颜色选择器](/components/color-picker) 均已公开。
## ColorField.Group Styling
使用 `.hv-color-input-group`、`__input`、`__prefix`、`__suffix` 定制各节点;primary/secondary/full-width 修饰符与上游视觉数值一致。根容器为 `.hv-color-field`。Group 负责 hover/focus-within/invalid/disabled 的样式,Input 自身去掉默认边框和焦点轮廓;焦点环展示在 Group。状态必须写在实际匹配 CSS 的节点。
根容器为 `.hv-color-field`,Group 为 `.hv-color-input-group`。Group 负责 hover/focus-within/invalid/disabled 的样式,Input 自身去掉默认边框和焦点轮廓;焦点环展示在 Group。状态必须写在实际匹配 CSS 的节点。primary/secondary/full-width 修饰符与上游视觉数值一致。
### Customizing the component classes
基础类驱动每个实例。使用 `@layer components` 一次性覆盖:
```css
@layer components {
.hv-color-input-group {
border-radius: var(--radius-field);
@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-color-input-group__input {
font-variant-numeric: tabular-nums;
@apply flex min-w-0 flex-1 items-center rounded-none border-0 bg-transparent px-3 py-2 shadow-none outline-none;
}
.hv-color-input-group__prefix,
.hv-color-input-group__suffix {
@apply flex shrink-0 items-center text-field-placeholder;
}
}
```
### ColorField.Group CSS Classes
- `.hv-color-input-group` - 根容器样式
- `.hv-color-input-group__input` - Input 包装器样式(含 `min-w-0` 通道收窄)
- `.hv-color-input-group__prefix` - 前缀元素样式
- `.hv-color-input-group__suffix` - 后缀元素样式
- `.hv-color-input-group--primary` / `--secondary` / `--full-width` - 变体与宽度修饰符
### ColorField.Group Interactive States
- **Hover**:`:hover:not(:focus-within)` 或 `[data-hovered="true"]:not([data-focus-within="true"])`
- **Focus Within**:`[data-focus-within="true"]` 或 `:focus-within`
- **Invalid**:`[data-invalid="true"]`(与 `aria-invalid` 同步)
- **Disabled**:`[data-disabled="true"]` 或 `[aria-disabled="true"]`
## 相关组件
[ColorArea 颜色区域](/components/color-area)、[ColorSlider 颜色滑块](/components/color-slider)、[ColorSwatch 颜色色块](/components/color-swatch) 与 [ColorPicker 颜色选择器](/components/color-picker)。
[ColorSwatch 颜色色块](./color-swatch) · [ColorSwatchPicker 颜色色块选择器](./color-swatch-picker) · [ColorPicker 颜色选择器](./color-picker)