Merge branch '18559-user-profile' into main. Closes #18559
[arvados-workbench2.git] / src / components / icon / icon.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React from 'react';
6 import { Badge, Tooltip } from '@material-ui/core';
7 import Add from '@material-ui/icons/Add';
8 import ArrowBack from '@material-ui/icons/ArrowBack';
9 import ArrowDropDown from '@material-ui/icons/ArrowDropDown';
10 import BubbleChart from '@material-ui/icons/BubbleChart';
11 import Build from '@material-ui/icons/Build';
12 import Cached from '@material-ui/icons/Cached';
13 import DescriptionIcon from '@material-ui/icons/Description';
14 import ChevronLeft from '@material-ui/icons/ChevronLeft';
15 import CloudUpload from '@material-ui/icons/CloudUpload';
16 import Code from '@material-ui/icons/Code';
17 import Create from '@material-ui/icons/Create';
18 import ImportContacts from '@material-ui/icons/ImportContacts';
19 import ChevronRight from '@material-ui/icons/ChevronRight';
20 import Close from '@material-ui/icons/Close';
21 import ContentCopy from '@material-ui/icons/FileCopyOutlined';
22 import CreateNewFolder from '@material-ui/icons/CreateNewFolder';
23 import Delete from '@material-ui/icons/Delete';
24 import DeviceHub from '@material-ui/icons/DeviceHub';
25 import Edit from '@material-ui/icons/Edit';
26 import ErrorRoundedIcon from '@material-ui/icons/ErrorRounded';
27 import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
28 import FlipToFront from '@material-ui/icons/FlipToFront';
29 import Folder from '@material-ui/icons/Folder';
30 import FolderShared from '@material-ui/icons/FolderShared';
31 import Pageview from '@material-ui/icons/Pageview';
32 import GetApp from '@material-ui/icons/GetApp';
33 import Help from '@material-ui/icons/Help';
34 import HelpOutline from '@material-ui/icons/HelpOutline';
35 import History from '@material-ui/icons/History';
36 import Inbox from '@material-ui/icons/Inbox';
37 import Info from '@material-ui/icons/Info';
38 import Input from '@material-ui/icons/Input';
39 import InsertDriveFile from '@material-ui/icons/InsertDriveFile';
40 import LastPage from '@material-ui/icons/LastPage';
41 import LibraryBooks from '@material-ui/icons/LibraryBooks';
42 import ListAlt from '@material-ui/icons/ListAlt';
43 import Menu from '@material-ui/icons/Menu';
44 import MoreVert from '@material-ui/icons/MoreVert';
45 import Mail from '@material-ui/icons/Mail';
46 import MoveToInbox from '@material-ui/icons/MoveToInbox';
47 import Notifications from '@material-ui/icons/Notifications';
48 import OpenInNew from '@material-ui/icons/OpenInNew';
49 import People from '@material-ui/icons/People';
50 import Person from '@material-ui/icons/Person';
51 import PersonAdd from '@material-ui/icons/PersonAdd';
52 import PlayArrow from '@material-ui/icons/PlayArrow';
53 import Public from '@material-ui/icons/Public';
54 import RateReview from '@material-ui/icons/RateReview';
55 import RestoreFromTrash from '@material-ui/icons/History';
56 import Search from '@material-ui/icons/Search';
57 import SettingsApplications from '@material-ui/icons/SettingsApplications';
58 import SettingsEthernet from '@material-ui/icons/SettingsEthernet';
59 import Star from '@material-ui/icons/Star';
60 import StarBorder from '@material-ui/icons/StarBorder';
61 import Warning from '@material-ui/icons/Warning';
62 import Visibility from '@material-ui/icons/Visibility';
63 import VisibilityOff from '@material-ui/icons/VisibilityOff';
64 import VpnKey from '@material-ui/icons/VpnKey';
65 import LinkOutlined from '@material-ui/icons/LinkOutlined';
66 import RemoveRedEye from '@material-ui/icons/RemoveRedEye';
67 import Computer from '@material-ui/icons/Computer';
68 import WrapText from '@material-ui/icons/WrapText';
69 import TextIncrease from '@material-ui/icons/ZoomIn';
70 import TextDecrease from '@material-ui/icons/ZoomOut';
71 import CropFreeSharp from '@material-ui/icons/CropFreeSharp';
72 import ExitToApp from '@material-ui/icons/ExitToApp';
73 import CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';
74 import RemoveCircleOutline from '@material-ui/icons/RemoveCircleOutline';
75 import NotInterested from '@material-ui/icons/NotInterested';
76
77 // Import FontAwesome icons
78 import { library } from '@fortawesome/fontawesome-svg-core';
79 import { faPencilAlt, faSlash, faUsers, faEllipsisH } from '@fortawesome/free-solid-svg-icons';
80 library.add(
81     faPencilAlt,
82     faSlash,
83     faUsers,
84     faEllipsisH,
85 );
86
87 export const PendingIcon = (props: any) =>
88     <span {...props}>
89         <span className='fas fa-ellipsis-h' />
90     </span>
91
92 export const ReadOnlyIcon = (props: any) =>
93     <span {...props}>
94         <div className="fa-layers fa-1x fa-fw">
95             <span className="fas fa-slash"
96                 data-fa-mask="fas fa-pencil-alt" data-fa-transform="down-1.5" />
97             <span className="fas fa-slash" />
98         </div>
99     </span>;
100
101 export const GroupsIcon = (props: any) =>
102     <span {...props}>
103         <span className="fas fa-users" />
104     </span>;
105
106 export const CollectionOldVersionIcon = (props: any) =>
107     <Tooltip title='Old version'>
108         <Badge badgeContent={<History fontSize='small' />}>
109             <CollectionIcon {...props} />
110         </Badge>
111     </Tooltip>;
112
113 export type IconType = React.SFC<{ className?: string, style?: object }>;
114
115 export const AddIcon: IconType = (props) => <Add {...props} />;
116 export const AddFavoriteIcon: IconType = (props) => <StarBorder {...props} />;
117 export const AdminMenuIcon: IconType = (props) => <Build {...props} />;
118 export const AdvancedIcon: IconType = (props) => <SettingsApplications {...props} />;
119 export const AttributesIcon: IconType = (props) => <ListAlt {...props} />;
120 export const BackIcon: IconType = (props) => <ArrowBack {...props} />;
121 export const CustomizeTableIcon: IconType = (props) => <Menu {...props} />;
122 export const CommandIcon: IconType = (props) => <LastPage {...props} />;
123 export const CopyIcon: IconType = (props) => <ContentCopy {...props} />;
124 export const CollectionIcon: IconType = (props) => <LibraryBooks {...props} />;
125 export const CloseIcon: IconType = (props) => <Close {...props} />;
126 export const CloudUploadIcon: IconType = (props) => <CloudUpload {...props} />;
127 export const DefaultIcon: IconType = (props) => <RateReview {...props} />;
128 export const DetailsIcon: IconType = (props) => <Info {...props} />;
129 export const DirectoryIcon: IconType = (props) => <Folder {...props} />;
130 export const DownloadIcon: IconType = (props) => <GetApp {...props} />;
131 export const EditSavedQueryIcon: IconType = (props) => <Create {...props} />;
132 export const ExpandIcon: IconType = (props) => <ExpandMoreIcon {...props} />;
133 export const ErrorIcon: IconType = (props) => <ErrorRoundedIcon style={{ color: '#ff0000' }} {...props} />;
134 export const FavoriteIcon: IconType = (props) => <Star {...props} />;
135 export const FileIcon: IconType = (props) => <DescriptionIcon {...props} />;
136 export const HelpIcon: IconType = (props) => <Help {...props} />;
137 export const HelpOutlineIcon: IconType = (props) => <HelpOutline {...props} />;
138 export const ImportContactsIcon: IconType = (props) => <ImportContacts {...props} />;
139 export const InfoIcon: IconType = (props) => <Info {...props} />;
140 export const InputIcon: IconType = (props) => <InsertDriveFile {...props} />;
141 export const KeyIcon: IconType = (props) => <VpnKey {...props} />;
142 export const LogIcon: IconType = (props) => <SettingsEthernet {...props} />;
143 export const MailIcon: IconType = (props) => <Mail {...props} />;
144 export const MaximizeIcon: IconType = (props) => <CropFreeSharp {...props} />;
145 export const MoreOptionsIcon: IconType = (props) => <MoreVert {...props} />;
146 export const MoveToIcon: IconType = (props) => <Input {...props} />;
147 export const NewProjectIcon: IconType = (props) => <CreateNewFolder {...props} />;
148 export const NotificationIcon: IconType = (props) => <Notifications {...props} />;
149 export const OpenIcon: IconType = (props) => <OpenInNew {...props} />;
150 export const OutputIcon: IconType = (props) => <MoveToInbox {...props} />;
151 export const PaginationDownIcon: IconType = (props) => <ArrowDropDown {...props} />;
152 export const PaginationLeftArrowIcon: IconType = (props) => <ChevronLeft {...props} />;
153 export const PaginationRightArrowIcon: IconType = (props) => <ChevronRight {...props} />;
154 export const ProcessIcon: IconType = (props) => <BubbleChart {...props} />;
155 export const ProjectIcon: IconType = (props) => <Folder {...props} />;
156 export const FilterGroupIcon: IconType = (props) => <Pageview {...props} />;
157 export const ProjectsIcon: IconType = (props) => <Inbox {...props} />;
158 export const ProvenanceGraphIcon: IconType = (props) => <DeviceHub {...props} />;
159 export const RemoveIcon: IconType = (props) => <Delete {...props} />;
160 export const RemoveFavoriteIcon: IconType = (props) => <Star {...props} />;
161 export const PublicFavoriteIcon: IconType = (props) => <Public {...props} />;
162 export const RenameIcon: IconType = (props) => <Edit {...props} />;
163 export const RestoreVersionIcon: IconType = (props) => <FlipToFront {...props} />;
164 export const RestoreFromTrashIcon: IconType = (props) => <RestoreFromTrash {...props} />;
165 export const ReRunProcessIcon: IconType = (props) => <Cached {...props} />;
166 export const SearchIcon: IconType = (props) => <Search {...props} />;
167 export const ShareIcon: IconType = (props) => <PersonAdd {...props} />;
168 export const ShareMeIcon: IconType = (props) => <People {...props} />;
169 export const SidePanelRightArrowIcon: IconType = (props) => <PlayArrow {...props} />;
170 export const TrashIcon: IconType = (props) => <Delete {...props} />;
171 export const UserPanelIcon: IconType = (props) => <Person {...props} />;
172 export const UsedByIcon: IconType = (props) => <Folder {...props} />;
173 export const VisibleIcon: IconType = (props) => <Visibility {...props} />;
174 export const InvisibleIcon: IconType = (props) => <VisibilityOff {...props} />;
175 export const WorkflowIcon: IconType = (props) => <Code {...props} />;
176 export const WarningIcon: IconType = (props) => <Warning style={{ color: '#fbc02d', height: '30px', width: '30px' }} {...props} />;
177 export const Link: IconType = (props) => <LinkOutlined {...props} />;
178 export const FolderSharedIcon: IconType = (props) => <FolderShared {...props} />;
179 export const CanReadIcon: IconType = (props) => <RemoveRedEye {...props} />;
180 export const CanWriteIcon: IconType = (props) => <Edit {...props} />;
181 export const CanManageIcon: IconType = (props) => <Computer {...props} />;
182 export const AddUserIcon: IconType = (props) => <PersonAdd {...props} />;
183 export const WordWrapIcon: IconType = (props) => <WrapText {...props} />;
184 export const TextIncreaseIcon: IconType = (props) => <TextIncrease {...props} />;
185 export const TextDecreaseIcon: IconType = (props) => <TextDecrease {...props} />;
186 export const DeactivateUserIcon: IconType = (props) => <NotInterested {...props} />;
187 export const LoginAsIcon: IconType = (props) => <ExitToApp {...props} />;
188 export const ActiveIcon: IconType = (props) => <CheckCircleOutline {...props} />;
189 export const SetupIcon: IconType = (props) => <RemoveCircleOutline {...props} />;
190 export const InactiveIcon: IconType = (props) => <NotInterested {...props} />;