feat: unify detail side sheets

This commit is contained in:
lingniu
2026-07-19 05:38:17 +08:00
parent 7eca5ae352
commit 63b50732cb
15 changed files with 273 additions and 42 deletions

View File

@@ -0,0 +1,55 @@
import type { ReactNode } from 'react';
import {
WorkspaceSideSheet,
type WorkspaceSideSheetBadgeColor
} from './WorkspaceSideSheet';
type WorkspaceDetailSideSheetProps = {
className?: string;
visible: boolean;
ariaLabel: string;
closeLabel?: string;
title: ReactNode;
description: ReactNode;
badge?: ReactNode;
badgeColor?: WorkspaceSideSheetBadgeColor;
placement?: 'left' | 'right' | 'top' | 'bottom';
width?: string | number;
height?: string | number;
onCancel: () => void;
children: ReactNode;
};
export function WorkspaceDetailSideSheet({
className,
visible,
ariaLabel,
closeLabel,
title,
description,
badge,
badgeColor,
placement,
width,
height,
onCancel,
children
}: WorkspaceDetailSideSheetProps) {
return <WorkspaceSideSheet
className={className}
variant="detail"
visible={visible}
ariaLabel={ariaLabel}
closeLabel={closeLabel}
title={title}
description={description}
badge={badge}
badgeColor={badgeColor}
placement={placement}
width={width}
height={height}
onCancel={onCancel}
>
{children}
</WorkspaceSideSheet>;
}