收口拼图首访按钮
为 PlatformActionButton 增加琥珀实心 accent tone 将拼图首访生成按钮迁移到 PlatformActionButton 将拼图首访登录按钮迁移到 PlatformActionButton 将拼图首访跳过按钮迁移到 PlatformActionButton 补充按钮组件和首访按钮断言 更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
@@ -74,3 +74,19 @@ test('supports editor dark action surface', () => {
|
||||
expect(button.className).toContain('bg-amber-500/20');
|
||||
expect(button.className).toContain('text-[10px]');
|
||||
});
|
||||
|
||||
test('supports accent action tone', () => {
|
||||
render(
|
||||
<PlatformActionButton surface="editorDark" tone="accent" size="lg" fullWidth>
|
||||
生成
|
||||
</PlatformActionButton>,
|
||||
);
|
||||
|
||||
const button = screen.getByRole('button', { name: '生成' });
|
||||
|
||||
expect(button.className).toContain('platform-action-button--accent');
|
||||
expect(button.className).toContain('bg-amber-200');
|
||||
expect(button.className).toContain('text-slate-950');
|
||||
expect(button.className).toContain('h-12');
|
||||
expect(button.className).toContain('w-full');
|
||||
});
|
||||
|
||||
@@ -60,3 +60,18 @@ test('builds editor dark action button class names', () => {
|
||||
expect(className).toContain('text-[10px]');
|
||||
expect(className).toContain('rounded-full');
|
||||
});
|
||||
|
||||
test('builds accent action button class names', () => {
|
||||
const className = getPlatformActionButtonClassName({
|
||||
surface: 'editorDark',
|
||||
tone: 'accent',
|
||||
size: 'lg',
|
||||
fullWidth: true,
|
||||
});
|
||||
|
||||
expect(className).toContain('platform-action-button--accent');
|
||||
expect(className).toContain('bg-amber-200');
|
||||
expect(className).toContain('text-slate-950');
|
||||
expect(className).toContain('h-12');
|
||||
expect(className).toContain('w-full');
|
||||
});
|
||||
|
||||
@@ -4,7 +4,8 @@ export type PlatformActionButtonTone =
|
||||
| 'ghost'
|
||||
| 'danger'
|
||||
| 'success'
|
||||
| 'warning';
|
||||
| 'warning'
|
||||
| 'accent';
|
||||
export type PlatformActionButtonSurface = 'platform' | 'profile' | 'editorDark';
|
||||
export type PlatformActionButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
||||
export type PlatformActionButtonShape = 'default' | 'pill';
|
||||
@@ -20,6 +21,8 @@ const PLATFORM_ACTION_BUTTON_PLATFORM_TONE_CLASS: Record<
|
||||
danger: 'platform-button platform-button--danger',
|
||||
success: 'platform-button platform-button--primary',
|
||||
warning: 'platform-button platform-button--secondary',
|
||||
accent:
|
||||
'platform-action-button platform-action-button--accent border border-amber-200/70 bg-amber-200 text-slate-950 hover:bg-amber-100',
|
||||
};
|
||||
|
||||
const PLATFORM_ACTION_BUTTON_PROFILE_TONE_CLASS: Record<
|
||||
@@ -32,6 +35,8 @@ const PLATFORM_ACTION_BUTTON_PROFILE_TONE_CLASS: Record<
|
||||
danger: 'platform-button platform-button--danger',
|
||||
success: 'platform-primary-button',
|
||||
warning: 'platform-button platform-button--secondary',
|
||||
accent:
|
||||
'platform-action-button platform-action-button--accent border border-amber-200/70 bg-amber-200 text-slate-950 hover:bg-amber-100',
|
||||
};
|
||||
|
||||
const PLATFORM_ACTION_BUTTON_EDITOR_DARK_TONE_CLASS: Record<
|
||||
@@ -50,6 +55,8 @@ const PLATFORM_ACTION_BUTTON_EDITOR_DARK_TONE_CLASS: Record<
|
||||
'platform-action-button platform-action-button--editor-dark border border-emerald-300/35 bg-emerald-400 text-slate-950 hover:bg-emerald-300',
|
||||
warning:
|
||||
'platform-action-button platform-action-button--editor-dark border border-amber-300/30 bg-amber-500/20 text-amber-50 hover:bg-amber-500/25',
|
||||
accent:
|
||||
'platform-action-button platform-action-button--accent border border-amber-200/70 bg-amber-200 text-slate-950 hover:bg-amber-100',
|
||||
};
|
||||
|
||||
const PLATFORM_ACTION_BUTTON_SIZE_CLASS: Record<
|
||||
|
||||
Reference in New Issue
Block a user