Skip to content

feat: 左侧组件分类改为二级菜单 + 对齐 AntD 补充缺少的组件#3

Merged
leno23 merged 5 commits into
mainfrom
cursor/sidebar-and-antd-components-4f38
Apr 12, 2026
Merged

feat: 左侧组件分类改为二级菜单 + 对齐 AntD 补充缺少的组件#3
leno23 merged 5 commits into
mainfrom
cursor/sidebar-and-antd-components-4f38

Conversation

@leno23
Copy link
Copy Markdown
Owner

@leno23 leno23 commented Apr 12, 2026

概述

完成两项任务:

  1. 左侧组件分类改为二级菜单 — 每个分类下展示每个组件,点击后右侧只展示该组件的使用说明和配置说明
  2. 对齐 AntD 实现缺少的组件 — 新增 20 个常用组件

Bug 修复

第一轮(497eabc)

受控/非受控、Carousel 自动播放、CountDown onFinish、Splitter 拖拽、Image src 切换、InputOTP 等 — 见此前 PR 说明。

第二轮(47085d4)

区域 问题 修复
useClickOutside / useEscapeKey handler 在依赖数组中,父组件每次渲染换函数 → 反复解绑/重绑监听 useEffect 内用 ref 保存最新 handler,effect 仅依赖 [enabled, ref]
Modal(间接) 同上,点击外部/Escape 监听不稳定 同上
Drawer 无 Escape 关闭 useEscapeKey(() => onClose?.(), open)
Toast onClose 在依赖里,父组件内联函数导致定时器不断重置,Toast 永不自动消失 onClose 经 ref 调用;useEffect 依赖仅 [duration, open]
Dropdown / Popover 受控 open 时仍改内部 state;点击外部无法关闭;onClose 在打开时重复触发 区分受控;setOpen 仅在状态变化时调用 onOpen/onCloseuseClickOutside + useEscapeKeysetRef 合并外部 ref
Tooltip disabled 从 false→true 时 tooltip 可能仍显示 useEffectdisabled 为 true 时 setOpen(false)

新增 packages/ui/src/utils/setRef.ts 用于合并 callback ref 与内部 ref。

验证

  • npm run lint:ui / npm run typecheck:ui / npm run build:ui — 全部通过
Open in Web Open in Cursor 

cursoragent and others added 5 commits April 12, 2026 12:27
Co-authored-by: 吴杨帆 <leno23@users.noreply.github.com>
…ace, Divider, SplitPane)

Co-authored-by: 吴杨帆 <leno23@users.noreply.github.com>
Add VitePress markdown docs with LivePlayground examples and API tables for:
Input, InputNumber, AutoComplete, Select, Checkbox, Radio, Switch,
DatePicker, TimePicker, Slider, Rate, Upload, Form, Calendar,
Transfer, Cascader, TreeSelect, ColorPicker, Segmented, Mentions

Co-authored-by: 吴杨帆 <leno23@users.noreply.github.com>
…avigation)

Co-authored-by: 吴杨帆 <leno23@users.noreply.github.com>
…two-level menu

New components (matching Ant Design API patterns):
- Layout: Flex
- Form: AutoComplete, InputNumber, TimePicker
- Feedback: Alert, Skeleton, Popconfirm, Spin
- Data: List, Carousel, Image
- Navigation: FloatButton

Sidebar changes:
- Restructured from flat category links to two-level collapsible menu
- Each component now has its own dedicated page with demo and API docs
- Removed old single-page-per-category docs
- Updated overview page with complete component listing

Co-authored-by: 吴杨帆 <leno23@users.noreply.github.com>
@leno23 leno23 marked this pull request as ready for review April 12, 2026 13:50
@leno23 leno23 merged commit 0f4b1a1 into main Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants