@manuscripts/style-guide 1.7.10-LEAN-3415-2 → 1.7.11-LEAN-3415-3
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.
|
@@ -45,6 +45,7 @@ const dangerBtnStyles = (0, styled_components_1.css) `
|
|
|
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)}
|
|
@@ -24,11 +24,8 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
24
24
|
const Button_1 = require("./Button");
|
|
25
25
|
const icons_1 = require("./icons");
|
|
26
26
|
const Tooltip_1 = require("./Tooltip");
|
|
27
|
-
const Icons = {
|
|
28
|
-
AddComment: icons_1.AddComment,
|
|
29
|
-
EditIcon: icons_1.EditIcon,
|
|
30
|
-
};
|
|
31
27
|
const ContextMenuIconButton = (0, styled_components_1.default)(Button_1.IconButton) `
|
|
28
|
+
color: #6e6e6e;
|
|
32
29
|
&:not([disabled]):hover,
|
|
33
30
|
&:not([disabled]):focus {
|
|
34
31
|
color: #363636;
|
|
@@ -37,14 +34,18 @@ const ContextMenuIconButton = (0, styled_components_1.default)(Button_1.IconButt
|
|
|
37
34
|
}
|
|
38
35
|
`;
|
|
39
36
|
const ContextMenu = ({ actions }) => {
|
|
40
|
-
|
|
37
|
+
const IconSelector = ({ iconName }) => {
|
|
38
|
+
const icons = {
|
|
39
|
+
AddComment: icons_1.AddComment,
|
|
40
|
+
EditIcon: icons_1.EditIcon,
|
|
41
|
+
};
|
|
42
|
+
const Icon = icons[iconName];
|
|
43
|
+
return react_1.default.createElement(Icon, null);
|
|
44
|
+
};
|
|
41
45
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
46
|
react_1.default.createElement(Button_1.IconButtonGroup, null, actions.map((action) => {
|
|
43
|
-
{
|
|
44
|
-
Icon = Icons[action.icon];
|
|
45
|
-
}
|
|
46
47
|
return (react_1.default.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action },
|
|
47
|
-
react_1.default.createElement(
|
|
48
|
+
react_1.default.createElement(IconSelector, { iconName: action.icon }),
|
|
48
49
|
react_1.default.createElement(Tooltip_1.Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
49
50
|
}))));
|
|
50
51
|
};
|
|
@@ -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)}
|
|
@@ -18,11 +18,8 @@ import styled from 'styled-components';
|
|
|
18
18
|
import { IconButton, IconButtonGroup } from './Button';
|
|
19
19
|
import { AddComment, EditIcon } from './icons';
|
|
20
20
|
import { Tooltip } from './Tooltip';
|
|
21
|
-
const Icons = {
|
|
22
|
-
AddComment: AddComment,
|
|
23
|
-
EditIcon: EditIcon,
|
|
24
|
-
};
|
|
25
21
|
const ContextMenuIconButton = styled(IconButton) `
|
|
22
|
+
color: #6e6e6e;
|
|
26
23
|
&:not([disabled]):hover,
|
|
27
24
|
&:not([disabled]):focus {
|
|
28
25
|
color: #363636;
|
|
@@ -31,14 +28,18 @@ const ContextMenuIconButton = styled(IconButton) `
|
|
|
31
28
|
}
|
|
32
29
|
`;
|
|
33
30
|
export const ContextMenu = ({ actions }) => {
|
|
34
|
-
|
|
31
|
+
const IconSelector = ({ iconName }) => {
|
|
32
|
+
const icons = {
|
|
33
|
+
AddComment: AddComment,
|
|
34
|
+
EditIcon: EditIcon,
|
|
35
|
+
};
|
|
36
|
+
const Icon = icons[iconName];
|
|
37
|
+
return React.createElement(Icon, null);
|
|
38
|
+
};
|
|
35
39
|
return (React.createElement(React.Fragment, null,
|
|
36
40
|
React.createElement(IconButtonGroup, null, actions.map((action) => {
|
|
37
|
-
{
|
|
38
|
-
Icon = Icons[action.icon];
|
|
39
|
-
}
|
|
40
41
|
return (React.createElement(ContextMenuIconButton, { key: action.icon, "data-tooltip-id": action.icon, onClick: action.action },
|
|
41
|
-
React.createElement(
|
|
42
|
+
React.createElement(IconSelector, { iconName: action.icon }),
|
|
42
43
|
React.createElement(Tooltip, { id: action.icon, place: "bottom" }, action.label)));
|
|
43
44
|
}))));
|
|
44
45
|
};
|
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-LEAN-3415-3",
|
|
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",
|