@@ -4,6 +4,8 @@ import CSSTransition from "react-transition-group/CSSTransition";
4
4
import { OverridableCSSTransitionProps } from "@react-md/transition" ;
5
5
import { bem } from "@react-md/utils" ;
6
6
7
+ import { DEFAULT_TOAST_CLASSNAMES , DEFAULT_TOAST_TIMEOUT } from "./constants" ;
8
+
7
9
export interface ToastProps
8
10
extends HTMLAttributes < HTMLDivElement > ,
9
11
Omit < OverridableCSSTransitionProps , "mountOnEnter" | "unmountOnExit" > {
@@ -33,16 +35,6 @@ export interface ToastProps
33
35
}
34
36
35
37
const block = bem ( "rmd-toast" ) ;
36
- const DEFAULT_TOAST_CLASSNAMES = {
37
- appear : "rmd-toast--enter" ,
38
- appearActive : "rmd-toast--enter-active" ,
39
- enter : "rmd-toast--enter" ,
40
- enterActive : "rmd-toast--enter-active" ,
41
- enterDone : "" ,
42
- exit : "rmd-toast--exit" ,
43
- exitActive : "rmd-toast--exit-active" ,
44
- exitDone : "" ,
45
- } ;
46
38
47
39
/**
48
40
* This is a very low-level component that can be used to animate a new toast in
@@ -62,7 +54,7 @@ const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(
62
54
onExit,
63
55
onExiting,
64
56
onExited,
65
- timeout = 150 ,
57
+ timeout = DEFAULT_TOAST_TIMEOUT ,
66
58
classNames = DEFAULT_TOAST_CLASSNAMES ,
67
59
action = null ,
68
60
stacked = false ,
0 commit comments