import { type ComponentPropsWithRef, type ElementType } from 'react'; import { type AlignmentX } from '../constants'; import { type ButtonColor, type ButtonSize } from './button'; import { type IconBoxSize } from './icon'; import { type ChildrenProps, type ClickEvent, type OmittedExtendedUnsafeStyleProps, type SpiritButtonElementProps, type SpiritDialogElementProps, type StyleProps } from './shared'; export type DrawerAlignmentXType = (typeof AlignmentX)['LEFT' | 'RIGHT']; export type DrawerPanelElementType = 'aside' | 'form'; export type DrawerPanelHandlingProps = { isOpen: boolean; onClose: (event: ClickEvent) => void; closeOnBackdropClick?: boolean; closeOnEscapeKeyDown?: boolean; }; export interface DrawerCloseButtonProps extends Omit { color?: ButtonColor; iconBoxSize?: IconBoxSize; label?: string; size?: ButtonSize; } export type DrawerPanelBaseProps = { elementType?: E; } & ChildrenProps & StyleProps; export type DrawerPanelProps = DrawerPanelBaseProps & OmittedExtendedUnsafeStyleProps, keyof DrawerPanelBaseProps>; export interface DrawerBaseProps extends Omit, DrawerPanelHandlingProps, ChildrenProps { alignmentX?: DrawerAlignmentXType; id: string; } export interface SpiritDrawerProps extends DrawerBaseProps { }