@manuscripts/style-guide 1.6.2 → 1.7.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/References/BibliographyItemSource.js +91 -0
- package/dist/cjs/components/References/CitationEditor.js +146 -0
- package/dist/cjs/components/{AuthorsContainer.js → References/CitationViewer.js} +23 -25
- package/dist/cjs/components/References/ReferenceForm.js +415 -0
- package/dist/cjs/components/References/ReferenceLine.js +52 -0
- package/dist/cjs/components/References/ReferenceSearch.js +124 -0
- package/dist/cjs/components/References/ReferenceSearchResults.js +68 -0
- package/dist/cjs/components/References/ReferenceSearchResultsPlaceholder.js +43 -0
- package/dist/cjs/components/References/ReferenceSearchSection.js +118 -0
- package/dist/cjs/components/References/ReferencesModal.js +219 -0
- package/dist/cjs/components/References/SearchInput.js +103 -0
- package/dist/cjs/components/{AuthorsList → References}/index.js +4 -16
- package/dist/cjs/components/SelectField.js +25 -0
- package/dist/cjs/components/Sidebar.js +44 -0
- package/dist/cjs/components/StyledModal.js +80 -3
- package/dist/cjs/components/icons/delete-icon.js +15 -0
- package/dist/cjs/components/icons/link-icon.js +11 -0
- package/dist/cjs/components/icons/template-icon.js +11 -0
- package/dist/cjs/hooks/use-scroll-detection.js +53 -0
- package/dist/cjs/index.js +1 -4
- package/dist/es/components/Dialog.js +2 -2
- package/dist/es/components/References/BibliographyItemSource.js +64 -0
- package/dist/es/components/References/CitationEditor.js +116 -0
- package/dist/es/components/References/CitationViewer.js +39 -0
- package/dist/es/components/References/ReferenceForm.js +385 -0
- package/dist/es/components/References/ReferenceLine.js +42 -0
- package/dist/es/components/References/ReferenceSearch.js +94 -0
- package/dist/es/components/References/ReferenceSearchResults.js +61 -0
- package/dist/es/components/References/ReferenceSearchResultsPlaceholder.js +36 -0
- package/dist/es/components/References/ReferenceSearchSection.js +88 -0
- package/dist/es/components/References/ReferencesModal.js +188 -0
- package/dist/es/components/References/SearchInput.js +73 -0
- package/dist/es/components/References/index.js +4 -0
- package/dist/{types/components/AuthorsList/AuthorsList.d.ts → es/components/SelectField.js} +3 -13
- package/dist/es/components/Sidebar.js +18 -0
- package/dist/es/components/StyledModal.js +81 -3
- package/dist/es/components/icons/delete-icon.js +8 -0
- package/dist/es/components/icons/link-icon.js +4 -0
- package/dist/es/components/icons/template-icon.js +4 -0
- package/dist/es/hooks/use-scroll-detection.js +49 -0
- package/dist/es/index.js +1 -4
- package/dist/types/components/Dialog.d.ts +1 -1
- package/dist/types/components/References/BibliographyItemSource.d.ts +38 -0
- package/dist/types/components/References/CitationEditor.d.ts +18 -0
- package/dist/types/components/{AuthorsList/Author.d.ts → References/CitationViewer.d.ts} +8 -13
- package/dist/types/components/References/ReferenceForm.d.ts +35 -0
- package/dist/types/components/References/ReferenceLine.d.ts +10 -0
- package/dist/types/components/{AuthorsContainer.d.ts → References/ReferenceSearch.d.ts} +10 -9
- package/dist/types/components/References/ReferenceSearchResults.d.ts +26 -0
- package/dist/types/components/References/ReferenceSearchResultsPlaceholder.d.ts +2 -0
- package/dist/types/components/References/ReferenceSearchSection.d.ts +25 -0
- package/dist/types/components/References/ReferencesModal.d.ts +14 -0
- package/dist/{es/components/AuthorsList/index.js → types/components/References/SearchInput.d.ts} +4 -2
- package/dist/types/components/References/index.d.ts +4 -0
- package/dist/types/components/{AffiliationsList.d.ts → SelectField.d.ts} +9 -4
- package/dist/types/components/Sidebar.d.ts +2 -0
- package/dist/types/components/StyledModal.d.ts +26 -4
- package/dist/types/components/icons/delete-icon.d.ts +2 -0
- package/dist/types/components/icons/link-icon.d.ts +2 -0
- package/dist/types/components/icons/template-icon.d.ts +2 -0
- package/dist/types/{components/AuthorsList/index.d.ts → hooks/use-scroll-detection.d.ts} +8 -2
- package/dist/types/index.d.ts +1 -4
- package/package.json +3 -2
- package/dist/cjs/components/AffiliationsList.js +0 -43
- package/dist/cjs/components/AuthorsList/Author.js +0 -99
- package/dist/cjs/components/AuthorsList/AuthorsList.js +0 -52
- package/dist/cjs/components/SimpleModal.js +0 -95
- 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/SimpleModal.js +0 -88
- package/dist/types/components/SimpleModal.d.ts +0 -41
|
@@ -1,95 +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.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;
|
|
@@ -1,36 +0,0 @@
|
|
|
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 styled from 'styled-components';
|
|
18
|
-
import formatAddress from '../lib/formatAddress';
|
|
19
|
-
const Container = styled.table `
|
|
20
|
-
border-collapse: collapse;
|
|
21
|
-
font: inherit;
|
|
22
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
23
|
-
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
24
|
-
`;
|
|
25
|
-
const Header = styled.th `
|
|
26
|
-
font-weight: ${(props) => props.theme.font.weight.normal}
|
|
27
|
-
padding: 0 4px 0 0;
|
|
28
|
-
vertical-align: top;
|
|
29
|
-
`;
|
|
30
|
-
const Body = styled.td `
|
|
31
|
-
padding: 0;
|
|
32
|
-
`;
|
|
33
|
-
export const AffiliationsList = ({ affiliations, }) => (React.createElement(Container, null,
|
|
34
|
-
React.createElement("tbody", null, Array.from(affiliations.values()).map((affiliation, index) => (React.createElement("tr", { key: affiliation._id },
|
|
35
|
-
React.createElement(Header, null, index + 1),
|
|
36
|
-
React.createElement(Body, null, formatAddress(affiliation))))))));
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2021 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, { useMemo } from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
import { AffiliationsList } from './AffiliationsList';
|
|
19
|
-
import { AuthorsList } from './AuthorsList';
|
|
20
|
-
export const AuthorsContainer = ({ authorData, showEditButton, startEditing, selectAuthor, disableEditButton, }) => {
|
|
21
|
-
const authorAffiliations = useMemo(() => authorData.authors.filter((author) => author.role === 'author'), [authorData.authors]);
|
|
22
|
-
const isThereJointContributor = useMemo(() => authorData.authors.find((contributor) => contributor.isJointContributor), [authorData.authors]);
|
|
23
|
-
return (React.createElement(Container, { "data-cy": 'author-container' },
|
|
24
|
-
React.createElement(AuthorsList, { authors: authorAffiliations, authorAffiliations: authorData.authorAffiliations, startEditing: startEditing, showEditButton: showEditButton, selectAuthor: selectAuthor, disableEditButton: disableEditButton }),
|
|
25
|
-
React.createElement(AffiliationsList, { affiliations: authorData.affiliations }),
|
|
26
|
-
isThereJointContributor && (React.createElement(LegendWrapper, null,
|
|
27
|
-
React.createElement(Legend, null, "\u2020"),
|
|
28
|
-
"These authors contributed equally to this work."))));
|
|
29
|
-
};
|
|
30
|
-
const Container = styled.div `
|
|
31
|
-
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
32
|
-
`;
|
|
33
|
-
const LegendWrapper = styled.p `
|
|
34
|
-
margin: ${(props) => props.theme.grid.unit * 4}px 0 0 0;
|
|
35
|
-
`;
|
|
36
|
-
const Legend = styled.span `
|
|
37
|
-
display: inline-block;
|
|
38
|
-
font-size: 0.75em;
|
|
39
|
-
line-height: 1;
|
|
40
|
-
vertical-align: top;
|
|
41
|
-
`;
|
|
@@ -1,69 +0,0 @@
|
|
|
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 styled, { css } from 'styled-components';
|
|
18
|
-
import { AuthorName } from '../AuthorName';
|
|
19
|
-
const AuthorNotes = styled.span `
|
|
20
|
-
display: inline-block;
|
|
21
|
-
font-size: 0.75em;
|
|
22
|
-
line-height: 1;
|
|
23
|
-
vertical-align: top;
|
|
24
|
-
`;
|
|
25
|
-
const LinkSharedStyles = css `
|
|
26
|
-
text-decoration: none;
|
|
27
|
-
color: inherit;
|
|
28
|
-
outline: none;
|
|
29
|
-
|
|
30
|
-
&:not(:disabled) {
|
|
31
|
-
&:hover,
|
|
32
|
-
&:focus {
|
|
33
|
-
&,
|
|
34
|
-
span {
|
|
35
|
-
color: ${(props) => props.theme.colors.text.tertiary};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
const AuthorAffiliation = styled.span `
|
|
41
|
-
${LinkSharedStyles}
|
|
42
|
-
`;
|
|
43
|
-
const AuthorsContainer = styled.button `
|
|
44
|
-
display: inline-flex;
|
|
45
|
-
background: transparent;
|
|
46
|
-
border: 0;
|
|
47
|
-
font-size: 1rem;
|
|
48
|
-
${LinkSharedStyles}
|
|
49
|
-
|
|
50
|
-
&:not(:disabled) {
|
|
51
|
-
&:hover {
|
|
52
|
-
text-decoration: underline;
|
|
53
|
-
cursor: pointer !important;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
export const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, disableEditButton, }) => (React.createElement("span", { key: author._id },
|
|
58
|
-
showEditButton ? (React.createElement(AuthorsContainer, { disabled: disableEditButton, onClick: (e) => {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
startEditing && startEditing();
|
|
61
|
-
selectAuthor && selectAuthor(author);
|
|
62
|
-
} },
|
|
63
|
-
React.createElement(AuthorName, { name: author.bibliographicName, email: (author.isCorresponding && author.email) || undefined }))) : (React.createElement(AuthorName, { name: author.bibliographicName, email: (author.isCorresponding && author.email) || undefined })),
|
|
64
|
-
affiliations && (React.createElement(AuthorNotes, null, affiliations.map((affiliation, index) => (React.createElement(React.Fragment, { key: affiliation.data._id },
|
|
65
|
-
!!index && ',',
|
|
66
|
-
React.createElement(AuthorAffiliation, null, affiliation.ordinal)))))),
|
|
67
|
-
author.isCorresponding && (React.createElement(AuthorNotes, { title: 'Corresponding author' }, "*")),
|
|
68
|
-
jointFirstAuthor && (React.createElement(AuthorNotes, { title: 'Joint contributor' }, "\u2020"))));
|
|
69
|
-
export default Author;
|
|
@@ -1,45 +0,0 @@
|
|
|
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 styled from 'styled-components';
|
|
18
|
-
import { isJointFirstAuthor } from '../../lib/authors';
|
|
19
|
-
import { PrimaryButton } from '../Button';
|
|
20
|
-
import { Author } from './Author';
|
|
21
|
-
const AuthorsContainer = styled.div `
|
|
22
|
-
align-items: center;
|
|
23
|
-
display: flex;
|
|
24
|
-
|
|
25
|
-
@media (min-width: 768px) {
|
|
26
|
-
& ${PrimaryButton} {
|
|
27
|
-
display: ${(props) => (props.isEmpty ? 'initial' : 'none')};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&:hover ${PrimaryButton} {
|
|
31
|
-
display: initial;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
const AuthorsActions = styled.div `
|
|
36
|
-
align-items: center;
|
|
37
|
-
display: flex;
|
|
38
|
-
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
|
39
|
-
`;
|
|
40
|
-
export const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (React.createElement(AuthorsContainer, { isEmpty: !authors.length },
|
|
41
|
-
React.createElement("div", null, authors.map((author, index) => (React.createElement(React.Fragment, { key: author._id },
|
|
42
|
-
!!index && ', ',
|
|
43
|
-
React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
|
|
44
|
-
showEditButton && startEditing && (React.createElement(AuthorsActions, null,
|
|
45
|
-
React.createElement(PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
|
|
@@ -1,88 +0,0 @@
|
|
|
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))));
|
|
@@ -1,41 +0,0 @@
|
|
|
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 {};
|