收口统一弹窗关闭按钮

新增 PlatformModalCloseButton pixel 变体承接像素风关闭入口

将 UnifiedModal 头部关闭按钮迁移到 PlatformModalCloseButton

补充平台态和像素态关闭按钮测试

更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
2026-06-10 13:19:55 +08:00
parent d5b3133c8d
commit e22cb1d06b
6 changed files with 50 additions and 15 deletions

View File

@@ -1,4 +1,3 @@
import { X } from 'lucide-react';
import {
type CSSProperties,
type ReactNode,
@@ -8,6 +7,7 @@ import {
import { createPortal } from 'react-dom';
import { getNineSliceStyle, UI_CHROME } from '../../uiAssets';
import { PlatformModalCloseButton } from './PlatformModalCloseButton';
type UnifiedModalVariant = 'platform' | 'pixel';
type UnifiedModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'fullscreen';
@@ -145,10 +145,6 @@ function UnifiedModalContent({
? 'flex flex-wrap items-center justify-end gap-3 border-t border-white/10 px-4 py-3 sm:px-5 sm:py-4'
: 'flex flex-wrap items-center justify-end gap-3 border-t border-[var(--platform-subpanel-border)] px-4 py-4 sm:px-5';
const closeButtonClasses = isPixel
? 'rounded-full border border-white/10 bg-black/20 p-2 text-zinc-400 transition-colors hover:text-white disabled:cursor-not-allowed disabled:opacity-45'
: 'platform-icon-button disabled:cursor-not-allowed disabled:opacity-45';
return (
<div
className={joinClassNames(overlayClasses, zIndexClassName, overlayClassName)}
@@ -183,15 +179,12 @@ function UnifiedModalContent({
) : null}
</div>
{showCloseButton ? (
<button
type="button"
aria-label={closeLabel}
<PlatformModalCloseButton
label={closeLabel}
onClick={onClose}
disabled={closeDisabled}
className={closeButtonClasses}
>
<X className="h-4 w-4" />
</button>
variant={isPixel ? 'pixel' : 'platformIcon'}
/>
) : null}
</div>
<div className={joinClassNames(bodyClasses, bodyClassName)}>