@@ -4,6 +4,8 @@ import CSSTransition from "react-transition-group/CSSTransition";
44import { OverridableCSSTransitionProps } from "@react-md/transition" ;
55import { bem } from "@react-md/utils" ;
66
7+ import { DEFAULT_TOAST_CLASSNAMES , DEFAULT_TOAST_TIMEOUT } from "./constants" ;
8+
79export interface ToastProps
810 extends HTMLAttributes < HTMLDivElement > ,
911 Omit < OverridableCSSTransitionProps , "mountOnEnter" | "unmountOnExit" > {
@@ -33,16 +35,6 @@ export interface ToastProps
3335}
3436
3537const 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- } ;
4638
4739/**
4840 * 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(
6254 onExit,
6355 onExiting,
6456 onExited,
65- timeout = 150 ,
57+ timeout = DEFAULT_TOAST_TIMEOUT ,
6658 classNames = DEFAULT_TOAST_CLASSNAMES ,
6759 action = null ,
6860 stacked = false ,
0 commit comments