Skip to content

Commit 4ae2fa8

Browse files
committed
chore(Modal): update to 5.0.0
1 parent bfb95a2 commit 4ae2fa8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Modal/Modal.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { forwardRef, useCallback, useRef } from 'react'
22
import clsx from 'clsx'
33
import { twMerge } from 'tailwind-merge'
44

5-
import { IComponentBaseProps } from '../types'
5+
import { IComponentBaseProps, ComponentPosition } from '../types'
66

77
import ModalActions from './ModalActions'
88
import ModalBody from './ModalBody'
@@ -12,6 +12,7 @@ import ModalLegacy from './ModalLegacy'
1212
export type ModalProps = React.DialogHTMLAttributes<HTMLDialogElement> &
1313
IComponentBaseProps & {
1414
open?: boolean
15+
position?: Exclude<ComponentPosition, 'left' | 'right'> | 'start' | 'end'
1516
responsive?: boolean
1617
backdrop?: boolean
1718
ariaHidden?: boolean
@@ -22,6 +23,7 @@ const Modal = forwardRef<HTMLDialogElement, ModalProps>(
2223
{
2324
children,
2425
open,
26+
position,
2527
responsive,
2628
backdrop,
2729
ariaHidden,
@@ -35,6 +37,11 @@ const Modal = forwardRef<HTMLDialogElement, ModalProps>(
3537
'modal',
3638
clsx({
3739
'modal-open': open,
40+
'modal-end': position === 'end',
41+
'modal-start': position === 'start',
42+
'modal-top': position === 'top',
43+
'modal-middle': position === 'middle',
44+
'modal-bottom': position === 'bottom',
3845
'modal-bottom sm:modal-middle': responsive,
3946
})
4047
)

0 commit comments

Comments
 (0)