Merge branch '17098-old-version-as-head'
[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 * as 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 ChevronLeft from '@material-ui/icons/ChevronLeft';
14 import CloudUpload from '@material-ui/icons/CloudUpload';
15 import Code from '@material-ui/icons/Code';
16 import Create from '@material-ui/icons/Create';
17 import ImportContacts from '@material-ui/icons/ImportContacts';
18 import ChevronRight from '@material-ui/icons/ChevronRight';
19 import Close from '@material-ui/icons/Close';
20 import ContentCopy from '@material-ui/icons/FileCopyOutlined';
21 import CreateNewFolder from '@material-ui/icons/CreateNewFolder';
22 import Delete from '@material-ui/icons/Delete';
23 import DeviceHub from '@material-ui/icons/DeviceHub';
24 import Edit from '@material-ui/icons/Edit';
25 import ErrorRoundedIcon from '@material-ui/icons/ErrorRounded';
26 import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
27 import FlipToFront from '@material-ui/icons/FlipToFront';
28 import Folder from '@material-ui/icons/Folder';
29 import GetApp from '@material-ui/icons/GetApp';
30 import Help from '@material-ui/icons/Help';
31 import HelpOutline from '@material-ui/icons/HelpOutline';
32 import History from '@material-ui/icons/History';
33 import Inbox from '@material-ui/icons/Inbox';
34 import Info from '@material-ui/icons/Info';
35 import Input from '@material-ui/icons/Input';
36 import InsertDriveFile from '@material-ui/icons/InsertDriveFile';
37 import LastPage from '@material-ui/icons/LastPage';
38 import LibraryBooks from '@material-ui/icons/LibraryBooks';
39 import ListAlt from '@material-ui/icons/ListAlt';
40 import Menu from '@material-ui/icons/Menu';
41 import MoreVert from '@material-ui/icons/MoreVert';
42 import Mail from '@material-ui/icons/Mail';
43 import MoveToInbox from '@material-ui/icons/MoveToInbox';
44 import Notifications from '@material-ui/icons/Notifications';
45 import OpenInNew from '@material-ui/icons/OpenInNew';
46 import People from '@material-ui/icons/People';
47 import Person from '@material-ui/icons/Person';
48 import PersonAdd from '@material-ui/icons/PersonAdd';
49 import PlayArrow from '@material-ui/icons/PlayArrow';
50 import Public from '@material-ui/icons/Public';
51 import RateReview from '@material-ui/icons/RateReview';
52 import RestoreFromTrash from '@material-ui/icons/History';
53 import Search from '@material-ui/icons/Search';
54 import SettingsApplications from '@material-ui/icons/SettingsApplications';
55 import SettingsEthernet from '@material-ui/icons/SettingsEthernet';
56 import Star from '@material-ui/icons/Star';
57 import StarBorder from '@material-ui/icons/StarBorder';
58 import Warning from '@material-ui/icons/Warning';
59 import VpnKey from '@material-ui/icons/VpnKey';
60 import LinkOutlined from '@material-ui/icons/LinkOutlined';
61
62 // Import FontAwesome icons
63 import { library } from '@fortawesome/fontawesome-svg-core';
64 import { faPencilAlt, faSlash } from '@fortawesome/free-solid-svg-icons';
65 library.add(
66     faPencilAlt,
67     faSlash,
68 );
69
70 export const ReadOnlyIcon = (props:any) =>
71     <span {...props}>
72         <div className="fa-layers fa-1x fa-fw">
73             <span className="fas fa-slash"
74                 data-fa-mask="fas fa-pencil-alt" data-fa-transform="down-1.5" />
75             <span className="fas fa-slash" />
76         </div>
77     </span>;
78
79 export const CollectionOldVersionIcon = (props: any) =>
80     <Tooltip title='Old version'>
81         <Badge badgeContent={<History fontSize='small' />}>
82             <CollectionIcon {...props} />
83         </Badge>
84     </Tooltip>;
85
86 export type IconType = React.SFC<{ className?: string, style?: object }>;
87
88 export const AddIcon: IconType = (props) => <Add {...props} />;
89 export const AddFavoriteIcon: IconType = (props) => <StarBorder {...props} />;
90 export const AdminMenuIcon: IconType = (props) => <Build {...props} />;
91 export const AdvancedIcon: IconType = (props) => <SettingsApplications {...props} />;
92 export const AttributesIcon: IconType = (props) => <ListAlt {...props} />;
93 export const BackIcon: IconType = (props) => <ArrowBack {...props} />;
94 export const CustomizeTableIcon: IconType = (props) => <Menu {...props} />;
95 export const CommandIcon: IconType = (props) => <LastPage {...props} />;
96 export const CopyIcon: IconType = (props) => <ContentCopy {...props} />;
97 export const CollectionIcon: IconType = (props) => <LibraryBooks {...props} />;
98 export const CloseIcon: IconType = (props) => <Close {...props} />;
99 export const CloudUploadIcon: IconType = (props) => <CloudUpload {...props} />;
100 export const DefaultIcon: IconType = (props) => <RateReview {...props} />;
101 export const DetailsIcon: IconType = (props) => <Info {...props} />;
102 export const DirectoryIcon: IconType = (props) => <Folder {...props} />;
103 export const DownloadIcon: IconType = (props) => <GetApp {...props} />;
104 export const EditSavedQueryIcon: IconType = (props) => <Create {...props} />;
105 export const ExpandIcon: IconType = (props) => <ExpandMoreIcon {...props} />;
106 export const ErrorIcon: IconType = (props) => <ErrorRoundedIcon style={{color: '#ff0000'}} {...props} />;
107 export const FavoriteIcon: IconType = (props) => <Star {...props} />;
108 export const FileIcon: IconType = (props) => <LibraryBooks {...props} />;
109 export const HelpIcon: IconType = (props) => <Help {...props} />;
110 export const HelpOutlineIcon: IconType = (props) => <HelpOutline {...props} />;
111 export const ImportContactsIcon: IconType = (props) => <ImportContacts {...props} />;
112 export const InputIcon: IconType = (props) => <InsertDriveFile {...props} />;
113 export const KeyIcon: IconType = (props) => <VpnKey {...props} />;
114 export const LogIcon: IconType = (props) => <SettingsEthernet {...props} />;
115 export const MailIcon: IconType = (props) => <Mail {...props} />;
116 export const MoreOptionsIcon: IconType = (props) => <MoreVert {...props} />;
117 export const MoveToIcon: IconType = (props) => <Input {...props} />;
118 export const NewProjectIcon: IconType = (props) => <CreateNewFolder {...props} />;
119 export const NotificationIcon: IconType = (props) => <Notifications {...props} />;
120 export const OpenIcon: IconType = (props) => <OpenInNew {...props} />;
121 export const OutputIcon: IconType = (props) => <MoveToInbox {...props} />;
122 export const PaginationDownIcon: IconType = (props) => <ArrowDropDown {...props} />;
123 export const PaginationLeftArrowIcon: IconType = (props) => <ChevronLeft {...props} />;
124 export const PaginationRightArrowIcon: IconType = (props) => <ChevronRight {...props} />;
125 export const ProcessIcon: IconType = (props) => <BubbleChart {...props} />;
126 export const ProjectIcon: IconType = (props) => <Folder {...props} />;
127 export const ProjectsIcon: IconType = (props) => <Inbox {...props} />;
128 export const ProvenanceGraphIcon: IconType = (props) => <DeviceHub {...props} />;
129 export const RemoveIcon: IconType = (props) => <Delete {...props} />;
130 export const RemoveFavoriteIcon: IconType = (props) => <Star {...props} />;
131 export const PublicFavoriteIcon: IconType = (props) => <Public {...props} />;
132 export const RenameIcon: IconType = (props) => <Edit {...props} />;
133 export const RestoreVersionIcon: IconType = (props) => <FlipToFront {...props} />;
134 export const RestoreFromTrashIcon: IconType = (props) => <RestoreFromTrash {...props} />;
135 export const ReRunProcessIcon: IconType = (props) => <Cached {...props} />;
136 export const SearchIcon: IconType = (props) => <Search {...props} />;
137 export const ShareIcon: IconType = (props) => <PersonAdd {...props} />;
138 export const ShareMeIcon: IconType = (props) => <People {...props} />;
139 export const SidePanelRightArrowIcon: IconType = (props) => <PlayArrow {...props} />;
140 export const TrashIcon: IconType = (props) => <Delete {...props} />;
141 export const UserPanelIcon: IconType = (props) => <Person {...props} />;
142 export const UsedByIcon: IconType = (props) => <Folder {...props} />;
143 export const WorkflowIcon: IconType = (props) => <Code {...props} />;
144 export const WarningIcon: IconType = (props) => <Warning style={{ color: '#fbc02d', height: '30px', width: '30px' }} {...props} />;
145 export const Link: IconType = (props) => <LinkOutlined {...props} />;