收口前端平台组件库能力

新增 PlatformUiKit 通用弹窗、按钮、状态、空态、媒体、表单和标签等公共组件
迁移结果页、创作工作台、认证入口、RPG 暗色面板和运行态弹窗的重复 UI chrome
补充组件测试、页面回归测试、技术文档和 Hermes 共享决策记录
This commit is contained in:
2026-06-10 10:24:18 +08:00
parent a4ee6ff698
commit 1ad25e30f8
226 changed files with 23364 additions and 7825 deletions

View File

@@ -0,0 +1,68 @@
export type PlatformPillBadgeTone =
| 'muted'
| 'neutral'
| 'neutralSolid'
| 'lightOverlay'
| 'success'
| 'warning'
| 'danger'
| 'cool'
| 'profile'
| 'profileAccent'
| 'darkSoft'
| 'darkNeutral'
| 'darkSky'
| 'darkEmerald'
| 'darkAmber'
| 'darkRose';
export type PlatformPillBadgeSize = 'xxs' | 'xs' | 'sm';
const PLATFORM_PILL_BADGE_TONE_CLASS: Record<PlatformPillBadgeTone, string> = {
muted:
'border-[var(--platform-subpanel-border)] bg-[var(--platform-subpanel-fill)] text-[var(--platform-text-soft)]',
neutral:
'border-[var(--platform-subpanel-border)] bg-white/72 text-[var(--platform-text-base)]',
neutralSolid:
'border-transparent bg-[var(--platform-neutral-bg)] text-[var(--platform-neutral-text)]',
lightOverlay: 'border-white/30 bg-white/24 text-current',
success: 'border-emerald-200 bg-emerald-50 text-emerald-700',
warning:
'border-[var(--platform-warm-border)] bg-[var(--platform-warm-bg)] text-[var(--platform-warm-text)]',
danger:
'border-[var(--platform-button-danger-border)] bg-[var(--platform-button-danger-fill)] text-[var(--platform-button-danger-text)]',
cool: 'border-[var(--platform-cool-border)] bg-[var(--platform-cool-bg)] text-[var(--platform-cool-text)]',
profile: 'border-rose-100 bg-rose-50 text-zinc-600',
profileAccent: 'border-rose-100 bg-rose-50 text-[#ff4056]',
darkSoft: 'border-white/10 bg-white/6 text-zinc-100',
darkNeutral: 'border-white/10 bg-black/20 text-zinc-200',
darkSky: 'border-sky-300/20 bg-sky-500/10 text-sky-100',
darkEmerald: 'border-emerald-300/20 bg-emerald-500/10 text-emerald-100',
darkAmber: 'border-amber-300/20 bg-amber-500/10 text-amber-100',
darkRose: 'border-rose-300/20 bg-rose-500/10 text-rose-100',
};
const PLATFORM_PILL_BADGE_SIZE_CLASS: Record<PlatformPillBadgeSize, string> = {
xxs: 'px-2.5 py-1 text-[10px]',
xs: 'px-2.5 py-0.5 text-[11px]',
sm: 'px-3 py-1 text-xs',
};
export function getPlatformPillBadgeClassName({
tone = 'neutral',
size = 'sm',
className,
}: {
tone?: PlatformPillBadgeTone;
size?: PlatformPillBadgeSize;
className?: string;
} = {}) {
return [
'inline-flex items-center gap-1 rounded-full border font-black',
PLATFORM_PILL_BADGE_SIZE_CLASS[size],
PLATFORM_PILL_BADGE_TONE_CLASS[tone],
className,
]
.filter(Boolean)
.join(' ');
}