@@ -5,6 +5,8 @@ import useTheme from "../useTheme";
55import useTranslatedLabels from "../useTranslatedLabels" ;
66import { FileItemProps } from "./types" ;
77import DxcIcon from "../icon/Icon" ;
8+ import DxcTooltip from "../tooltip/Tooltip" ;
9+ import DxcActionIcon from "../action-icon/ActionIcon" ;
810
911const FileItem = ( {
1012 fileName = "" ,
@@ -44,17 +46,12 @@ const FileItem = ({
4446 < DxcIcon icon = "filled_error" />
4547 </ ErrorIcon >
4648 ) }
47- < DeleteFileAction
48- onClick = { ( ) => {
49- onDelete ( fileName ) ;
50- } }
51- type = "button"
52- title = { translatedLabels . fileInput . deleteFileActionTitle }
53- aria-label = { translatedLabels . fileInput . deleteFileActionTitle }
49+ < DxcActionIcon
50+ onClick = { ( ) => onDelete ( fileName ) }
51+ icon = "close"
5452 tabIndex = { tabIndex }
55- >
56- < DxcIcon icon = "close" />
57- </ DeleteFileAction >
53+ title = { translatedLabels . fileInput . deleteFileActionTitle }
54+ />
5855 </ DxcFlex >
5956 { error && ! singleFileMode && (
6057 < ErrorMessage role = "alert" aria-live = "assertive" >
@@ -145,36 +142,6 @@ const ErrorIcon = styled.span`
145142 color: #d0011b;
146143` ;
147144
148- const DeleteFileAction = styled . button `
149- display: flex;
150- flex-wrap: wrap;
151- align-content: center;
152- justify-content: center;
153- height: 24px;
154- width: 24px;
155- font-size: 1rem;
156- font-family: ${ ( props ) => props . theme . fontFamily } ;
157- border: 1px solid transparent;
158- border-radius: 2px;
159- background-color: transparent;
160- box-shadow: 0 0 0 2px transparent;
161- padding: 3px;
162- cursor: pointer;
163- color: ${ ( props ) => props . theme . deleteFileItemColor } ;
164- font-size: 18px;
165- &:hover {
166- background-color: ${ ( props ) => props . theme . hoverDeleteFileItemBackgroundColor } ;
167- }
168- &:focus,
169- &:focus-visible {
170- outline: none;
171- box-shadow: 0 0 0 2px ${ ( props ) => props . theme . focusDeleteFileItemBorderColor } ;
172- }
173- &:active {
174- background-color: ${ ( props ) => props . theme . activeDeleteFileItemBackgroundColor } ;
175- }
176- ` ;
177-
178145const ErrorMessage = styled . span `
179146 color: ${ ( props ) => props . theme . errorMessageFontColor } ;
180147 font-family: ${ ( props ) => props . theme . errorMessageFontFamily } ;
0 commit comments