Files
ai-password-manager/docs/figma-components-spec.md
richarjiang b5d4724d06 feat(docs): add comprehensive design system and AI password manager architecture
- Add complete Figma design system with color, typography, and component specifications
- Create detailed UI/UX design architecture for React Native implementation
- Include AI-specific design elements with gradients, animations, and visual language
- Add implementation guides for developers and step-by-step Figma instructions
- Configure MCP server integration for Figma design workflow
- Create SplashScreen component with AI gradient background and loading animations
2025-07-22 10:07:39 +08:00

443 lines
10 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# AI密码管理器 - Figma组件规范
## 🧩 核心组件库
### 1. 按钮组件 (Button)
#### Primary Button
```
尺寸最小宽度120px高度48px
背景Primary/500 (#0ea5e9)
圆角12px
文字白色Body/LargeSemiBold
内边距16px水平12px垂直
阴影Shadow/SM
状态变体:
- Default: Primary/500背景
- Hover: Primary/600背景
- Pressed: Primary/700背景 + 轻微缩放(0.98)
- Disabled: Gray/300背景Gray/500文字
```
#### Secondary Button
```
尺寸最小宽度120px高度48px
背景:透明
边框1px Primary/500
圆角12px
文字Primary/500Body/LargeSemiBold
内边距16px水平12px垂直
状态变体:
- Default: 透明背景Primary/500边框和文字
- Hover: Primary/50背景
- Pressed: Primary/100背景
- Disabled: Gray/300边框和文字
```
#### AI Button (特殊渐变按钮)
```
尺寸最小宽度120px高度48px
背景AI渐变 (135deg, #667eea 0%, #764ba2 100%)
圆角12px
文字白色Body/LargeSemiBold
内边距16px水平12px垂直
特效:外发光 (#667eea, 模糊8px, 扩散2px)
状态变体:
- Default: AI渐变 + 发光效果
- Hover: 渐变加深 + 发光增强
- Pressed: 缩放0.98 + 发光减弱
```
#### Icon Button
```
尺寸44×44px (最小触摸目标)
背景透明或Gray/100
圆角22px (圆形) 或 12px (圆角方形)
图标24×24px居中
颜色Gray/600 或 Primary/500
变体:
- Round: 圆形背景
- Square: 圆角方形背景
- Ghost: 无背景,仅图标
```
### 2. 输入框组件 (Input)
#### Text Input
```
尺寸宽度358px高度48px
背景:白色
边框1px Gray/300聚焦时Primary/500
圆角12px
内边距16px水平12px垂直
文字Body/MediumGray/900
占位符Body/MediumGray/400
状态变体:
- Default: Gray/300边框
- Focus: Primary/500边框 + 外发光
- Error: Security/Low边框 + 错误图标
- Disabled: Gray/100背景Gray/400文字
```
#### Password Input
```
基于Text Input增加
右侧图标区域48×48px
显示/隐藏图标:👁️ / 👁🗨24×24px
密码强度指示器底部2px高度条根据强度显示颜色
强度颜色:
- 很弱(0-20): Security/Low
- 弱(21-40): Security/Medium
- 中等(41-60): #f59e0b
- 强(61-80): Security/High
- 很强(81-100): #059669
```
#### Search Input
```
基于Text Input增加
左侧搜索图标🔍20×20px距左边16px
右侧AI图标🤖24×24pxAI渐变色
背景Gray/50 (更浅的背景)
占位符:"搜索密码或说'银行相关的密码'"
```
### 3. 卡片组件 (Card)
#### Base Card
```
背景:白色
圆角12px
阴影Shadow/MD
内边距16px
边框:无 (依靠阴影分层)
变体:
- Default: 标准阴影
- Hover: 阴影增强到Shadow/LG
- Pressed: 阴影减弱到Shadow/SM
```
#### Password Entry Card
```
基于Base Card
尺寸358×72px (紧凑版) 或 358×96px (展开版)
布局结构:
┌─[32×32px图标]─[网站名称]────────[⭐收藏]─┐
│ [用户名] │
│ [强度指示器] [标签] [使用时间] │
└─────────────────────────────────────┘
组件元素:
- 网站图标32×32px圆角6px
- 网站名称Body/LargeBoldGray/900
- 用户名Body/SmallGray/500
- 强度指示器5个圆点根据强度显示颜色
- 标签小型徽章圆角12px
- 收藏星标16×16px可切换状态
- 使用时间CaptionGray/400
```
#### Security Score Card
```
基于Base Card
尺寸358×100px (小版本) 或 358×160px (大版本)
小版本布局:
┌─[评分圆环60px]─[问题列表]─┐
│ │
└────────────────────────┘
大版本布局:
┌─────────────────────────┐
│ [评分圆环120px] │
│ 居中显示 │
└─────────────────────────┘
评分圆环:
- 外径60px或120px
- 线宽4px或8px
- 背景色Gray/200
- 进度色:根据评分显示渐变
- 中心数字H2或H1样式
- 状态文字Body/Small或H3样式
```
#### AI Suggestion Card
```
基于Base Card特殊样式
背景AI渐变 (135deg, #667eea 0%, #764ba2 100%)
文字:全部白色
圆角16px (更大圆角)
外发光AI/Glow效果
内容结构:
- 标题:💡 AI 建议Body/LargeBold
- 建议列表:• 开头的要点Body/Medium
- 底部装饰:微妙的粒子动画效果
```
### 4. 徽章组件 (Badge)
#### Status Badge
```
基础尺寸自适应宽度高度24px
圆角12px
内边距8px水平4px垂直
文字CaptionBold
颜色变体:
- Success: Security/High背景白色文字
- Warning: Security/Medium背景白色文字
- Error: Security/Low背景白色文字
- Info: Primary/500背景白色文字
- Neutral: Gray/500背景白色文字
```
#### Tag Badge
```
基础尺寸自适应宽度高度28px
圆角14px
内边距12px水平6px垂直
文字Body/SmallMedium
样式变体:
- Primary: Primary/100背景Primary/700文字
- Secondary: Gray/100背景Gray/700文字
- AI: AI渐变背景白色文字 + AI图标
```
#### AI Badge (特殊标识)
```
尺寸32×16px
背景AI渐变
圆角8px
文字:"AI"10pxBold白色
外发光微妙的AI色发光
用途标识AI增强功能
```
### 5. 进度组件 (Progress)
#### Linear Progress
```
容器宽度100%高度4px
背景Gray/200
圆角2px
进度条根据类型显示不同颜色圆角2px
颜色类型:
- Default: Primary/500
- Success: Security/High
- Warning: Security/Medium
- Error: Security/Low
```
#### Circular Progress
```
外径60px或120px
线宽4px或8px
背景圆环Gray/200
进度圆环:根据进度值显示颜色
进度颜色映射:
- 0-20%: Security/Low
- 21-40%: Security/Medium
- 41-60%: #f59e0b
- 61-80%: Security/High
- 81-100%: #059669
中心内容:
- 数值H2或H1样式
- 单位Body/SmallGray/500
- 状态Body/Small或H3样式
```
#### Password Strength Indicator
```
容器宽度100px高度16px
布局5个圆点间距4px
圆点直径8px
强度显示:
- 很弱(0-20): ●○○○○ Security/Low
- 弱(21-40): ●●○○○ Security/Medium
- 中等(41-60): ●●●○○ #f59e0b
- 强(61-80): ●●●●○ Security/High
- 很强(81-100): ●●●●● #059669
```
### 6. 开关组件 (Switch)
#### Toggle Switch
```
轨道尺寸44×24px
轨道圆角12px
滑块尺寸20×20px
滑块圆角10px (圆形)
滑块边距2px
状态样式:
- 关闭: Gray/300轨道白色滑块左对齐
- 开启: Primary/500轨道白色滑块右对齐
- 禁用: Gray/200轨道Gray/300滑块
动画:
- 过渡时长200ms
- 缓动函数ease-in-out
- 滑块移动 + 轨道颜色变化
```
### 7. 导航组件 (Navigation)
#### Top Navigation Bar
```
尺寸390×76px (44px状态栏 + 32px内容)
背景:模糊白色 (backdrop-filter: blur(20px))
边框底部1px Gray/100
布局:
- 左侧返回按钮或Logo + 标题
- 右侧:操作图标 (通知、设置、更多)
- 内边距16px水平
标题样式H3Gray/900SemiBold
图标尺寸24×24pxGray/600
```
#### Tab Bar
```
尺寸390×83px (49px内容 + 34px安全区域)
背景:模糊白色
边框顶部1px Gray/100
标签项:
- 尺寸每个约78px宽
- 图标24×24px
- 文字Caption居中
- 间距图标和文字4px
状态:
- 未选中Gray/400图标Gray/500文字
- 选中Primary/500图标Primary/500文字
- 激活动画:图标轻微缩放 + 颜色过渡
```
### 8. 模态组件 (Modal)
#### Bottom Sheet
```
背景:白色
圆角顶部16px
阴影Shadow/XL
拖拽指示器36×4pxGray/300圆角2px
动画:
- 进入从底部滑入300ms ease-out
- 退出向底部滑出250ms ease-in
- 背景遮罩黑色透明度0.4
```
#### Alert Dialog
```
容器最大宽度320px
背景:白色
圆角16px
阴影Shadow/XL
内边距24px
布局:
- 标题H3Gray/900居中
- 内容Body/MediumGray/600居中
- 按钮区水平排列间距12px
按钮样式:
- 主要操作Primary Button
- 次要操作Secondary Button
```
### 9. 列表组件 (List)
#### List Item
```
尺寸358×48px (标准) 或 358×64px (扩展)
背景:白色
分割线底部1px Gray/100
布局:
- 左侧:图标区域 (可选)
- 中间:标题 + 副标题 (可选)
- 右侧:值/开关/箭头
样式:
- 标题Body/MediumGray/900
- 副标题Body/SmallGray/500
- 值Body/MediumGray/600
- 箭头16×16pxGray/400
```
### 10. 加载组件 (Loading)
#### Skeleton Screen
```
基础形状圆角矩形Gray/200背景
动画:从左到右的光泽扫过效果
时长1.5s,无限循环
常用尺寸:
- 文字行宽度100%高度16px
- 标题宽度60%高度24px
- 头像48×48px圆形
- 卡片358×72px矩形
```
#### Loading Spinner
```
尺寸24×24px (小) 或 32×32px (大)
样式圆环线宽2px或3px
颜色Primary/500
动画360度旋转1s线性无限循环
AI版本
- 颜色AI渐变
- 外发光微妙的AI色发光
- 脉冲效果:配合旋转的透明度变化
```
## 🎨 组件使用指南
### 组件命名规范
```
组件类型/变体/状态
例如Button/Primary/Default
Card/PasswordEntry/Hover
Badge/AI/Default
```
### 组件状态管理
每个交互组件都应包含以下状态:
- Default (默认)
- Hover (悬停) - 仅Web端
- Pressed (按下)
- Disabled (禁用)
- Loading (加载中) - 如适用
### 响应式适配
- 小屏 (375px): 组件宽度减少16px
- 大屏 (430px): 组件宽度增加40px
- 间距保持8px网格对齐
### 无障碍支持
- 最小触摸目标44×44px
- 颜色对比度符合WCAG AA标准
- 状态指示:不仅依赖颜色,还有图标/文字
- 语义标记:为屏幕阅读器提供适当标签
这个组件规范确保了整个AI密码管理器界面的一致性和可用性同时体现了安全、智能、未来感的设计理念。