@manuscripts/style-guide 1.4.1 → 1.4.2

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.
@@ -56,27 +56,35 @@ const LinkSharedStyles = (0, styled_components_1.css) `
56
56
  color: inherit;
57
57
  outline: none;
58
58
 
59
- &:hover,
60
- &:focus {
61
- &,
62
- span {
63
- color: ${(props) => props.theme.colors.text.tertiary};
59
+ &:not(:disabled) {
60
+ &:hover,
61
+ &:focus {
62
+ &,
63
+ span {
64
+ color: ${(props) => props.theme.colors.text.tertiary};
65
+ }
64
66
  }
65
67
  }
66
68
  `;
67
69
  const AuthorAffiliation = styled_components_1.default.span `
68
70
  ${LinkSharedStyles}
69
71
  `;
70
- const AuthorsContainer = styled_components_1.default.a `
72
+ const AuthorsContainer = styled_components_1.default.button `
71
73
  display: inline-flex;
74
+ background: transparent;
75
+ border: 0;
76
+ font-size: 1rem;
72
77
  ${LinkSharedStyles}
73
- &:hover {
74
- text-decoration: underline;
75
- cursor: pointer;
78
+
79
+ &:not(:disabled) {
80
+ &:hover {
81
+ text-decoration: underline;
82
+ cursor: pointer !important;
83
+ }
76
84
  }
77
85
  `;
78
- const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, }) => (react_1.default.createElement("span", { key: author._id },
79
- showEditButton ? (react_1.default.createElement(AuthorsContainer, { href: "#", onClick: (e) => {
86
+ const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, disableEditButton, }) => (react_1.default.createElement("span", { key: author._id },
87
+ showEditButton ? (react_1.default.createElement(AuthorsContainer, { disabled: disableEditButton, onClick: (e) => {
80
88
  e.preventDefault();
81
89
  startEditing && startEditing();
82
90
  selectAuthor && selectAuthor(author);
@@ -46,7 +46,7 @@ const AuthorsActions = styled_components_1.default.div `
46
46
  const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (react_1.default.createElement(AuthorsContainer, { isEmpty: !authors.length },
47
47
  react_1.default.createElement("div", null, authors.map((author, index) => (react_1.default.createElement(react_1.default.Fragment, { key: author._id },
48
48
  !!index && ', ',
49
- react_1.default.createElement(Author_1.Author, { author: author, jointFirstAuthor: (0, authors_1.isJointFirstAuthor)(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton }))))),
49
+ react_1.default.createElement(Author_1.Author, { author: author, jointFirstAuthor: (0, authors_1.isJointFirstAuthor)(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
50
50
  showEditButton && startEditing && (react_1.default.createElement(AuthorsActions, null,
51
51
  react_1.default.createElement(Button_1.PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
52
52
  exports.AuthorsList = AuthorsList;
@@ -56,7 +56,7 @@ const getCapabilities = (project, profile, role, actions) => {
56
56
  accessEditor: true,
57
57
  formatArticle: !isViewer(),
58
58
  editArticle: !isViewer(),
59
- editMetadata: !(isViewer() || isAnnotator() || isProofer()),
59
+ editMetadata: !(isViewer() || isProofer()) || isAnnotator(),
60
60
  editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
61
61
  shareProject: isOwner(),
62
62
  applySaveChanges: !(isAnnotator() || isProofer()),
@@ -27,27 +27,35 @@ const LinkSharedStyles = css `
27
27
  color: inherit;
28
28
  outline: none;
29
29
 
30
- &:hover,
31
- &:focus {
32
- &,
33
- span {
34
- color: ${(props) => props.theme.colors.text.tertiary};
30
+ &:not(:disabled) {
31
+ &:hover,
32
+ &:focus {
33
+ &,
34
+ span {
35
+ color: ${(props) => props.theme.colors.text.tertiary};
36
+ }
35
37
  }
36
38
  }
37
39
  `;
38
40
  const AuthorAffiliation = styled.span `
39
41
  ${LinkSharedStyles}
40
42
  `;
41
- const AuthorsContainer = styled.a `
43
+ const AuthorsContainer = styled.button `
42
44
  display: inline-flex;
45
+ background: transparent;
46
+ border: 0;
47
+ font-size: 1rem;
43
48
  ${LinkSharedStyles}
44
- &:hover {
45
- text-decoration: underline;
46
- cursor: pointer;
49
+
50
+ &:not(:disabled) {
51
+ &:hover {
52
+ text-decoration: underline;
53
+ cursor: pointer !important;
54
+ }
47
55
  }
48
56
  `;
49
- export const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, }) => (React.createElement("span", { key: author._id },
50
- showEditButton ? (React.createElement(AuthorsContainer, { href: "#", onClick: (e) => {
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) => {
51
59
  e.preventDefault();
52
60
  startEditing && startEditing();
53
61
  selectAuthor && selectAuthor(author);
@@ -40,6 +40,6 @@ const AuthorsActions = styled.div `
40
40
  export const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (React.createElement(AuthorsContainer, { isEmpty: !authors.length },
41
41
  React.createElement("div", null, authors.map((author, index) => (React.createElement(React.Fragment, { key: author._id },
42
42
  !!index && ', ',
43
- React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton }))))),
43
+ React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
44
44
  showEditButton && startEditing && (React.createElement(AuthorsActions, null,
45
45
  React.createElement(PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
@@ -50,7 +50,7 @@ export const getCapabilities = (project, profile, role, actions) => {
50
50
  accessEditor: true,
51
51
  formatArticle: !isViewer(),
52
52
  editArticle: !isViewer(),
53
- editMetadata: !(isViewer() || isAnnotator() || isProofer()),
53
+ editMetadata: !(isViewer() || isProofer()) || isAnnotator(),
54
54
  editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
55
55
  shareProject: isOwner(),
56
56
  applySaveChanges: !(isAnnotator() || isProofer()),
@@ -21,6 +21,7 @@ interface AuthorProps {
21
21
  affiliations?: AuthorAffiliationT[];
22
22
  jointFirstAuthor: boolean;
23
23
  showEditButton?: boolean;
24
+ disableEditButton?: boolean;
24
25
  selectAuthor?: (data: Contributor) => void;
25
26
  startEditing?: () => void;
26
27
  }
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.4.1",
4
+ "version": "1.4.2",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",