@manuscripts/style-guide 3.3.15 → 3.4.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.
|
@@ -41,7 +41,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
41
41
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
42
42
|
const Button_1 = require("./Button");
|
|
43
43
|
const Icons = __importStar(require("./icons"));
|
|
44
|
-
const Tooltip_1 = require("./Tooltip");
|
|
45
44
|
const ContextMenuIconButton = (0, styled_components_1.default)(Button_1.IconButton) `
|
|
46
45
|
color: #6e6e6e;
|
|
47
46
|
&:not([disabled]).selected {
|
|
@@ -65,6 +64,6 @@ const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
|
|
|
65
64
|
}, {});
|
|
66
65
|
const ContextMenu = ({ actions }) => ((0, jsx_runtime_1.jsx)(Button_1.IconButtonGroup, { size: 32, children: actions.map((action) => {
|
|
67
66
|
const Icon = icons[action.icon];
|
|
68
|
-
return ((0, jsx_runtime_1.
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(ContextMenuIconButton, { "data-tooltip-content": action.label, onClick: action.disabled === true ? () => null : action.action, className: action.selected ? 'selected' : '', disabled: !!action.disabled, children: (0, jsx_runtime_1.jsx)(Icon, { width: 18, height: 18 }) }, action.icon));
|
|
69
68
|
}) }));
|
|
70
69
|
exports.ContextMenu = ContextMenu;
|
|
@@ -27,7 +27,6 @@ const StyledTooltipWrapper = styled_components_1.default.div `
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
`;
|
|
30
|
-
const defaultOpenEvents = ['click', 'mouseenter'];
|
|
31
30
|
const Tooltip = (props) => ((0, jsx_runtime_1.jsx)(StyledTooltipWrapper, { children: (0, jsx_runtime_1.jsx)(react_tooltip_1.Tooltip, { positionStrategy: "fixed", offset: 10, openEvents: {
|
|
32
31
|
mouseenter: true,
|
|
33
32
|
mouseover: true,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { IconButton, IconButtonGroup } from './Button';
|
|
4
4
|
import * as Icons from './icons';
|
|
5
|
-
import { Tooltip } from './Tooltip';
|
|
6
5
|
const ContextMenuIconButton = styled(IconButton) `
|
|
7
6
|
color: #6e6e6e;
|
|
8
7
|
&:not([disabled]).selected {
|
|
@@ -26,5 +25,5 @@ const icons = Object.entries(Icons).reduce((acc, [name, IconComponent]) => {
|
|
|
26
25
|
}, {});
|
|
27
26
|
export const ContextMenu = ({ actions }) => (_jsx(IconButtonGroup, { size: 32, children: actions.map((action) => {
|
|
28
27
|
const Icon = icons[action.icon];
|
|
29
|
-
return (
|
|
28
|
+
return (_jsx(ContextMenuIconButton, { "data-tooltip-content": action.label, onClick: action.disabled === true ? () => null : action.action, className: action.selected ? 'selected' : '', disabled: !!action.disabled, children: _jsx(Icon, { width: 18, height: 18 }) }, action.icon));
|
|
30
29
|
}) }));
|
|
@@ -21,7 +21,6 @@ const StyledTooltipWrapper = styled.div `
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
`;
|
|
24
|
-
const defaultOpenEvents = ['click', 'mouseenter'];
|
|
25
24
|
export const Tooltip = (props) => (_jsx(StyledTooltipWrapper, { children: _jsx(ReactTooltip, { positionStrategy: "fixed", offset: 10, openEvents: {
|
|
26
25
|
mouseenter: true,
|
|
27
26
|
mouseover: true,
|
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": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|