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
+80 -1
View File
@@ -169,6 +169,85 @@ InputGroup 会自动反映父级 TextField 的无效状态。
<ComponentPreview name="input-group-with-textarea" />
### 用法示例
图标前缀加确认按钮后缀的完整组合:
```vue
<script setup lang="ts">
import { IconCheck, IconMail } from "@tabler/icons-vue";
import {
Button,
InputGroup,
InputGroupInput,
InputGroupPrefix,
InputGroupSuffix,
Label,
TextField,
} from "@heroui-vue/components";
</script>
<template>
<TextField>
<Label>邮箱</Label>
<InputGroup>
<InputGroupPrefix>
<IconMail class="size-4 text-muted" />
</InputGroupPrefix>
<InputGroupInput placeholder="name@email.com" />
<InputGroupSuffix>
<Button is-icon-only aria-label="确认" size="sm" variant="ghost">
<IconCheck class="size-4" />
</Button>
</InputGroupSuffix>
</InputGroup>
</TextField>
</template>
```
### 文本域用法示例
带字符计数与 500 字上限校验的反馈文本域:
```vue
<script setup lang="ts">
import { ref } from "vue";
import { IconMail } from "@tabler/icons-vue";
import {
Description,
FieldError,
InputGroup,
InputGroupPrefix,
InputGroupTextArea,
Label,
TextField,
} from "@heroui-vue/components";
const feedback = ref("");
</script>
<template>
<TextField full-width name="feedback" :is-invalid="feedback.length > 500">
<Label>你的反馈</Label>
<InputGroup full-width>
<InputGroupPrefix>
<IconMail class="size-4 text-muted" />
</InputGroupPrefix>
<InputGroupTextArea
v-model="feedback"
class="resize-none"
placeholder="分享你的想法、建议或问题……"
:rows="5"
/>
</InputGroup>
<Description class="flex w-full items-center justify-between px-1">
<span>最多 500 个字符。</span>
<span class="ms-auto">{{ feedback.length }}/500</span>
</Description>
<FieldError>反馈不能超过 500 个字符</FieldError>
</TextField>
</template>
```
## 自定义样式
### Tailwind CSS
@@ -294,4 +373,4 @@ InputGroup 会根据状态自动管理以下 data 属性:
## 相关组件
[Input 输入框](./input) · [Surface 表面](./surface) · [Button 按钮](./button)
[TextField 文本输入框](./text-field) · [Input 输入框](./input) · [Label 标签](./label)