@@ -13,53 +13,59 @@ type IToast = {
1313export const SuccessToast = ( { message, onClose, toastId } : IToast ) => (
1414 < button
1515 className = { classNames (
16- "data-testid-toast-success bg-default dark:bg-inverted text-emphasis dark:text-inverted shadow-elevation-low border-subtle mb-2 flex h-auto space-x-2 rounded-lg border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
16+ "data-testid-toast-success bg-default dark:bg-inverted text-emphasis dark:text-inverted shadow-elevation-low border-subtle mb-2 flex h-auto items-center justify-between space-x-2 rounded-lg border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
1717 ) }
1818 onClick = { ( ) => onClose ( toastId ) } >
19- < span className = "mt-0.5 " >
20- < Icon name = "check" className = "h-4 w -4" />
19+ < span className = "mt-1 " >
20+ < Icon name = "check" className = "size -4" />
2121 </ span >
22- < p data-testid = "toast-success" className = "m-0 w-full text-left" >
23- { message }
24- </ p >
25- < span className = "mt-0.5" >
26- < Icon name = "x" className = "h-4 w-4 hover:cursor-pointer" />
22+ < div className = "flex items-center" >
23+ < p data-testid = "toast-success" className = "m-0 w-full text-left" >
24+ { message }
25+ </ p >
26+ </ div >
27+ < span className = "mt-1" >
28+ < Icon name = "x" className = "size-4 hover:cursor-pointer" />
2729 </ span >
2830 </ button >
2931) ;
3032
3133export const ErrorToast = ( { message, onClose, toastId } : IToast ) => (
3234 < button
3335 className = { classNames (
34- "animate-fade-in-up bg-semantic-error-subtle text-semantic-error shadow-elevation-low border-semantic-error-subtle mb-2 flex h-auto space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
36+ "animate-fade-in-up bg-semantic-error-subtle text-semantic-error shadow-elevation-low border-semantic-error-subtle mb-2 flex h-auto items-center justify-between space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
3537 ) }
3638 onClick = { ( ) => onClose ( toastId ) } >
37- < span className = "mt-0.5 " >
38- < Icon name = "info" className = "text-semantic-error h-4 w -4" />
39+ < span className = "mt-1 " >
40+ < Icon name = "info" className = "text-semantic-error size -4" />
3941 </ span >
40- < p data-testid = "toast-error" className = "m-0 w-full text-left" >
41- { message }
42- </ p >
43- < span className = "mt-0.5" >
44- < Icon name = "x" className = "text-semantic-error h-4 w-4 hover:cursor-pointer" />
42+ < div className = "flex items-center" >
43+ < p data-testid = "toast-error" className = "m-0 w-full text-left" >
44+ { message }
45+ </ p >
46+ </ div >
47+ < span className = "mt-1" >
48+ < Icon name = "x" className = "text-semantic-error size-4 hover:cursor-pointer" />
4549 </ span >
4650 </ button >
4751) ;
4852
4953export const WarningToast = ( { message, onClose, toastId } : IToast ) => (
5054 < button
5155 className = { classNames (
52- "animate-fade-in-up bg-semantic-attention-subtle text-semantic-attention shadow-elevation-low border-semantic-attention-subtle mb-2 flex h-auto space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
56+ "animate-fade-in-up bg-semantic-attention-subtle text-semantic-attention shadow-elevation-low border-semantic-attention-subtle mb-2 flex h-auto items-center justify-between space-x-2 rounded-md border px-3 py-2.5 text-sm font-semibold rtl:space-x-reverse md:max-w-sm"
5357 ) }
5458 onClick = { ( ) => onClose ( toastId ) } >
55- < span className = "mt-0.5 " >
56- < Icon name = "info" className = "text-semantic-attention h-4 w -4" />
59+ < span className = "mt-1 " >
60+ < Icon name = "info" className = "text-semantic-attention size -4" />
5761 </ span >
58- < p data-testid = "toast-warning" className = "m-0 w-full text-left" >
59- { message }
60- </ p >
61- < span className = "mt-0.5" >
62- < Icon name = "x" className = "text-semantic-attention h-4 w-4 hover:cursor-pointer" />
62+ < div className = "flex items-center" >
63+ < p data-testid = "toast-warning" className = "m-0 w-full text-left" >
64+ { message }
65+ </ p >
66+ </ div >
67+ < span className = "mt-1" >
68+ < Icon name = "x" className = "text-semantic-attention size-4 hover:cursor-pointer" />
6369 </ span >
6470 </ button >
6571) ;
@@ -71,7 +77,6 @@ type ToastVariants = "success" | "warning" | "error";
7177export function showToast (
7278 message : string ,
7379 variant : ToastVariants ,
74- // Options or duration (duration for backwards compatibility reasons)
7580 options : number | ExternalToast = TOAST_VISIBLE_DURATION
7681) {
7782 const _options : ExternalToast = typeof options === "number" ? { duration : options } : options ;
0 commit comments