diff --git a/src/components/toaster.tsx b/src/components/toaster.tsx index 45852d9..c37d70d 100644 --- a/src/components/toaster.tsx +++ b/src/components/toaster.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; -import { CSSAttribute, setup } from 'goober'; -import CSS from 'csstype'; +import { setup } from 'goober'; import { useToaster } from '../core/use-toaster'; import { ToastBar } from './toast-bar'; @@ -14,8 +13,8 @@ const getPositionStyle = ( offset: number ): React.CSSProperties => { const top = position.includes('top'); - const verticalStyle: CSSAttribute = top ? { top: 0 } : { bottom: 0 }; - const horizontalStyle: CSSAttribute = position.includes('left') + const verticalStyle: React.CSSProperties = top ? { top: 0 } : { bottom: 0 }; + const horizontalStyle: React.CSSProperties = position.includes('left') ? { left: 0, } @@ -42,7 +41,7 @@ const getPositionStyle = ( interface ToasterProps { position?: ToastPosition; reverseOrder?: boolean; - containerStyle?: CSS.Properties; + containerStyle?: React.CSSProperties; containerClassName?: string; toastOptions?: DefaultToastOptions; diff --git a/src/core/types.ts b/src/core/types.ts index 16a1f5b..45fb72c 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -1,4 +1,4 @@ -import { Properties } from 'csstype'; +import { CSSProperties } from 'react'; export type ToastType = 'success' | 'error' | 'loading' | 'blank'; export type ToastPosition = @@ -43,7 +43,7 @@ export interface Toast { role: 'status' | 'alert'; ariaLive: 'assertive' | 'off' | 'polite'; - style?: Properties; + style?: CSSProperties; className?: string; iconTheme?: IconTheme;