继续沉淀筛选工具条与裁剪弹窗壳层
新增共享 PlatformFilterToolbar 收口首页分类筛选与排序工具条 将 SquareImageCropModal 收口到 UnifiedModal 并补充薄能力透传 补充组件与调用侧回归测试并更新 PlatformUiKit 收口计划与共享决策记录
This commit is contained in:
@@ -15,10 +15,14 @@ type UnifiedModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'fullscreen';
|
||||
type UnifiedModalCloseVariant = NonNullable<
|
||||
ComponentProps<typeof PlatformModalCloseButton>['variant']
|
||||
>;
|
||||
type UnifiedModalCloseIcon = ComponentProps<
|
||||
typeof PlatformModalCloseButton
|
||||
>['icon'];
|
||||
|
||||
type UnifiedModalProps = {
|
||||
open: boolean;
|
||||
title: string;
|
||||
titleId?: string;
|
||||
description?: ReactNode;
|
||||
children: ReactNode;
|
||||
footer?: ReactNode;
|
||||
@@ -32,6 +36,7 @@ type UnifiedModalProps = {
|
||||
showCloseButton?: boolean;
|
||||
closeLabel?: string;
|
||||
closeVariant?: UnifiedModalCloseVariant;
|
||||
closeIcon?: UnifiedModalCloseIcon;
|
||||
portal?: boolean;
|
||||
zIndexClassName?: string;
|
||||
overlayClassName?: string;
|
||||
@@ -81,6 +86,7 @@ function getPanelStyle(
|
||||
function UnifiedModalContent({
|
||||
open,
|
||||
title,
|
||||
titleId: titleIdProp,
|
||||
description,
|
||||
children,
|
||||
footer,
|
||||
@@ -94,6 +100,7 @@ function UnifiedModalContent({
|
||||
showCloseButton = true,
|
||||
closeLabel = '关闭',
|
||||
closeVariant,
|
||||
closeIcon,
|
||||
zIndexClassName = 'z-[90]',
|
||||
overlayClassName,
|
||||
panelClassName,
|
||||
@@ -104,8 +111,9 @@ function UnifiedModalContent({
|
||||
footerClassName,
|
||||
panelStyle,
|
||||
}: Omit<UnifiedModalProps, 'portal'>) {
|
||||
const titleId = useId();
|
||||
const generatedTitleId = useId();
|
||||
const descriptionId = useId();
|
||||
const titleId = titleIdProp ?? generatedTitleId;
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || closeDisabled || !closeOnEscape) {
|
||||
@@ -209,6 +217,7 @@ function UnifiedModalContent({
|
||||
onClick={onClose}
|
||||
disabled={closeDisabled}
|
||||
variant={closeVariant ?? (isPixel ? 'pixel' : 'platformIcon')}
|
||||
icon={closeIcon}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user