1
1
import { Component , ParentProps } from 'solid-js' ;
2
- import { ModalDialog } from '../modal-dialog.service' ;
2
+ import { Modal } from '../modal-dialog.service' ;
3
3
import { ModalOptions } from '../modal.types' ;
4
4
import { Content , Overlay , Portal , Root } from '@corvu/dialog' ;
5
5
@@ -10,7 +10,7 @@ interface Props extends ModalOptions, ParentProps {}
10
10
* @param options {@link ModalOptions }
11
11
* @example
12
12
* ```tsx
13
- * import { Modal , ModalHeader, ModalBody, ModalFooter, Button } from '@spuxx/solid';
13
+ * import { ModalTemplate , ModalHeader, ModalBody, ModalFooter, Button } from '@spuxx/solid';
14
14
* export const MyModal = (options) => {
15
15
* return (
16
16
* <Modal {...options}>
@@ -24,11 +24,11 @@ interface Props extends ModalOptions, ParentProps {}
24
24
* }
25
25
* ```
26
26
*/
27
- export const Modal : Component < Props > = ( options ) => {
27
+ export const ModalTemplate : Component < Props > = ( options ) => {
28
28
const { size = 'auto' , preventClose = false , onClose } = options ;
29
29
30
30
const handleContentPresentChange = ( value : boolean ) => {
31
- if ( ! value ) ModalDialog . close ( ) ;
31
+ if ( ! value ) Modal . close ( ) ;
32
32
if ( typeof onClose === 'function' ) onClose ( ) ;
33
33
} ;
34
34
@@ -42,7 +42,7 @@ export const Modal: Component<Props> = (options) => {
42
42
closeOnOutsidePointer = { ! preventClose }
43
43
onContentPresentChange = { handleContentPresentChange }
44
44
>
45
- < Portal mount = { ModalDialog . portal } forceMount = { true } >
45
+ < Portal mount = { Modal . portal } forceMount = { true } >
46
46
< Overlay class = "spx-modal-overlay" />
47
47
< Content class = "spx-modal" data-size = { size } >
48
48
{ options . children }
0 commit comments