@manuscripts/style-guide 2.1.9 → 2.1.10-LEAN-4432.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,6 +58,10 @@ const ContextMenuIconButton = (0, styled_components_1.default)(Button_1.IconButt
58
58
  background-color: #f2f2f2;
59
59
  border-color: #f2f2f2;
60
60
  }
61
+ &[disabled] {
62
+ color: #c9c9c9 !important;
63
+ background-color: #fff !important;
64
+ }
61
65
  `;
62
66
  const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
63
67
  const iconName = name.replace(/Icon$/, '');
@@ -66,7 +70,7 @@ const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
66
70
  }, {});
67
71
  const ContextMenu = ({ actions }) => (react_1.default.createElement(Button_1.IconButtonGroup, { size: 32 }, actions.map((action) => {
68
72
  const Icon = icons[action.icon];
69
- return (react_1.default.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action, className: action.selected ? 'selected' : '' },
73
+ return (react_1.default.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.disabled === true ? () => null : action.action, className: action.selected ? 'selected' : '', disabled: !!action.disabled },
70
74
  react_1.default.createElement(Icon, { width: 18, height: 18 }),
71
75
  react_1.default.createElement(Tooltip_1.Tooltip, { id: action.icon, place: "bottom" }, action.label)));
72
76
  })));
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2019 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ const react_1 = __importDefault(require("react"));
22
+ const AddFigureIcon = (props) => (react_1.default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
23
+ react_1.default.createElement("path", { d: "M14.5 15.5H1.5C0.948 15.5 0.5 15.052 0.5 14.5V1.5C0.5 0.948 0.948 0.5 1.5 0.5H14.5C15.052 0.5 15.5 0.948 15.5 1.5V14.5C15.5 15.052 15.052 15.5 14.5 15.5Z", stroke: "#353535", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
24
+ react_1.default.createElement("path", { d: "M2.5 12.5L9.5 7.5L13.5 11.5", stroke: "#353535", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
25
+ react_1.default.createElement("path", { d: "M4.5 7C5.32843 7 6 6.32843 6 5.5C6 4.67157 5.32843 4 4.5 4C3.67157 4 3 4.67157 3 5.5C3 6.32843 3.67157 7 4.5 7Z", fill: "#353535" })));
26
+ exports.default = AddFigureIcon;
@@ -18,13 +18,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
18
18
  return (mod && mod.__esModule) ? mod : { "default": mod };
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.HelpIcon = exports.HandleOutlineIcon = exports.HandleInspectorIcon = exports.FileVideoIcon = exports.FileUnknownIcon = exports.FileTableIcon = exports.FilePdfIcon = exports.FileMainDocumentIcon = exports.FileLatexIcon = exports.FileImageIcon = exports.FileGraphicalAbstractIcon = exports.FileFigureIcon = exports.FileDocumentIcon = exports.FileCorruptedIcon = exports.FileCompressedIcon = exports.FileCodeIcon = exports.FileAudioIcon = exports.EditAttrsTrackingIcon = exports.EditIcon = exports.DraggableIcon = exports.DotsIcon = exports.DeleteIcon = exports.DeleteSolidIcon = exports.CorrespondingAuthorIcon = exports.CommentIcon = exports.CommentResolveIcon = exports.CommentReplyIcon = exports.CitationCountIcon = exports.SystemUserAvatarIcon = exports.BookIcon = exports.AffiliationPlaceholderIcon = exports.AuthorPlaceholderIcon = exports.AffiliationIcon = exports.AlertIcon = exports.AvatarIcon = exports.AttentionRedIcon = exports.AttentionOrangeIcon = exports.AttentionGreenIcon = exports.AttentionBlueIcon = exports.AttachIcon = exports.ArrowUpIcon = exports.ArrowLeftIcon = exports.ArrowDownCircleIcon = exports.ArrowDownIcon = exports.AddIcon = exports.AddOutlineIcon = exports.AddNewIcon = exports.AddedIcon = exports.AddCommentIcon = exports.AddAuthorIcon = void 0;
22
- exports.UploadIcon = exports.TriangleExpandedIcon = exports.TriangleCollapsedIcon = exports.ToolbarUnindentIcon = exports.ToolbarIndentIcon = exports.ToolbarUnorderedListIcon = exports.ToolbarUnderlineIcon = exports.ToolbarTableIcon = exports.ToolbarSymbolIcon = exports.ToolbarSuperscriptIcon = exports.ToolbarSubscriptIcon = exports.ToolbarOrderedListIcon = exports.ToolbarItalicIcon = exports.ToolbarFigureIcon = exports.ToolbarEquationIcon = exports.ToolbarCodeIcon = exports.ToolbarCitationIcon = exports.ToolbarBoldIcon = exports.TickIcon = exports.TaskStepDoneIcon = exports.SliderOnIcon = exports.SliderOffIcon = exports.SectionCategoryIcon = exports.SearchIcon = exports.ScrollIcon = exports.SaveStatusSavingIcon = exports.SaveStatusSavedIcon = exports.SaveStatusOfflineIcon = exports.RoleReadingIcon = exports.RoleAnnotatingIcon = exports.PlusIcon = exports.OutlineUnorderedListIcon = exports.OutlineTableIcon = exports.OutlineSectionIcon = exports.OutlinePullQuoteIcon = exports.OutlineParagraphIcon = exports.OutlineOrderedListIcon = exports.OutlineManuscriptIcon = exports.OutlineFigureIcon = exports.OutlineEmbedIcon = exports.OutlineEquationIcon = exports.OutlineCodeIcon = exports.OutlineBlockQuoteIcon = exports.ManuscriptIcon = exports.LogoutIcon = exports.LockIcon = exports.LinkIcon = exports.ImageRightIcon = exports.ImageDefaultIcon = exports.ImageLeftIcon = void 0;
23
- exports.AddInstitutionIcon = exports.AddUserIcon = exports.ProfileIcon = exports.CrclTickAnimation = exports.VerticalEllipsisIcon = void 0;
21
+ exports.HandleOutlineIcon = exports.HandleInspectorIcon = exports.FileVideoIcon = exports.FileUnknownIcon = exports.FileTableIcon = exports.FilePdfIcon = exports.FileMainDocumentIcon = exports.FileLatexIcon = exports.FileImageIcon = exports.FileGraphicalAbstractIcon = exports.FileFigureIcon = exports.FileDocumentIcon = exports.FileCorruptedIcon = exports.FileCompressedIcon = exports.FileCodeIcon = exports.FileAudioIcon = exports.EditAttrsTrackingIcon = exports.EditIcon = exports.DraggableIcon = exports.DotsIcon = exports.DeleteIcon = exports.DeleteSolidIcon = exports.CorrespondingAuthorIcon = exports.CommentIcon = exports.CommentResolveIcon = exports.CommentReplyIcon = exports.CitationCountIcon = exports.SystemUserAvatarIcon = exports.BookIcon = exports.AffiliationPlaceholderIcon = exports.AuthorPlaceholderIcon = exports.AffiliationIcon = exports.AlertIcon = exports.AvatarIcon = exports.AttentionRedIcon = exports.AttentionOrangeIcon = exports.AttentionGreenIcon = exports.AttentionBlueIcon = exports.AttachIcon = exports.ArrowUpIcon = exports.ArrowLeftIcon = exports.ArrowDownCircleIcon = exports.ArrowDownIcon = exports.AddIcon = exports.AddOutlineIcon = exports.AddNewIcon = exports.AddedIcon = exports.AddFigureIcon = exports.AddCommentIcon = exports.AddAuthorIcon = void 0;
22
+ exports.TriangleExpandedIcon = exports.TriangleCollapsedIcon = exports.ToolbarUnindentIcon = exports.ToolbarIndentIcon = exports.ToolbarUnorderedListIcon = exports.ToolbarUnderlineIcon = exports.ToolbarTableIcon = exports.ToolbarSymbolIcon = exports.ToolbarSuperscriptIcon = exports.ToolbarSubscriptIcon = exports.ToolbarOrderedListIcon = exports.ToolbarItalicIcon = exports.ToolbarFigureIcon = exports.ToolbarEquationIcon = exports.ToolbarCodeIcon = exports.ToolbarCitationIcon = exports.ToolbarBoldIcon = exports.TickIcon = exports.TaskStepDoneIcon = exports.SliderOnIcon = exports.SliderOffIcon = exports.SectionCategoryIcon = exports.SearchIcon = exports.ScrollIcon = exports.SaveStatusSavingIcon = exports.SaveStatusSavedIcon = exports.SaveStatusOfflineIcon = exports.RoleReadingIcon = exports.RoleAnnotatingIcon = exports.PlusIcon = exports.OutlineUnorderedListIcon = exports.OutlineTableIcon = exports.OutlineSectionIcon = exports.OutlinePullQuoteIcon = exports.OutlineParagraphIcon = exports.OutlineOrderedListIcon = exports.OutlineManuscriptIcon = exports.OutlineFigureIcon = exports.OutlineEmbedIcon = exports.OutlineEquationIcon = exports.OutlineCodeIcon = exports.OutlineBlockQuoteIcon = exports.ManuscriptIcon = exports.LogoutIcon = exports.LockIcon = exports.LinkIcon = exports.ImageRightIcon = exports.ImageDefaultIcon = exports.ImageLeftIcon = exports.HelpIcon = void 0;
23
+ exports.AddInstitutionIcon = exports.AddUserIcon = exports.ProfileIcon = exports.CrclTickAnimation = exports.VerticalEllipsisIcon = exports.UploadIcon = void 0;
24
24
  var add_author_1 = require("./add-author");
25
25
  Object.defineProperty(exports, "AddAuthorIcon", { enumerable: true, get: function () { return __importDefault(add_author_1).default; } });
26
26
  var add_comment_1 = require("./add-comment");
27
27
  Object.defineProperty(exports, "AddCommentIcon", { enumerable: true, get: function () { return __importDefault(add_comment_1).default; } });
28
+ var add_figure_1 = require("./add-figure");
29
+ Object.defineProperty(exports, "AddFigureIcon", { enumerable: true, get: function () { return __importDefault(add_figure_1).default; } });
28
30
  var added_1 = require("./added");
29
31
  Object.defineProperty(exports, "AddedIcon", { enumerable: true, get: function () { return __importDefault(added_1).default; } });
30
32
  var add_new_1 = require("./add-new");
@@ -29,6 +29,10 @@ const ContextMenuIconButton = styled(IconButton) `
29
29
  background-color: #f2f2f2;
30
30
  border-color: #f2f2f2;
31
31
  }
32
+ &[disabled] {
33
+ color: #c9c9c9 !important;
34
+ background-color: #fff !important;
35
+ }
32
36
  `;
33
37
  const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
34
38
  const iconName = name.replace(/Icon$/, '');
@@ -37,7 +41,7 @@ const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
37
41
  }, {});
38
42
  export const ContextMenu = ({ actions }) => (React.createElement(IconButtonGroup, { size: 32 }, actions.map((action) => {
39
43
  const Icon = icons[action.icon];
40
- return (React.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action, className: action.selected ? 'selected' : '' },
44
+ return (React.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.disabled === true ? () => null : action.action, className: action.selected ? 'selected' : '', disabled: !!action.disabled },
41
45
  React.createElement(Icon, { width: 18, height: 18 }),
42
46
  React.createElement(Tooltip, { id: action.icon, place: "bottom" }, action.label)));
43
47
  })));
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ const AddFigureIcon = (props) => (React.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
18
+ React.createElement("path", { d: "M14.5 15.5H1.5C0.948 15.5 0.5 15.052 0.5 14.5V1.5C0.5 0.948 0.948 0.5 1.5 0.5H14.5C15.052 0.5 15.5 0.948 15.5 1.5V14.5C15.5 15.052 15.052 15.5 14.5 15.5Z", stroke: "#353535", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
19
+ React.createElement("path", { d: "M2.5 12.5L9.5 7.5L13.5 11.5", stroke: "#353535", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
20
+ React.createElement("path", { d: "M4.5 7C5.32843 7 6 6.32843 6 5.5C6 4.67157 5.32843 4 4.5 4C3.67157 4 3 4.67157 3 5.5C3 6.32843 3.67157 7 4.5 7Z", fill: "#353535" })));
21
+ export default AddFigureIcon;
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export { default as AddAuthorIcon } from './add-author';
17
17
  export { default as AddCommentIcon } from './add-comment';
18
+ export { default as AddFigureIcon } from './add-figure';
18
19
  export { default as AddedIcon } from './added';
19
20
  export { default as AddNewIcon } from './add-new';
20
21
  export { default as AddOutlineIcon } from './add-outline';
@@ -18,6 +18,7 @@ export interface Actions {
18
18
  label: string;
19
19
  action: () => void;
20
20
  icon: string;
21
+ disabled?: boolean;
21
22
  selected?: boolean;
22
23
  }
23
24
  export interface ContextMenuProps {
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ import { IconProps } from './types';
18
+ declare const AddFigureIcon: (props: IconProps) => React.JSX.Element;
19
+ export default AddFigureIcon;
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export { default as AddAuthorIcon } from './add-author';
17
17
  export { default as AddCommentIcon } from './add-comment';
18
+ export { default as AddFigureIcon } from './add-figure';
18
19
  export { default as AddedIcon } from './added';
19
20
  export { default as AddNewIcon } from './add-new';
20
21
  export { default as AddOutlineIcon } from './add-outline';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/style-guide",
3
3
  "description": "Shared components for Manuscripts applications",
4
- "version": "2.1.9",
4
+ "version": "2.1.10-LEAN-4432.0",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",