@manuscripts/style-guide 1.5.0-LEAN-3180-2 → 1.5.0-LEAN-3083
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/Dialog.js +3 -3
- package/dist/cjs/components/SimpleModal.js +95 -0
- package/dist/cjs/components/StyledModal.js +3 -80
- package/dist/cjs/index.js +1 -4
- package/dist/es/components/Dialog.js +2 -2
- package/dist/es/components/SimpleModal.js +88 -0
- package/dist/es/components/StyledModal.js +3 -81
- package/dist/es/index.js +1 -4
- package/dist/types/components/Dialog.d.ts +1 -1
- package/dist/types/components/SimpleModal.d.ts +41 -0
- package/dist/types/components/StyledModal.d.ts +4 -26
- package/dist/types/index.d.ts +1 -4
- package/package.json +1 -2
- package/dist/cjs/components/AffiliationsList.js +0 -43
- package/dist/cjs/components/AuthorsContainer.js +0 -71
- package/dist/cjs/components/AuthorsList/Author.js +0 -99
- package/dist/cjs/components/AuthorsList/AuthorsList.js +0 -52
- package/dist/cjs/components/AuthorsList/index.js +0 -32
- package/dist/cjs/components/References/BibliographyItemSource.js +0 -91
- package/dist/cjs/components/References/CitationEditor.js +0 -146
- package/dist/cjs/components/References/CitationViewer.js +0 -69
- package/dist/cjs/components/References/ReferenceForm.js +0 -415
- package/dist/cjs/components/References/ReferenceLine.js +0 -52
- package/dist/cjs/components/References/ReferenceSearch.js +0 -124
- package/dist/cjs/components/References/ReferenceSearchResults.js +0 -68
- package/dist/cjs/components/References/ReferenceSearchResultsPlaceholder.js +0 -43
- package/dist/cjs/components/References/ReferenceSearchSection.js +0 -118
- package/dist/cjs/components/References/ReferencesModal.js +0 -220
- package/dist/cjs/components/References/SearchInput.js +0 -103
- package/dist/cjs/components/References/index.js +0 -20
- package/dist/cjs/components/SelectField.js +0 -25
- package/dist/cjs/components/Sidebar.js +0 -44
- package/dist/cjs/components/icons/delete-icon.js +0 -15
- package/dist/cjs/components/icons/link-icon.js +0 -11
- package/dist/cjs/components/icons/template-icon.js +0 -11
- package/dist/cjs/hooks/use-scroll-detection.js +0 -53
- package/dist/es/components/AffiliationsList.js +0 -36
- package/dist/es/components/AuthorsContainer.js +0 -41
- package/dist/es/components/AuthorsList/Author.js +0 -69
- package/dist/es/components/AuthorsList/AuthorsList.js +0 -45
- package/dist/es/components/AuthorsList/index.js +0 -16
- package/dist/es/components/References/BibliographyItemSource.js +0 -64
- package/dist/es/components/References/CitationEditor.js +0 -116
- package/dist/es/components/References/CitationViewer.js +0 -39
- package/dist/es/components/References/ReferenceForm.js +0 -385
- package/dist/es/components/References/ReferenceLine.js +0 -42
- package/dist/es/components/References/ReferenceSearch.js +0 -94
- package/dist/es/components/References/ReferenceSearchResults.js +0 -61
- package/dist/es/components/References/ReferenceSearchResultsPlaceholder.js +0 -36
- package/dist/es/components/References/ReferenceSearchSection.js +0 -88
- package/dist/es/components/References/ReferencesModal.js +0 -189
- package/dist/es/components/References/SearchInput.js +0 -73
- package/dist/es/components/References/index.js +0 -4
- package/dist/es/components/SelectField.js +0 -18
- package/dist/es/components/Sidebar.js +0 -18
- package/dist/es/components/icons/delete-icon.js +0 -8
- package/dist/es/components/icons/link-icon.js +0 -4
- package/dist/es/components/icons/template-icon.js +0 -4
- package/dist/es/hooks/use-scroll-detection.js +0 -49
- package/dist/types/components/AffiliationsList.d.ts +0 -22
- package/dist/types/components/AuthorsContainer.d.ts +0 -25
- package/dist/types/components/AuthorsList/Author.d.ts +0 -29
- package/dist/types/components/AuthorsList/AuthorsList.d.ts +0 -28
- package/dist/types/components/AuthorsList/index.d.ts +0 -16
- package/dist/types/components/References/BibliographyItemSource.d.ts +0 -38
- package/dist/types/components/References/CitationEditor.d.ts +0 -17
- package/dist/types/components/References/CitationViewer.d.ts +0 -24
- package/dist/types/components/References/ReferenceForm.d.ts +0 -35
- package/dist/types/components/References/ReferenceLine.d.ts +0 -10
- package/dist/types/components/References/ReferenceSearch.d.ts +0 -26
- package/dist/types/components/References/ReferenceSearchResults.d.ts +0 -26
- package/dist/types/components/References/ReferenceSearchResultsPlaceholder.d.ts +0 -2
- package/dist/types/components/References/ReferenceSearchSection.d.ts +0 -25
- package/dist/types/components/References/ReferencesModal.d.ts +0 -14
- package/dist/types/components/References/SearchInput.d.ts +0 -18
- package/dist/types/components/References/index.d.ts +0 -4
- package/dist/types/components/SelectField.d.ts +0 -27
- package/dist/types/components/Sidebar.d.ts +0 -2
- package/dist/types/components/icons/delete-icon.d.ts +0 -2
- package/dist/types/components/icons/link-icon.d.ts +0 -2
- package/dist/types/components/icons/template-icon.d.ts +0 -2
- package/dist/types/hooks/use-scroll-detection.d.ts +0 -22
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.Dialog = exports.Category = exports.MessageContainer = exports.
|
|
30
|
+
exports.Dialog = exports.Category = exports.MessageContainer = exports.ModalBody = void 0;
|
|
31
31
|
const AttentionRed_1 = __importDefault(require("@manuscripts/assets/react/AttentionRed"));
|
|
32
32
|
const react_1 = __importDefault(require("react"));
|
|
33
33
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
@@ -40,7 +40,7 @@ const Icon = styled_components_1.default.div `
|
|
|
40
40
|
display: inline-flex;
|
|
41
41
|
align-items: center;
|
|
42
42
|
`;
|
|
43
|
-
exports.
|
|
43
|
+
exports.ModalBody = styled_components_1.default.div `
|
|
44
44
|
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
45
45
|
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
46
46
|
background: ${(props) => props.theme.colors.background.primary};
|
|
@@ -121,7 +121,7 @@ class Dialog extends react_1.default.Component {
|
|
|
121
121
|
const { actions, isOpen, header, message, category, children, confirmFieldText, className, } = this.props;
|
|
122
122
|
const { primaryActionDisabled } = this.state;
|
|
123
123
|
return (react_1.default.createElement(StyledModal_1.StyledModal, { isOpen: isOpen, onRequestClose: actions.onClose, shouldCloseOnOverlayClick: true, className: className },
|
|
124
|
-
react_1.default.createElement(exports.
|
|
124
|
+
react_1.default.createElement(exports.ModalBody, null,
|
|
125
125
|
react_1.default.createElement(HeaderContainer, null,
|
|
126
126
|
category === Category.error && (react_1.default.createElement(Icon, null,
|
|
127
127
|
react_1.default.createElement(AttentionRed_1.default, null))),
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
exports.SimpleModal = exports.ModalMain = exports.CloseButton = exports.ModalHeader = exports.ModalContainer = void 0;
|
|
22
|
+
const react_1 = __importDefault(require("react"));
|
|
23
|
+
const react_modal_1 = __importDefault(require("react-modal"));
|
|
24
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
|
+
const Button_1 = require("./Button");
|
|
26
|
+
exports.ModalContainer = styled_components_1.default.div `
|
|
27
|
+
background: ${(props) => props.theme.colors.background.primary};
|
|
28
|
+
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
29
|
+
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
30
|
+
font-family: ${(props) => props.theme.font.family.sans};
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
margin: ${(props) => props.theme.grid.unit * 3}px;
|
|
33
|
+
`;
|
|
34
|
+
exports.ModalHeader = styled_components_1.default.div `
|
|
35
|
+
position: absolute;
|
|
36
|
+
right: 0;
|
|
37
|
+
top: 0;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
`;
|
|
40
|
+
exports.CloseButton = (0, styled_components_1.default)(Button_1.RoundIconButton) `
|
|
41
|
+
box-shadow: none;
|
|
42
|
+
text-indent: -99999px;
|
|
43
|
+
|
|
44
|
+
::before,
|
|
45
|
+
::after {
|
|
46
|
+
background-color: ${(props) => props.theme.colors.text.secondary};
|
|
47
|
+
border-radius: 2px;
|
|
48
|
+
content: ' ';
|
|
49
|
+
display: block;
|
|
50
|
+
height: 14px;
|
|
51
|
+
transform: rotate(-45deg);
|
|
52
|
+
width: 2px;
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: calc(50% - 7px);
|
|
55
|
+
left: calc(50% - 1px);
|
|
56
|
+
}
|
|
57
|
+
::after {
|
|
58
|
+
transform: rotate(45deg);
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
exports.ModalMain = styled_components_1.default.div `
|
|
62
|
+
padding: ${(props) => props.theme.grid.unit * 4}px;
|
|
63
|
+
`;
|
|
64
|
+
const SimpleModal = ({ children, closeWithOverlay, handleClose, width = 'auto', }) => (react_1.default.createElement(react_modal_1.default, { isOpen: true, onRequestClose: handleClose, shouldCloseOnOverlayClick: closeWithOverlay, appElement: document.getElementById('root'), style: {
|
|
65
|
+
overlay: {
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
68
|
+
bottom: 0,
|
|
69
|
+
display: 'flex',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
left: 0,
|
|
72
|
+
position: 'fixed',
|
|
73
|
+
right: 0,
|
|
74
|
+
top: 0,
|
|
75
|
+
},
|
|
76
|
+
content: {
|
|
77
|
+
background: 'transparent',
|
|
78
|
+
border: 'none',
|
|
79
|
+
bottom: 0,
|
|
80
|
+
left: 0,
|
|
81
|
+
margin: 'auto',
|
|
82
|
+
maxHeight: '70vh',
|
|
83
|
+
maxWidth: '70vw',
|
|
84
|
+
padding: 0,
|
|
85
|
+
position: 'relative',
|
|
86
|
+
right: 0,
|
|
87
|
+
top: 0,
|
|
88
|
+
width,
|
|
89
|
+
},
|
|
90
|
+
} },
|
|
91
|
+
react_1.default.createElement(exports.ModalContainer, null,
|
|
92
|
+
react_1.default.createElement(exports.ModalHeader, null,
|
|
93
|
+
react_1.default.createElement(exports.CloseButton, { onClick: handleClose })),
|
|
94
|
+
react_1.default.createElement(exports.ModalMain, null, children))));
|
|
95
|
+
exports.SimpleModal = SimpleModal;
|
|
@@ -29,12 +29,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29
29
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.StyledModal = exports.
|
|
32
|
+
exports.StyledModal = exports.ReactModalAdapter = void 0;
|
|
33
33
|
const react_1 = __importDefault(require("react"));
|
|
34
34
|
const react_modal_1 = __importDefault(require("react-modal"));
|
|
35
35
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
36
|
-
const Button_1 = require("./Button");
|
|
37
|
-
const Sidebar_1 = require("./Sidebar");
|
|
38
36
|
const totalTransitionTime = 800;
|
|
39
37
|
const transitionDelay = 300;
|
|
40
38
|
const delayedTransitionTime = totalTransitionTime - transitionDelay;
|
|
@@ -42,83 +40,8 @@ const ReactModalAdapter = (_a) => {
|
|
|
42
40
|
var { className, modalClassName } = _a, props = __rest(_a, ["className", "modalClassName"]);
|
|
43
41
|
return (react_1.default.createElement(react_modal_1.default, Object.assign({ className: modalClassName, portalClassName: className, closeTimeoutMS: totalTransitionTime, appElement: document.getElementById('root') }, props)));
|
|
44
42
|
};
|
|
45
|
-
exports.
|
|
46
|
-
|
|
47
|
-
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
48
|
-
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
49
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
margin: ${(props) => props.theme.grid.unit * 3}px;
|
|
52
|
-
`;
|
|
53
|
-
exports.ModalHeader = styled_components_1.default.div `
|
|
54
|
-
position: absolute;
|
|
55
|
-
right: 0;
|
|
56
|
-
top: 0;
|
|
57
|
-
z-index: 1;
|
|
58
|
-
`;
|
|
59
|
-
exports.CloseButton = (0, styled_components_1.default)(Button_1.RoundIconButton) `
|
|
60
|
-
box-shadow: none;
|
|
61
|
-
text-indent: -99999px;
|
|
62
|
-
|
|
63
|
-
::before,
|
|
64
|
-
::after {
|
|
65
|
-
background-color: ${(props) => props.theme.colors.text.secondary};
|
|
66
|
-
border-radius: 2px;
|
|
67
|
-
content: ' ';
|
|
68
|
-
display: block;
|
|
69
|
-
height: 14px;
|
|
70
|
-
transform: rotate(-45deg);
|
|
71
|
-
width: 2px;
|
|
72
|
-
position: absolute;
|
|
73
|
-
top: calc(50% - 7px);
|
|
74
|
-
left: calc(50% - 1px);
|
|
75
|
-
}
|
|
76
|
-
::after {
|
|
77
|
-
transform: rotate(45deg);
|
|
78
|
-
}
|
|
79
|
-
`;
|
|
80
|
-
exports.ModalBody = styled_components_1.default.div `
|
|
81
|
-
align-items: stretch;
|
|
82
|
-
display: flex;
|
|
83
|
-
flex: 1;
|
|
84
|
-
height: 90vh;
|
|
85
|
-
max-height: 680px;
|
|
86
|
-
`;
|
|
87
|
-
exports.ModalSidebar = styled_components_1.default.div `
|
|
88
|
-
${Sidebar_1.SidebarStyles};
|
|
89
|
-
background-color: ${(props) => props.theme.colors.background.secondary};
|
|
90
|
-
border-top-left-radius: ${(props) => props.theme.grid.radius.default};
|
|
91
|
-
border-bottom-left-radius: ${(props) => props.theme.grid.radius.default};
|
|
92
|
-
max-width: 40vw;
|
|
93
|
-
overflow: auto;
|
|
94
|
-
width: 340px;
|
|
95
|
-
`;
|
|
96
|
-
exports.ModalSidebarHeader = styled_components_1.default.div `
|
|
97
|
-
align-items: flex-start;
|
|
98
|
-
display: flex;
|
|
99
|
-
flex-shrink: 0;
|
|
100
|
-
justify-content: space-between;
|
|
101
|
-
padding: 0 ${(props) => props.theme.grid.unit * 3}px;
|
|
102
|
-
margin-bottom: ${(props) => props.theme.grid.unit * 6}px;
|
|
103
|
-
`;
|
|
104
|
-
exports.ModalSidebarTitle = styled_components_1.default.div `
|
|
105
|
-
font-size: ${(props) => props.theme.font.size.xlarge};
|
|
106
|
-
font-weight: ${(props) => props.theme.font.weight.semibold};
|
|
107
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
108
|
-
user-select: none;
|
|
109
|
-
white-space: nowrap;
|
|
110
|
-
width: 100%;
|
|
111
|
-
`;
|
|
112
|
-
exports.ModelContent = styled_components_1.default.div `
|
|
113
|
-
padding: ${(props) => props.theme.grid.unit * 4}px;
|
|
114
|
-
box-sizing: border-box;
|
|
115
|
-
max-width: 60vw;
|
|
116
|
-
width: 480px;
|
|
117
|
-
`;
|
|
118
|
-
exports.ScrollableModalContent = (0, styled_components_1.default)(exports.ModelContent) `
|
|
119
|
-
overflow-y: auto;
|
|
120
|
-
`;
|
|
121
|
-
exports.StyledModal = (0, styled_components_1.default)(ReactModalAdapter).attrs({
|
|
43
|
+
exports.ReactModalAdapter = ReactModalAdapter;
|
|
44
|
+
exports.StyledModal = (0, styled_components_1.default)(exports.ReactModalAdapter).attrs({
|
|
122
45
|
closeTimeoutMS: totalTransitionTime,
|
|
123
46
|
overlayClassName: {
|
|
124
47
|
base: 'Overlay',
|
package/dist/cjs/index.js
CHANGED
|
@@ -34,12 +34,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.errorsDecoder = exports.useDeepCompareCallback = exports.useDeepCompareMemo = void 0;
|
|
36
36
|
__exportStar(require("./components/AffiliationsEditor"), exports);
|
|
37
|
-
__exportStar(require("./components/AffiliationsList"), exports);
|
|
38
37
|
__exportStar(require("./components/AuthorForm"), exports);
|
|
39
38
|
__exportStar(require("./components/AuthorName"), exports);
|
|
40
|
-
__exportStar(require("./components/AuthorsList"), exports);
|
|
41
39
|
__exportStar(require("./components/AuthorsDND"), exports);
|
|
42
|
-
__exportStar(require("./components/AuthorsContainer"), exports);
|
|
43
40
|
__exportStar(require("./components/AlertMessage"), exports);
|
|
44
41
|
__exportStar(require("./components/Button"), exports);
|
|
45
42
|
__exportStar(require("./components/ColorField"), exports);
|
|
@@ -53,6 +50,7 @@ __exportStar(require("./components/FileManager"), exports);
|
|
|
53
50
|
__exportStar(require("./components/FileManager/util"), exports);
|
|
54
51
|
__exportStar(require("./components/Resizer"), exports);
|
|
55
52
|
__exportStar(require("./components/SaveStatus"), exports);
|
|
53
|
+
__exportStar(require("./components/SimpleModal"), exports);
|
|
56
54
|
__exportStar(require("./components/StyledModal"), exports);
|
|
57
55
|
__exportStar(require("./components/TextField"), exports);
|
|
58
56
|
__exportStar(require("./components/TextFieldContainer"), exports);
|
|
@@ -72,7 +70,6 @@ __exportStar(require("./components/Text"), exports);
|
|
|
72
70
|
__exportStar(require("./components/ManuscriptNoteList"), exports);
|
|
73
71
|
__exportStar(require("./components/Comments"), exports);
|
|
74
72
|
__exportStar(require("./components/RelativeDate"), exports);
|
|
75
|
-
__exportStar(require("./components/References"), exports);
|
|
76
73
|
__exportStar(require("./hooks/use-dropdown"), exports);
|
|
77
74
|
__exportStar(require("./hooks/use-files"), exports);
|
|
78
75
|
var use_deep_compare_1 = require("./hooks/use-deep-compare");
|
|
@@ -34,7 +34,7 @@ const Icon = styled.div `
|
|
|
34
34
|
display: inline-flex;
|
|
35
35
|
align-items: center;
|
|
36
36
|
`;
|
|
37
|
-
export const
|
|
37
|
+
export const ModalBody = styled.div `
|
|
38
38
|
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
39
39
|
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
40
40
|
background: ${(props) => props.theme.colors.background.primary};
|
|
@@ -115,7 +115,7 @@ export class Dialog extends React.Component {
|
|
|
115
115
|
const { actions, isOpen, header, message, category, children, confirmFieldText, className, } = this.props;
|
|
116
116
|
const { primaryActionDisabled } = this.state;
|
|
117
117
|
return (React.createElement(StyledModal, { isOpen: isOpen, onRequestClose: actions.onClose, shouldCloseOnOverlayClick: true, className: className },
|
|
118
|
-
React.createElement(
|
|
118
|
+
React.createElement(ModalBody, null,
|
|
119
119
|
React.createElement(HeaderContainer, null,
|
|
120
120
|
category === Category.error && (React.createElement(Icon, null,
|
|
121
121
|
React.createElement(AttentionRed, null))),
|
|
@@ -0,0 +1,88 @@
|
|
|
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 Modal from 'react-modal';
|
|
18
|
+
import styled from 'styled-components';
|
|
19
|
+
import { RoundIconButton } from './Button';
|
|
20
|
+
export const ModalContainer = styled.div `
|
|
21
|
+
background: ${(props) => props.theme.colors.background.primary};
|
|
22
|
+
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
23
|
+
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
24
|
+
font-family: ${(props) => props.theme.font.family.sans};
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
margin: ${(props) => props.theme.grid.unit * 3}px;
|
|
27
|
+
`;
|
|
28
|
+
export const ModalHeader = styled.div `
|
|
29
|
+
position: absolute;
|
|
30
|
+
right: 0;
|
|
31
|
+
top: 0;
|
|
32
|
+
z-index: 1;
|
|
33
|
+
`;
|
|
34
|
+
export const CloseButton = styled(RoundIconButton) `
|
|
35
|
+
box-shadow: none;
|
|
36
|
+
text-indent: -99999px;
|
|
37
|
+
|
|
38
|
+
::before,
|
|
39
|
+
::after {
|
|
40
|
+
background-color: ${(props) => props.theme.colors.text.secondary};
|
|
41
|
+
border-radius: 2px;
|
|
42
|
+
content: ' ';
|
|
43
|
+
display: block;
|
|
44
|
+
height: 14px;
|
|
45
|
+
transform: rotate(-45deg);
|
|
46
|
+
width: 2px;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: calc(50% - 7px);
|
|
49
|
+
left: calc(50% - 1px);
|
|
50
|
+
}
|
|
51
|
+
::after {
|
|
52
|
+
transform: rotate(45deg);
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const ModalMain = styled.div `
|
|
56
|
+
padding: ${(props) => props.theme.grid.unit * 4}px;
|
|
57
|
+
`;
|
|
58
|
+
export const SimpleModal = ({ children, closeWithOverlay, handleClose, width = 'auto', }) => (React.createElement(Modal, { isOpen: true, onRequestClose: handleClose, shouldCloseOnOverlayClick: closeWithOverlay, appElement: document.getElementById('root'), style: {
|
|
59
|
+
overlay: {
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
62
|
+
bottom: 0,
|
|
63
|
+
display: 'flex',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
left: 0,
|
|
66
|
+
position: 'fixed',
|
|
67
|
+
right: 0,
|
|
68
|
+
top: 0,
|
|
69
|
+
},
|
|
70
|
+
content: {
|
|
71
|
+
background: 'transparent',
|
|
72
|
+
border: 'none',
|
|
73
|
+
bottom: 0,
|
|
74
|
+
left: 0,
|
|
75
|
+
margin: 'auto',
|
|
76
|
+
maxHeight: '70vh',
|
|
77
|
+
maxWidth: '70vw',
|
|
78
|
+
padding: 0,
|
|
79
|
+
position: 'relative',
|
|
80
|
+
right: 0,
|
|
81
|
+
top: 0,
|
|
82
|
+
width,
|
|
83
|
+
},
|
|
84
|
+
} },
|
|
85
|
+
React.createElement(ModalContainer, null,
|
|
86
|
+
React.createElement(ModalHeader, null,
|
|
87
|
+
React.createElement(CloseButton, { onClick: handleClose })),
|
|
88
|
+
React.createElement(ModalMain, null, children))));
|
|
@@ -25,93 +25,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
25
25
|
return t;
|
|
26
26
|
};
|
|
27
27
|
import React from 'react';
|
|
28
|
-
import
|
|
28
|
+
import Modal from 'react-modal';
|
|
29
29
|
import styled from 'styled-components';
|
|
30
|
-
import { RoundIconButton } from './Button';
|
|
31
|
-
import { SidebarStyles } from './Sidebar';
|
|
32
30
|
const totalTransitionTime = 800;
|
|
33
31
|
const transitionDelay = 300;
|
|
34
32
|
const delayedTransitionTime = totalTransitionTime - transitionDelay;
|
|
35
|
-
const ReactModalAdapter = (_a) => {
|
|
33
|
+
export const ReactModalAdapter = (_a) => {
|
|
36
34
|
var { className, modalClassName } = _a, props = __rest(_a, ["className", "modalClassName"]);
|
|
37
|
-
return (React.createElement(
|
|
35
|
+
return (React.createElement(Modal, Object.assign({ className: modalClassName, portalClassName: className, closeTimeoutMS: totalTransitionTime, appElement: document.getElementById('root') }, props)));
|
|
38
36
|
};
|
|
39
|
-
export const ModalContainer = styled.div `
|
|
40
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
41
|
-
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
42
|
-
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
43
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
margin: ${(props) => props.theme.grid.unit * 3}px;
|
|
46
|
-
`;
|
|
47
|
-
export const ModalHeader = styled.div `
|
|
48
|
-
position: absolute;
|
|
49
|
-
right: 0;
|
|
50
|
-
top: 0;
|
|
51
|
-
z-index: 1;
|
|
52
|
-
`;
|
|
53
|
-
export const CloseButton = styled(RoundIconButton) `
|
|
54
|
-
box-shadow: none;
|
|
55
|
-
text-indent: -99999px;
|
|
56
|
-
|
|
57
|
-
::before,
|
|
58
|
-
::after {
|
|
59
|
-
background-color: ${(props) => props.theme.colors.text.secondary};
|
|
60
|
-
border-radius: 2px;
|
|
61
|
-
content: ' ';
|
|
62
|
-
display: block;
|
|
63
|
-
height: 14px;
|
|
64
|
-
transform: rotate(-45deg);
|
|
65
|
-
width: 2px;
|
|
66
|
-
position: absolute;
|
|
67
|
-
top: calc(50% - 7px);
|
|
68
|
-
left: calc(50% - 1px);
|
|
69
|
-
}
|
|
70
|
-
::after {
|
|
71
|
-
transform: rotate(45deg);
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
export const ModalBody = styled.div `
|
|
75
|
-
align-items: stretch;
|
|
76
|
-
display: flex;
|
|
77
|
-
flex: 1;
|
|
78
|
-
height: 90vh;
|
|
79
|
-
max-height: 680px;
|
|
80
|
-
`;
|
|
81
|
-
export const ModalSidebar = styled.div `
|
|
82
|
-
${SidebarStyles};
|
|
83
|
-
background-color: ${(props) => props.theme.colors.background.secondary};
|
|
84
|
-
border-top-left-radius: ${(props) => props.theme.grid.radius.default};
|
|
85
|
-
border-bottom-left-radius: ${(props) => props.theme.grid.radius.default};
|
|
86
|
-
max-width: 40vw;
|
|
87
|
-
overflow: auto;
|
|
88
|
-
width: 340px;
|
|
89
|
-
`;
|
|
90
|
-
export const ModalSidebarHeader = styled.div `
|
|
91
|
-
align-items: flex-start;
|
|
92
|
-
display: flex;
|
|
93
|
-
flex-shrink: 0;
|
|
94
|
-
justify-content: space-between;
|
|
95
|
-
padding: 0 ${(props) => props.theme.grid.unit * 3}px;
|
|
96
|
-
margin-bottom: ${(props) => props.theme.grid.unit * 6}px;
|
|
97
|
-
`;
|
|
98
|
-
export const ModalSidebarTitle = styled.div `
|
|
99
|
-
font-size: ${(props) => props.theme.font.size.xlarge};
|
|
100
|
-
font-weight: ${(props) => props.theme.font.weight.semibold};
|
|
101
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
102
|
-
user-select: none;
|
|
103
|
-
white-space: nowrap;
|
|
104
|
-
width: 100%;
|
|
105
|
-
`;
|
|
106
|
-
export const ModelContent = styled.div `
|
|
107
|
-
padding: ${(props) => props.theme.grid.unit * 4}px;
|
|
108
|
-
box-sizing: border-box;
|
|
109
|
-
max-width: 60vw;
|
|
110
|
-
width: 480px;
|
|
111
|
-
`;
|
|
112
|
-
export const ScrollableModalContent = styled(ModelContent) `
|
|
113
|
-
overflow-y: auto;
|
|
114
|
-
`;
|
|
115
37
|
export const StyledModal = styled(ReactModalAdapter).attrs({
|
|
116
38
|
closeTimeoutMS: totalTransitionTime,
|
|
117
39
|
overlayClassName: {
|
package/dist/es/index.js
CHANGED
|
@@ -14,12 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export * from './components/AffiliationsEditor';
|
|
17
|
-
export * from './components/AffiliationsList';
|
|
18
17
|
export * from './components/AuthorForm';
|
|
19
18
|
export * from './components/AuthorName';
|
|
20
|
-
export * from './components/AuthorsList';
|
|
21
19
|
export * from './components/AuthorsDND';
|
|
22
|
-
export * from './components/AuthorsContainer';
|
|
23
20
|
export * from './components/AlertMessage';
|
|
24
21
|
export * from './components/Button';
|
|
25
22
|
export * from './components/ColorField';
|
|
@@ -33,6 +30,7 @@ export * from './components/FileManager';
|
|
|
33
30
|
export * from './components/FileManager/util';
|
|
34
31
|
export * from './components/Resizer';
|
|
35
32
|
export * from './components/SaveStatus';
|
|
33
|
+
export * from './components/SimpleModal';
|
|
36
34
|
export * from './components/StyledModal';
|
|
37
35
|
export * from './components/TextField';
|
|
38
36
|
export * from './components/TextFieldContainer';
|
|
@@ -52,7 +50,6 @@ export * from './components/Text';
|
|
|
52
50
|
export * from './components/ManuscriptNoteList';
|
|
53
51
|
export * from './components/Comments';
|
|
54
52
|
export * from './components/RelativeDate';
|
|
55
|
-
export * from './components/References';
|
|
56
53
|
export * from './hooks/use-dropdown';
|
|
57
54
|
export * from './hooks/use-files';
|
|
58
55
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const ModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
18
|
export declare const MessageContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
19
|
interface DialogState {
|
|
20
20
|
primaryActionDisabled: boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
export declare const ModalContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
+
export declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
+
export declare const CloseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
20
|
+
type: "button" | "reset" | "submit";
|
|
21
|
+
} & {
|
|
22
|
+
danger?: boolean | undefined;
|
|
23
|
+
disabled?: boolean | undefined;
|
|
24
|
+
mini?: boolean | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
defaultColor?: boolean | undefined;
|
|
27
|
+
size?: number | undefined;
|
|
28
|
+
iconColor?: string | undefined;
|
|
29
|
+
} & {
|
|
30
|
+
defaultColor: boolean;
|
|
31
|
+
} & {
|
|
32
|
+
size?: number | undefined;
|
|
33
|
+
}, "type" | "defaultColor">;
|
|
34
|
+
export declare const ModalMain: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
35
|
+
interface Props {
|
|
36
|
+
handleClose: () => void;
|
|
37
|
+
closeWithOverlay: boolean;
|
|
38
|
+
width?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const SimpleModal: React.FunctionComponent<Props>;
|
|
41
|
+
export {};
|
|
@@ -14,35 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import
|
|
17
|
+
import Modal from 'react-modal';
|
|
18
18
|
import { ThemeProps } from 'styled-components';
|
|
19
19
|
interface Props {
|
|
20
|
-
modalClassName?:
|
|
20
|
+
modalClassName?: Modal.Classes;
|
|
21
21
|
}
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const CloseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
25
|
-
type: "button" | "reset" | "submit";
|
|
26
|
-
} & {
|
|
27
|
-
danger?: boolean | undefined;
|
|
28
|
-
disabled?: boolean | undefined;
|
|
29
|
-
mini?: boolean | undefined;
|
|
30
|
-
} & {
|
|
31
|
-
defaultColor?: boolean | undefined;
|
|
32
|
-
size?: number | undefined;
|
|
33
|
-
iconColor?: string | undefined;
|
|
34
|
-
} & {
|
|
35
|
-
defaultColor: boolean;
|
|
36
|
-
} & {
|
|
37
|
-
size?: number | undefined;
|
|
38
|
-
}, "type" | "defaultColor">;
|
|
39
|
-
export declare const ModalBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
40
|
-
export declare const ModalSidebar: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
41
|
-
export declare const ModalSidebarHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
42
|
-
export declare const ModalSidebarTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
43
|
-
export declare const ModelContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
44
|
-
export declare const ScrollableModalContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
45
|
-
export declare const StyledModal: import("styled-components").StyledComponent<React.FC<ReactModal.Props & ThemeProps<ReactModal> & Props>, import("styled-components").DefaultTheme, {
|
|
22
|
+
export declare const ReactModalAdapter: React.FunctionComponent<Modal.Props & ThemeProps<ReactModal> & Props>;
|
|
23
|
+
export declare const StyledModal: import("styled-components").StyledComponent<React.FunctionComponent<Modal.Props & ThemeProps<Modal> & Props>, import("styled-components").DefaultTheme, {
|
|
46
24
|
closeTimeoutMS: 800;
|
|
47
25
|
overlayClassName: {
|
|
48
26
|
base: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,12 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { Theme } from './theme';
|
|
17
17
|
export * from './components/AffiliationsEditor';
|
|
18
|
-
export * from './components/AffiliationsList';
|
|
19
18
|
export * from './components/AuthorForm';
|
|
20
19
|
export * from './components/AuthorName';
|
|
21
|
-
export * from './components/AuthorsList';
|
|
22
20
|
export * from './components/AuthorsDND';
|
|
23
|
-
export * from './components/AuthorsContainer';
|
|
24
21
|
export * from './components/AlertMessage';
|
|
25
22
|
export * from './components/Button';
|
|
26
23
|
export * from './components/ColorField';
|
|
@@ -34,6 +31,7 @@ export * from './components/FileManager';
|
|
|
34
31
|
export * from './components/FileManager/util';
|
|
35
32
|
export * from './components/Resizer';
|
|
36
33
|
export * from './components/SaveStatus';
|
|
34
|
+
export * from './components/SimpleModal';
|
|
37
35
|
export * from './components/StyledModal';
|
|
38
36
|
export * from './components/TextField';
|
|
39
37
|
export * from './components/TextFieldContainer';
|
|
@@ -53,7 +51,6 @@ export * from './components/Text';
|
|
|
53
51
|
export * from './components/ManuscriptNoteList';
|
|
54
52
|
export * from './components/Comments';
|
|
55
53
|
export * from './components/RelativeDate';
|
|
56
|
-
export * from './components/References';
|
|
57
54
|
export * from './hooks/use-dropdown';
|
|
58
55
|
export * from './hooks/use-files';
|
|
59
56
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
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.5.0-LEAN-
|
|
4
|
+
"version": "1.5.0-LEAN-3083",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"@manuscripts/json-schema": "2.2.1",
|
|
41
41
|
"@reach/tabs": "^0.11.2",
|
|
42
42
|
"formik": "^2.2.9",
|
|
43
|
-
"fuzzysort": "^2.0.4",
|
|
44
43
|
"date-fns": "^2.29.3",
|
|
45
44
|
"lodash-es": "^4.17.21",
|
|
46
45
|
"tooltip.js": "^1.3.3",
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|
-
exports.AffiliationsList = void 0;
|
|
22
|
-
const react_1 = __importDefault(require("react"));
|
|
23
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
const formatAddress_1 = __importDefault(require("../lib/formatAddress"));
|
|
25
|
-
const Container = styled_components_1.default.table `
|
|
26
|
-
border-collapse: collapse;
|
|
27
|
-
font: inherit;
|
|
28
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
29
|
-
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
30
|
-
`;
|
|
31
|
-
const Header = styled_components_1.default.th `
|
|
32
|
-
font-weight: ${(props) => props.theme.font.weight.normal}
|
|
33
|
-
padding: 0 4px 0 0;
|
|
34
|
-
vertical-align: top;
|
|
35
|
-
`;
|
|
36
|
-
const Body = styled_components_1.default.td `
|
|
37
|
-
padding: 0;
|
|
38
|
-
`;
|
|
39
|
-
const AffiliationsList = ({ affiliations, }) => (react_1.default.createElement(Container, null,
|
|
40
|
-
react_1.default.createElement("tbody", null, Array.from(affiliations.values()).map((affiliation, index) => (react_1.default.createElement("tr", { key: affiliation._id },
|
|
41
|
-
react_1.default.createElement(Header, null, index + 1),
|
|
42
|
-
react_1.default.createElement(Body, null, (0, formatAddress_1.default)(affiliation))))))));
|
|
43
|
-
exports.AffiliationsList = AffiliationsList;
|