feat(textarea): 新增多行文本组件

- rows / resize / invalid,样式与 Input 一致(焦点只换边框)
- 契约、展示页(#inputs)、README 计数 40 → 41、变更记录同步
This commit is contained in:
stash
2026-10-29 12:58:32 +08:00
parent 12e3047f1a
commit 0d5d7753e2
6 changed files with 113 additions and 2 deletions
+10
View File
@@ -20,6 +20,7 @@
| `Button` | L2 | ✅ | 操作按钮(圆角 / 胶囊) | `variant` `size` `shape` `block` `loading` `icon` |
| `IconButton` | L2 | ✅ | 圆形图标按钮(28 / 36 / 44) | `label`(必填) `icon` `variant` `size` `spinning` |
| `Input` | L2 | ✅ | 组合式输入框 | `icon` `clearable` `onClear` `shortcut` `inputRef` |
| `Textarea` | L2 | ✅ | 多行文本(Markdown / 简介) | `rows` `resize` `invalid` |
| `Switch` | L2 | ✅ | 即时生效的开关 | `checked` `onChange` `size` `label` |
| `Checkbox` | L2 | ✅ | 复选框(多选 / 确认) | `checked` `onChange` `label` |
| `RadioGroup` | L2 | ✅ | 互斥单选组 | `options` `value` `onChange` `direction` |
@@ -569,6 +570,14 @@
- **规则**:错误用文案而不是只换颜色(颜色不足以表达);`defaultValue` / `value` 等仍由控件自己管。
- **展示页**:`#inputs`
### 3.41 Textarea ✅
- **用途**:多行文本——Markdown 正文、简介、备注。
- **不该用在哪**:单行短文本(用 `Input`);需要工具栏的富文本(页面自己拼)。
- **Props**:透传 `<textarea>`,另加 `rows`(默认 4)、`resize: 'none' | 'vertical'`(默认 `vertical`)、`invalid`(红边框 + `aria-invalid`)。
- **规则**:焦点只用边框变色,不叠 outline(与 `Input` 一致);`invalid` 要和错误文案一起用。
- **展示页**:`#inputs`
---
## 4. 组合模式(不进库,但必须照这个拼)
@@ -667,3 +676,4 @@
| 2026-10-28 | **修复**:`Input` 聚焦不再叠 outline(文本框点击会命中 `:focus-visible`,导致边框 + 外环「双框」;现在只用边框变主色)。`Layout` 增加 `hideScrollbar`(内部滚动条可隐藏)。影响面:所有 `Input` 页面视觉(去掉了多余外环)、`Layout screen` 页面可选用 |
| 2026-10-28 | **补齐剩余能力**:新增 `Image`(比例 / 填充 / 失败降级)与 `FormField`(标签 + 提示 + 错误,不做校验);`Button` 增加 `size="lg"`(44);展示页补 `Title weight`、`Avatar xl/tone/icon`、`Cover lift`、`Menu itemHeight`、`Layout screen/hideScrollbar`、`Input size`、`FormField` 示例;新增 `themes/example.css` 主题示例(只改变量) |
| 2026-10-29 | `Breadcrumb` 增加 `onNavigate`(可选):传了就用 `preventDefault` 接管点击,交给 SPA 路由;不传保持普通链接。兼容性:新增可选 prop,无破坏性 |
| 2026-10-29 | 新增 `Textarea`(`rows` / `resize` / `invalid`),与 `Input` 共用边框与焦点样式。兼容性:纯新增 |