mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 11:44:28 +08:00
* feat(textarea): add Textarea component with variants and Storybook examples * feat(textarea): enhance Textarea component with context, improved variants, and Storybook examples * Fine-tuning the style * fix ci * feat(textarea): refactor Textarea stories to use custom label and caption components * feat(textarea): add TextareaContext for managing textarea state * fix: format * feat(textarea): refactor TextareaInput to simplify props and remove autoSize handling * feat(textarea): remove TextareaContext and update stories to reflect new error handling * refactor(textarea): remove TextareaRoot component After removing TextareaContext, TextareaRoot became a simple wrapper div with no functionality beyond applying layout styles. This change: - Removes TextareaRoot component and its exports - Updates all Storybook stories to use plain divs with the same styling - Simplifies the component API while maintaining the same functionality Addresses reviewer feedback: https://github.com/CherryHQ/cherry-studio/pull/11260#discussion_r2580009134 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: format --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: MyPrototypeWhat <daoquqiexing@gmail.com> |
||
|---|---|---|
| .. | ||
| components | ||
| README.md | ||
| tailwind.css | ||
Stories 文档
这里存放所有组件的 Storybook stories 文件,与源码分离以保持项目结构清晰。
目录结构
stories/
├── components/
│ ├── base/ # 基础组件 stories
│ ├── display/ # 展示组件 stories
│ ├── interactive/ # 交互组件 stories
│ ├── icons/ # 图标组件 stories
│ ├── layout/ # 布局组件 stories
│ └── composite/ # 复合组件 stories
└── README.md # 本说明文件
命名约定
- 文件名格式:
ComponentName.stories.tsx - Story 标题格式:
分类/组件名,如Base/CustomTag - 导入路径:使用相对路径导入源码组件,如
../../../src/components/base/ComponentName
编写指南
每个 stories 文件应该包含:
- Default - 基本用法示例
- Variants - 不同变体/状态
- Interactive - 交互行为演示(如果适用)
- Use Cases - 实际使用场景
启动 Storybook
cd packages/ui
yarn storybook
访问 http://localhost:6006 查看组件文档。