@@ -37,29 +37,6 @@ const getSemantic = (semantic: ToastPropsType["semantic"]) => {
3737 }
3838} ;
3939
40- const ContentContainer = styled . div < { loading : ToastPropsType [ "loading" ] } > `
41- display: flex;
42- align-items: center;
43- gap: ${ CoreTokens . spacing_8 } ;
44- overflow: hidden;
45-
46- ${ ( { loading } ) => ! loading && `font-size: ${ CoreTokens . type_scale_05 } ` } ;
47- > svg {
48- width: 24px;
49- height: 24px;
50- }
51- ` ;
52-
53- const Message = styled . span `
54- color: ${ CoreTokens . color_black } ;
55- font-family: ${ CoreTokens . type_sans } ;
56- font-size: ${ CoreTokens . type_scale_02 } ;
57- font-weight: ${ CoreTokens . type_semibold } ;
58- overflow: hidden;
59- text-overflow: ellipsis;
60- white-space: nowrap;
61- ` ;
62-
6340const fadeInUp = keyframes `
6441 0% {
6542 transform: translateY(100%);
@@ -95,14 +72,37 @@ const Toast = styled.output<{ semantic: ToastPropsType["semantic"]; isClosing: b
9572 gap: ${ CoreTokens . spacing_24 } ;
9673 padding: ${ CoreTokens . spacing_8 } ${ CoreTokens . spacing_12 } ;
9774 background-color: ${ ( { semantic } ) => getSemantic ( semantic ) . secondaryColor } ;
98- color: ${ ( { semantic } ) => getSemantic ( semantic ) . primaryColor } ;
9975 animation: ${ ( { isClosing } ) => ( isClosing ? fadeOutDown : fadeInUp ) } 0.3s ease forwards;
10076
10177 @media (max-width: ${ responsiveSizes . medium } rem) {
10278 max-width: 100%;
10379 }
10480` ;
10581
82+ const ContentContainer = styled . div < { loading : ToastPropsType [ "loading" ] ; semantic : ToastPropsType [ "semantic" ] } > `
83+ display: flex;
84+ align-items: center;
85+ gap: ${ CoreTokens . spacing_8 } ;
86+ overflow: hidden;
87+ color: ${ ( { semantic } ) => getSemantic ( semantic ) . primaryColor } ;
88+
89+ ${ ( { loading } ) => ! loading && `font-size: ${ CoreTokens . type_scale_05 } ` } ;
90+ > svg {
91+ width: 24px;
92+ height: 24px;
93+ }
94+ ` ;
95+
96+ const Message = styled . span `
97+ color: ${ CoreTokens . color_grey_900 } ;
98+ font-family: ${ CoreTokens . type_sans } ;
99+ font-size: ${ CoreTokens . type_scale_02 } ;
100+ font-weight: ${ CoreTokens . type_semibold } ;
101+ overflow: hidden;
102+ text-overflow: ellipsis;
103+ white-space: nowrap;
104+ ` ;
105+
106106const spinnerTheme = {
107107 spinner : {
108108 accentColor : getSemantic ( "info" ) . primaryColor ,
@@ -156,24 +156,23 @@ const DxcToast = ({
156156
157157 return (
158158 < Toast semantic = { semantic } isClosing = { isClosing } role = "status" >
159- < ContentContainer loading = { loading } >
160- < ToastIcon semantic = { semantic } icon = { icon } loading = { loading } hideSemanticIcon = { hideSemanticIcon } />
159+ < ContentContainer loading = { loading } semantic = { semantic } >
160+ < ToastIcon hideSemanticIcon = { hideSemanticIcon } icon = { icon } loading = { loading } semantic = { semantic } />
161161 < Message > { message } </ Message >
162162 </ ContentContainer >
163163 < DxcFlex alignItems = "center" gap = "0.25rem" >
164164 { action && (
165165 < DxcButton
166- semantic = { semantic }
167- mode = "tertiary"
168- size = { { height : "small" } }
169- label = { action . label }
170166 icon = { action . icon }
167+ label = { action . label }
168+ mode = "tertiary"
171169 onClick = { action . onClick }
170+ semantic = { semantic }
171+ size = { { height : "small" } }
172172 />
173173 ) }
174174 < DxcActionIcon
175175 icon = "clear"
176- title = { translatedLabels . toast . clearToastActionTitle }
177176 onClick = { ( ) => {
178177 if ( ! loading ) {
179178 clearClosingAnimationTimer ( ) ;
@@ -184,6 +183,7 @@ const DxcToast = ({
184183 onClear ( ) ;
185184 } , 300 ) ;
186185 } }
186+ title = { translatedLabels . toast . clearToastActionTitle }
187187 />
188188 </ DxcFlex >
189189 </ Toast >
0 commit comments