-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathindex.d.ts
More file actions
53 lines (48 loc) · 1.68 KB
/
Copy pathindex.d.ts
File metadata and controls
53 lines (48 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import type { FadeInOutProps, SlideProps, Box, BoxProps, PortalProps } from '@semcore/base-components';
import type Button from '@semcore/button';
import type { PropGetterFn, Intergalactic } from '@semcore/core';
import type { NSText } from '@semcore/typography';
import type React from 'react';
export type ModalProps = PortalProps &
BoxProps &
FadeInOutProps & {
/** Duration of animation, ms
* @default 200
*/
duration?: number;
/** This property is responsible for the visibility of the modal window */
visible?: boolean;
/** Function called when the component is hidden */
onClose?: (
trigger: 'onOutsideClick' | 'onCloseClick' | 'onEscape',
e?: React.MouseEvent | React.KeyboardEvent,
) => void;
/** Displaying the close button(x) in the upper-right corner of the modal dialog
* @default true
* */
closable?: boolean;
/**
* Setting `true` disables mechanism that hides document body scrollbar when Modal is visible
* @default false
*/
disablePreventScroll?: boolean;
/** Specifies the locale for i18n support */
locale?: string;
/**
* Props for render modal without background and paddings. Useful in carousel for example
*/
ghost?: boolean;
};
export type WindowProps = BoxProps & SlideProps & {};
export type ModalContext = {
getOverlayProps: PropGetterFn;
getWindowProps: PropGetterFn;
getCloseProps: PropGetterFn;
};
declare const Modal: Intergalactic.Component<'div', ModalProps, ModalContext> & {
Window: Intergalactic.Component<'div', WindowProps>;
Overlay: typeof Box;
Close: typeof Button;
Title: Intergalactic.Component<'div', NSText.Props>;
};
export default Modal;