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