@@ -73,52 +73,37 @@ export interface Overlay2Props extends OverlayProps, React.RefAttributes<Overlay
7373 childRefs ?: Record < string , React . RefObject < HTMLElement > > ;
7474}
7575
76- export const OVERLAY2_DEFAULT_PROPS = {
77- autoFocus : true ,
78- backdropProps : { } ,
79- canEscapeKeyClose : true ,
80- canOutsideClickClose : true ,
81- enforceFocus : true ,
82- hasBackdrop : true ,
83- isOpen : false ,
84- lazy : hasDOMEnvironment ( ) ,
85- shouldReturnFocusOnClose : true ,
86- transitionDuration : 300 ,
87- transitionName : Classes . OVERLAY ,
88- usePortal : true ,
89- } ;
90-
9176/**
9277 * Overlay2 component.
9378 *
9479 * @see https://blueprintjs.com/docs/#core/components/overlay2
9580 */
9681export const Overlay2 = forwardRef < OverlayInstance , Overlay2Props > ( ( props , forwardedRef ) => {
9782 const {
98- autoFocus,
83+ autoFocus = true ,
9984 backdropClassName,
100- backdropProps,
101- canEscapeKeyClose,
102- canOutsideClickClose,
85+ backdropProps = { } ,
86+ canEscapeKeyClose = true ,
87+ canOutsideClickClose = true ,
10388 childRef,
10489 childRefs,
10590 children,
10691 className,
107- enforceFocus,
108- hasBackdrop,
109- isOpen,
110- lazy,
92+ enforceFocus = true ,
93+ hasBackdrop = true ,
94+ isOpen = false ,
95+ lazy = hasDOMEnvironment ( ) ,
11196 onClose,
11297 onClosed,
11398 onClosing,
11499 onOpened,
115100 onOpening,
116101 portalClassName,
117102 portalContainer,
118- shouldReturnFocusOnClose,
119- transitionDuration,
120- transitionName,
121- usePortal,
103+ shouldReturnFocusOnClose = true ,
104+ transitionDuration = 300 ,
105+ transitionName = Classes . OVERLAY ,
106+ usePortal = true ,
122107 } = props ;
123108
124109 useOverlay2Validation ( props ) ;
@@ -672,8 +657,7 @@ export const Overlay2 = forwardRef<OverlayInstance, Overlay2Props>((props, forwa
672657 return transitionGroup ;
673658 }
674659} ) ;
675- // eslint-disable-next-line @typescript-eslint/no-deprecated
676- Overlay2 . defaultProps = OVERLAY2_DEFAULT_PROPS ;
660+
677661Overlay2 . displayName = `${ DISPLAYNAME_PREFIX } .Overlay2` ;
678662
679663function useOverlay2Validation ( { childRef, childRefs, children } : Overlay2Props ) {
0 commit comments