@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and PandaCSS
44 lines (41 loc) • 1.54 kB
TypeScript
import { DialogContentProps } from '@radix-ui/react-dialog';
import { AllHTMLAttributes, ReactNode } from 'react';
import { ButtonProps } from '../Button/Button.types.js';
import { PaperProps } from '../Paper/Paper.types.js';
import { Positions } from './Dialog.constants.js';
import '@snowball-tech/design-tokens/dist/web/typescript/constants';
import '../constants-QFINMz1u.js';
import '../Button/Button.constants.js';
import '../Paper/Paper.constants.js';
import '../Typography/Typography.constants.js';
type CombinedRefs = {
container: HTMLDivElement | null;
content: HTMLDivElement | null;
trigger: HTMLElement | null;
};
interface DialogProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'onToggle'> {
children: ReactNode;
closeButtonLabel?: string;
condensed?: boolean;
contentClassName?: string;
defaultOpen?: boolean;
disabled?: boolean;
dismissable?: boolean;
fullWidth?: boolean;
modal?: boolean;
open?: boolean;
overlayStyle?: 'dark' | 'light' | 'none';
position?: `${Positions}`;
root?: Partial<AllHTMLAttributes<HTMLDivElement>>;
scrollbarOnHover?: boolean;
title?: string;
trigger?: ReactNode;
wrapper?: Partial<PaperProps>;
onClose?: () => void;
onDismiss?: ButtonProps['onClick'];
onInteractOutside?: DialogContentProps['onInteractOutside'];
onOpen?: () => void;
onPointerDownOutside?: DialogContentProps['onPointerDownOutside'];
onToggle?: (open: boolean) => void;
}
export type { CombinedRefs, DialogProps };