继续收口轻量共享按钮

将 PlatformTagEditor 标签删除入口改为复用共享图标按钮

将角色选择页重复返回按钮收口到共享暗色动作按钮壳

补充 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
2026-06-11 04:25:59 +08:00
parent a8012109ae
commit 1b89611c9a
6 changed files with 58 additions and 26 deletions

View File

@@ -23,7 +23,18 @@ test('renders tags and removes a tag', () => {
/>,
);
fireEvent.click(screen.getByRole('button', { name: '删除标签 山海' }));
const removeButton = screen.getByRole('button', { name: '删除标签 山海' });
expect(removeButton.className).toContain('platform-icon-button');
expect(removeButton.className).toContain('h-3.5');
expect(removeButton.className).toContain('w-3.5');
expect(removeButton.className).toContain('border-0');
expect(removeButton.className).toContain('bg-transparent');
expect(removeButton.className).toContain('p-0');
expect(removeButton.className).toContain('opacity-70');
expect(removeButton.getAttribute('title')).toBe('删除标签');
fireEvent.click(removeButton);
expect(onChange).toHaveBeenCalledWith(['机关']);
});

View File

@@ -131,20 +131,18 @@ export function PlatformTagEditor({
].join(' ')}
>
{tag}
<button
type="button"
<PlatformIconButton
disabled={disabled}
label={`删除标签 ${tag}`}
title="删除标签"
onClick={() =>
onChange(
normalizedTags.filter((currentTag) => currentTag !== tag),
)
}
className="rounded-full opacity-70 transition hover:opacity-100 disabled:opacity-45"
aria-label={`删除标签 ${tag}`}
title="删除标签"
>
<X className="h-3.5 w-3.5" />
</button>
className="h-3.5 w-3.5 border-0 bg-transparent p-0 opacity-70 shadow-none transition hover:translate-y-0 hover:bg-transparent disabled:opacity-45"
icon={<X className="h-3.5 w-3.5" />}
/>
</span>
))}
{normalizedTags.length <= 0 ? (