@manuscripts/style-guide 1.7.10-LEAN-3415-2 → 1.7.11
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.
- package/dist/cjs/components/Button.js +3 -13
- package/dist/cjs/components/References/CitationEditor.js +4 -1
- package/dist/cjs/index.js +0 -1
- package/dist/es/components/Button.js +2 -12
- package/dist/es/components/References/CitationEditor.js +4 -1
- package/dist/es/index.js +0 -1
- package/dist/types/components/Button.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/package.json +3 -3
- package/dist/cjs/components/ContextMenu.js +0 -51
- package/dist/es/components/ContextMenu.js +0 -44
- package/dist/types/components/ContextMenu.d.ts +0 -25
|
@@ -38,13 +38,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.
|
|
41
|
+
exports.ButtonGroup = exports.SecondaryIconButton = exports.RoundIconButton = exports.IconButton = exports.ToggleButtonAlt = exports.ToggleButton = exports.IconTextButton = exports.TertiaryButton = exports.PrimaryButton = exports.SecondaryButton = void 0;
|
|
42
42
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
43
43
|
const dangerBtnStyles = (0, styled_components_1.css) `
|
|
44
44
|
${(props) => btnColors(props.theme.colors.button.error.color.default, props.theme.colors.button.error.background.default, props.theme.colors.button.error.border.default, true)}
|
|
45
45
|
|
|
46
46
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
47
47
|
${(props) => btnColors(props.theme.colors.button.error.color.hover, props.theme.colors.button.error.background.hover, props.theme.colors.button.error.border.hover, true)}
|
|
48
|
+
}
|
|
48
49
|
|
|
49
50
|
&:not([disabled]):active {
|
|
50
51
|
${(props) => btnColors(props.theme.colors.button.error.color.active, props.theme.colors.button.error.background.active, props.theme.colors.button.error.border.active)}
|
|
@@ -229,7 +230,7 @@ const IconButtonTemplate = (0, styled_components_1.default)(ButtonTemplate) `
|
|
|
229
230
|
${(props) => !props.defaultColor && svgColors}
|
|
230
231
|
`;
|
|
231
232
|
exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
|
|
232
|
-
${(props) => btnColors(
|
|
233
|
+
${(props) => btnColors(props.theme.colors.text.primary, props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
233
234
|
|
|
234
235
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
235
236
|
${(props) => btnColors(props.theme.colors.brand.medium, 'transparent', 'transparent', false)}
|
|
@@ -287,14 +288,3 @@ exports.ButtonGroup = styled_components_1.default.div `
|
|
|
287
288
|
margin-left: ${(props) => props.theme.grid.unit}px;
|
|
288
289
|
}
|
|
289
290
|
`;
|
|
290
|
-
exports.IconButtonGroup = styled_components_1.default.div `
|
|
291
|
-
display: flex;
|
|
292
|
-
flex-direction: row;
|
|
293
|
-
justify-content: flex-start;
|
|
294
|
-
align-items: center;
|
|
295
|
-
|
|
296
|
-
button {
|
|
297
|
-
width: 28px;
|
|
298
|
-
height: 28px;
|
|
299
|
-
}
|
|
300
|
-
`;
|
|
@@ -34,6 +34,7 @@ const react_1 = __importStar(require("react"));
|
|
|
34
34
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
35
35
|
const Button_1 = require("../Button");
|
|
36
36
|
const Dialog_1 = require("../Dialog");
|
|
37
|
+
const icons_1 = require("../icons");
|
|
37
38
|
const CitationViewer_1 = require("./CitationViewer");
|
|
38
39
|
const ReferenceLine_1 = require("./ReferenceLine");
|
|
39
40
|
const ReferenceSearch_1 = require("./ReferenceSearch");
|
|
@@ -135,7 +136,9 @@ const CitationEditor = ({ query, rids, items, citationCounts, sources, onCite, o
|
|
|
135
136
|
react_1.default.createElement(CloseIconDark_1.default, { className: 'remove-icon' }))))))),
|
|
136
137
|
react_1.default.createElement(ReferencesModal_1.ReferencesModal, { isOpen: editingForm.show, onCancel: () => setEditingForm({ show: false }), items: items, citationCounts: citationCounts, item: editingForm.item, onSave: onSave, onDelete: onDelete }),
|
|
137
138
|
react_1.default.createElement(Actions, null,
|
|
138
|
-
react_1.default.createElement(Button_1.IconTextButton,
|
|
139
|
+
react_1.default.createElement(Button_1.IconTextButton, { onClick: onComment },
|
|
140
|
+
react_1.default.createElement(icons_1.AddComment, null),
|
|
141
|
+
react_1.default.createElement(AddCommentButtonText, null, "Add Comment")),
|
|
139
142
|
react_1.default.createElement(Button_1.ButtonGroup, null,
|
|
140
143
|
react_1.default.createElement(Button_1.SecondaryButton, { onClick: onCancel }, "Done"),
|
|
141
144
|
react_1.default.createElement(Button_1.PrimaryButton, { disabled: !canEdit, onClick: () => setSearching(true) }, "Add Citation")))));
|
package/dist/cjs/index.js
CHANGED
|
@@ -39,7 +39,6 @@ __exportStar(require("./components/AuthorName"), exports);
|
|
|
39
39
|
__exportStar(require("./components/AuthorsDND"), exports);
|
|
40
40
|
__exportStar(require("./components/AlertMessage"), exports);
|
|
41
41
|
__exportStar(require("./components/Button"), exports);
|
|
42
|
-
__exportStar(require("./components/ContextMenu"), exports);
|
|
43
42
|
__exportStar(require("./components/RadioButton"), exports);
|
|
44
43
|
__exportStar(require("./components/AutoSaveInput"), exports);
|
|
45
44
|
__exportStar(require("./components/Avatar"), exports);
|
|
@@ -19,6 +19,7 @@ const dangerBtnStyles = css `
|
|
|
19
19
|
|
|
20
20
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
21
21
|
${(props) => btnColors(props.theme.colors.button.error.color.hover, props.theme.colors.button.error.background.hover, props.theme.colors.button.error.border.hover, true)}
|
|
22
|
+
}
|
|
22
23
|
|
|
23
24
|
&:not([disabled]):active {
|
|
24
25
|
${(props) => btnColors(props.theme.colors.button.error.color.active, props.theme.colors.button.error.background.active, props.theme.colors.button.error.border.active)}
|
|
@@ -203,7 +204,7 @@ const IconButtonTemplate = styled(ButtonTemplate) `
|
|
|
203
204
|
${(props) => !props.defaultColor && svgColors}
|
|
204
205
|
`;
|
|
205
206
|
export const IconButton = styled(IconButtonTemplate) `
|
|
206
|
-
${(props) => btnColors(
|
|
207
|
+
${(props) => btnColors(props.theme.colors.text.primary, props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
207
208
|
|
|
208
209
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
209
210
|
${(props) => btnColors(props.theme.colors.brand.medium, 'transparent', 'transparent', false)}
|
|
@@ -261,14 +262,3 @@ export const ButtonGroup = styled.div `
|
|
|
261
262
|
margin-left: ${(props) => props.theme.grid.unit}px;
|
|
262
263
|
}
|
|
263
264
|
`;
|
|
264
|
-
export const IconButtonGroup = styled.div `
|
|
265
|
-
display: flex;
|
|
266
|
-
flex-direction: row;
|
|
267
|
-
justify-content: flex-start;
|
|
268
|
-
align-items: center;
|
|
269
|
-
|
|
270
|
-
button {
|
|
271
|
-
width: 28px;
|
|
272
|
-
height: 28px;
|
|
273
|
-
}
|
|
274
|
-
`;
|
|
@@ -5,6 +5,7 @@ import React, { useMemo, useState } from 'react';
|
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import { ButtonGroup, IconButton, IconTextButton, PrimaryButton, SecondaryButton, } from '../Button';
|
|
7
7
|
import { Category, Dialog } from '../Dialog';
|
|
8
|
+
import { AddComment } from '../icons';
|
|
8
9
|
import { CitedItem, CitedItems } from './CitationViewer';
|
|
9
10
|
import { ReferenceLine } from './ReferenceLine';
|
|
10
11
|
import { ReferenceSearch } from './ReferenceSearch';
|
|
@@ -106,7 +107,9 @@ export const CitationEditor = ({ query, rids, items, citationCounts, sources, on
|
|
|
106
107
|
React.createElement(CloseIconDark, { className: 'remove-icon' }))))))),
|
|
107
108
|
React.createElement(ReferencesModal, { isOpen: editingForm.show, onCancel: () => setEditingForm({ show: false }), items: items, citationCounts: citationCounts, item: editingForm.item, onSave: onSave, onDelete: onDelete }),
|
|
108
109
|
React.createElement(Actions, null,
|
|
109
|
-
React.createElement(IconTextButton,
|
|
110
|
+
React.createElement(IconTextButton, { onClick: onComment },
|
|
111
|
+
React.createElement(AddComment, null),
|
|
112
|
+
React.createElement(AddCommentButtonText, null, "Add Comment")),
|
|
110
113
|
React.createElement(ButtonGroup, null,
|
|
111
114
|
React.createElement(SecondaryButton, { onClick: onCancel }, "Done"),
|
|
112
115
|
React.createElement(PrimaryButton, { disabled: !canEdit, onClick: () => setSearching(true) }, "Add Citation")))));
|
package/dist/es/index.js
CHANGED
|
@@ -19,7 +19,6 @@ export * from './components/AuthorName';
|
|
|
19
19
|
export * from './components/AuthorsDND';
|
|
20
20
|
export * from './components/AlertMessage';
|
|
21
21
|
export * from './components/Button';
|
|
22
|
-
export * from './components/ContextMenu';
|
|
23
22
|
export * from './components/RadioButton';
|
|
24
23
|
export * from './components/AutoSaveInput';
|
|
25
24
|
export * from './components/Avatar';
|
|
@@ -95,4 +95,3 @@ export declare const SecondaryIconButton: import("styled-components").StyledComp
|
|
|
95
95
|
iconColor?: string | undefined;
|
|
96
96
|
}, "type">;
|
|
97
97
|
export declare const ButtonGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
98
|
-
export declare const IconButtonGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export * from './components/AuthorName';
|
|
|
20
20
|
export * from './components/AuthorsDND';
|
|
21
21
|
export * from './components/AlertMessage';
|
|
22
22
|
export * from './components/Button';
|
|
23
|
-
export * from './components/ContextMenu';
|
|
24
23
|
export * from './components/RadioButton';
|
|
25
24
|
export * from './components/AutoSaveInput';
|
|
26
25
|
export * from './components/Avatar';
|
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": "1.7.
|
|
4
|
+
"version": "1.7.11",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@manuscripts/assets": "^0.6.4",
|
|
36
|
-
"@manuscripts/json-schema": "^2.2.
|
|
37
|
-
"@manuscripts/transform": "^2.1.
|
|
36
|
+
"@manuscripts/json-schema": "^2.2.6",
|
|
37
|
+
"@manuscripts/transform": "^2.1.6",
|
|
38
38
|
"@reach/tabs": "^0.18.0",
|
|
39
39
|
"date-fns": "^2.29.3",
|
|
40
40
|
"formik": "^2.2.9",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* © 2024 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
|
-
exports.ContextMenu = void 0;
|
|
22
|
-
const react_1 = __importDefault(require("react"));
|
|
23
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
const Button_1 = require("./Button");
|
|
25
|
-
const icons_1 = require("./icons");
|
|
26
|
-
const Tooltip_1 = require("./Tooltip");
|
|
27
|
-
const Icons = {
|
|
28
|
-
AddComment: icons_1.AddComment,
|
|
29
|
-
EditIcon: icons_1.EditIcon,
|
|
30
|
-
};
|
|
31
|
-
const ContextMenuIconButton = (0, styled_components_1.default)(Button_1.IconButton) `
|
|
32
|
-
&:not([disabled]):hover,
|
|
33
|
-
&:not([disabled]):focus {
|
|
34
|
-
color: #363636;
|
|
35
|
-
background-color: #f2f2f2;
|
|
36
|
-
border-color: #f2f2f2;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
const ContextMenu = ({ actions }) => {
|
|
40
|
-
let Icon;
|
|
41
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
|
-
react_1.default.createElement(Button_1.IconButtonGroup, null, actions.map((action) => {
|
|
43
|
-
{
|
|
44
|
-
Icon = Icons[action.icon];
|
|
45
|
-
}
|
|
46
|
-
return (react_1.default.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action },
|
|
47
|
-
react_1.default.createElement(Icon, null),
|
|
48
|
-
react_1.default.createElement(Tooltip_1.Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
49
|
-
}))));
|
|
50
|
-
};
|
|
51
|
-
exports.ContextMenu = ContextMenu;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2024 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 styled from 'styled-components';
|
|
18
|
-
import { IconButton, IconButtonGroup } from './Button';
|
|
19
|
-
import { AddComment, EditIcon } from './icons';
|
|
20
|
-
import { Tooltip } from './Tooltip';
|
|
21
|
-
const Icons = {
|
|
22
|
-
AddComment: AddComment,
|
|
23
|
-
EditIcon: EditIcon,
|
|
24
|
-
};
|
|
25
|
-
const ContextMenuIconButton = styled(IconButton) `
|
|
26
|
-
&:not([disabled]):hover,
|
|
27
|
-
&:not([disabled]):focus {
|
|
28
|
-
color: #363636;
|
|
29
|
-
background-color: #f2f2f2;
|
|
30
|
-
border-color: #f2f2f2;
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
|
-
export const ContextMenu = ({ actions }) => {
|
|
34
|
-
let Icon;
|
|
35
|
-
return (React.createElement(React.Fragment, null,
|
|
36
|
-
React.createElement(IconButtonGroup, null, actions.map((action) => {
|
|
37
|
-
{
|
|
38
|
-
Icon = Icons[action.icon];
|
|
39
|
-
}
|
|
40
|
-
return (React.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action },
|
|
41
|
-
React.createElement(Icon, null),
|
|
42
|
-
React.createElement(Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
43
|
-
}))));
|
|
44
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2024 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
|
-
export interface Actions {
|
|
18
|
-
label: string;
|
|
19
|
-
action: () => void;
|
|
20
|
-
icon: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ContextMenuProps {
|
|
23
|
-
actions: Actions[];
|
|
24
|
-
}
|
|
25
|
-
export declare const ContextMenu: React.FC<ContextMenuProps>;
|