@manuscripts/body-editor 3.18.1 → 3.18.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.
@@ -13,7 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { DeleteIcon, FormContainer, FormRow, Label, PrimaryButton, SecondaryButton, TextField, InputErrorText, withFocusTrap, } from '@manuscripts/style-guide';
16
+ import { DeleteIcon, FormContainer, FormRow, Label, TextField, InputErrorText, withFocusTrap, } from '@manuscripts/style-guide';
17
+ import { Button } from '@manuscripts/style-guide/mui';
17
18
  import React, { useCallback, useState } from 'react';
18
19
  import styled from 'styled-components';
19
20
  import { allowedHref } from '../../lib/url';
@@ -31,7 +32,7 @@ const ActionGroup = styled.span `
31
32
  margin-right: 4px;
32
33
  }
33
34
  `;
34
- const RemoveButton = styled(SecondaryButton) `
35
+ const RemoveButton = styled(Button) `
35
36
  display: flex;
36
37
  justify-content: space-between;
37
38
  align-items: center;
@@ -117,10 +118,10 @@ export const LinkForm = ({ onCancel, onRemove, onSave, value, }) => {
117
118
  React.createElement(TextField, { type: 'text', name: 'title', value: title, autoComplete: 'off', required: false, onChange: (e) => setTitle(e.target.value) })),
118
119
  React.createElement(Actions, null,
119
120
  React.createElement(ActionGroup, null,
120
- React.createElement(RemoveButton, { type: 'button', onClick: onRemove },
121
+ React.createElement(RemoveButton, { variant: "secondary", type: 'button', onClick: onRemove },
121
122
  React.createElement(DeleteIcon, null),
122
123
  React.createElement("span", null, "Remove Link"))),
123
124
  React.createElement(ActionGroup, null,
124
- React.createElement(SecondaryButton, { type: 'button', onClick: onCancel }, "Cancel"),
125
- React.createElement(PrimaryButton, { type: 'submit' }, "Save"))))));
125
+ React.createElement(Button, { variant: "secondary", type: 'button', onClick: onCancel }, "Cancel"),
126
+ React.createElement(Button, { type: 'submit' }, "Save"))))));
126
127
  };
@@ -1,4 +1,5 @@
1
- import { Category, DeleteIcon, Dialog, IconTextButton, PlusIcon, } from '@manuscripts/style-guide';
1
+ import { Category, DeleteIcon, Dialog, PlusIcon, } from '@manuscripts/style-guide';
2
+ import { Button } from '@manuscripts/style-guide/mui';
2
3
  import { skipTracking } from '@manuscripts/track-changes-plugin';
3
4
  import { schema } from '@manuscripts/transform';
4
5
  import { CellSelection, deleteColumn, deleteRow, mergeCells, selectedRect, splitCell, } from 'prosemirror-tables';
@@ -52,45 +53,45 @@ export const ContextMenu = ({ view, close, onCancelColumnDialog }) => {
52
53
  }
53
54
  };
54
55
  return (React.createElement(MenuDropdownList, { className: 'table-ctx' },
55
- React.createElement(ActionButton, { disabled: isHeaderCellSelected(view.state), onClick: () => runCommand(addRows('top')) },
56
+ React.createElement(ActionButton, { variant: "tertiary", disabled: isHeaderCellSelected(view.state), onClick: () => runCommand(addRows('top')) },
56
57
  React.createElement(PlusIcon, null),
57
58
  " Insert ",
58
59
  rows,
59
60
  " above"),
60
- React.createElement(ActionButton, { onClick: () => runCommand(addRows('bottom')) },
61
+ React.createElement(ActionButton, { variant: "tertiary", onClick: () => runCommand(addRows('bottom')) },
61
62
  React.createElement(PlusIcon, null),
62
63
  " Insert ",
63
64
  rows,
64
65
  " below"),
65
- React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('left')) },
66
+ React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('left')) },
66
67
  React.createElement(PlusIcon, null),
67
68
  " Insert ",
68
69
  columns,
69
70
  " to the left"),
70
- React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('right')) },
71
+ React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setColumnAction, () => addColumns('right')) },
71
72
  React.createElement(PlusIcon, null),
72
73
  " Insert ",
73
74
  columns,
74
75
  " to the right"),
75
76
  React.createElement(Separator, null),
76
- React.createElement(ActionButton, { disabled: count.rows !== 1, onClick: () => runCommand(addHeaderRow(headerPosition)) },
77
+ React.createElement(ActionButton, { variant: "tertiary", disabled: count.rows !== 1, onClick: () => runCommand(addHeaderRow(headerPosition)) },
77
78
  React.createElement(PlusIcon, null),
78
79
  " Insert header row ",
79
80
  headerPosition),
80
81
  React.createElement(Separator, null),
81
- React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setRowDeleteAction, () => deleteRow) },
82
+ React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setRowDeleteAction, () => deleteRow) },
82
83
  React.createElement(GrayDeleteIcon, null),
83
84
  " Delete",
84
85
  isHeaderCellSelected(view.state) ? ' header ' : '',
85
86
  " ",
86
87
  rows),
87
- React.createElement(ActionButton, { onClick: () => showWarningForTCPlugin(setColumnAction, () => deleteColumn) },
88
+ React.createElement(ActionButton, { variant: "tertiary", onClick: () => showWarningForTCPlugin(setColumnAction, () => deleteColumn) },
88
89
  React.createElement(GrayDeleteIcon, null),
89
90
  " Delete ",
90
91
  columns),
91
92
  (isCellSelectionMerged || isCellSelectionSplittable) && React.createElement(Separator, null),
92
- isCellSelectionMerged && (React.createElement(ActionButton, { onClick: () => runCommand(mergeCells, true) }, "Merge cells")),
93
- isCellSelectionSplittable && (React.createElement(ActionButton, { onClick: () => runCommand(splitCell, true) }, "Split cells")),
93
+ isCellSelectionMerged && (React.createElement(ActionButton, { variant: "tertiary", onClick: () => runCommand(mergeCells, true) }, "Merge cells")),
94
+ isCellSelectionSplittable && (React.createElement(ActionButton, { variant: "tertiary", onClick: () => runCommand(splitCell, true) }, "Split cells")),
94
95
  React.createElement(TableChangeWarningDialog, { isOpen: !!rowDeleteAction, primaryAction: () => {
95
96
  if (rowDeleteAction) {
96
97
  runCommand(rowDeleteAction, true);
@@ -111,12 +112,11 @@ const MenuDropdownList = styled.div `
111
112
  display: flex;
112
113
  flex-direction: column;
113
114
  `;
114
- const ActionButton = styled(IconTextButton) `
115
- padding: 8px 16px;
116
- justify-content: flex-start;
117
-
118
- &:hover {
119
- background: #f2fbfc;
115
+ const ActionButton = styled(Button) `
116
+ && {
117
+ padding: 8px 16px;
118
+ justify-content: flex-start;
119
+ width: 100%;
120
120
  }
121
121
  &:disabled {
122
122
  color: #353535;
@@ -17,7 +17,7 @@ import { AddCommentIcon, FileImageIcon, LinkIcon, OutlineBlockQuoteIcon, Outline
17
17
  import { schema } from '@manuscripts/transform';
18
18
  import { toggleMark } from 'prosemirror-commands';
19
19
  import React from 'react';
20
- import { addInlineComment, blockActive, canInsert, canInsertCrossReference, insertBlock, insertBoxElement, insertCrossReference, insertEmbed, insertInlineCitation, insertLink, insertList, markActive, } from './commands';
20
+ import { addInlineComment, blockActive, canInsert, canInsertCrossReference, canInsertInlineComment, insertBlock, insertBoxElement, insertCrossReference, insertEmbed, insertInlineCitation, insertLink, insertList, markActive, } from './commands';
21
21
  import { changeIndentation, isIndentationAllowed, } from './components/toolbar/helpers';
22
22
  import { openInsertTableDialog } from './components/toolbar/InsertTableDialog';
23
23
  import { openInsertSpecialCharacterDialog } from './components/views/InsertSpecialCharacter';
@@ -110,7 +110,7 @@ export const toolbar = {
110
110
  comment: {
111
111
  title: 'Insert comment',
112
112
  content: React.createElement(AddCommentIcon, null),
113
- isEnabled: isEnabled(canInsert(schema.nodes.highlight_marker)),
113
+ isEnabled: isEnabled((state) => canInsertInlineComment(state.selection.$from)),
114
114
  run: addInlineComment,
115
115
  },
116
116
  cross_reference: {
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.18.1';
1
+ export const VERSION = '3.18.3';
2
2
  export const MATHJAX_VERSION = '3.2.2';
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { MuiThemeProvider, muiTheme } from '@manuscripts/style-guide/mui';
16
17
  import React from 'react';
17
18
  import { flushSync } from 'react-dom';
18
19
  import { createRoot } from 'react-dom/client';
@@ -40,8 +41,9 @@ function createView(props, Component, componentProps, node, getPos, view, classN
40
41
  }).setSelection(selection.map(tr.doc, tr.mapping));
41
42
  view.dispatch(tr);
42
43
  };
43
- return (React.createElement(ThemeProvider, { theme: props.theme },
44
- React.createElement(Component, { nodeAttrs: node.attrs, setNodeAttrs: setNodeAttrs, viewProps: { node, view, getPos }, container: container, ...props, ...componentProps })));
44
+ return (React.createElement(MuiThemeProvider, { theme: muiTheme },
45
+ React.createElement(ThemeProvider, { theme: props.theme },
46
+ React.createElement(Component, { nodeAttrs: node.attrs, setNodeAttrs: setNodeAttrs, viewProps: { node, view, getPos }, container: container, ...props, ...componentProps }))));
45
47
  };
46
48
  return Wrapped;
47
49
  }
@@ -83,6 +83,7 @@ export type TableConfig = {
83
83
  };
84
84
  export declare const createAndFillTableElement: (attrs?: Attrs, config?: TableConfig) => import("prosemirror-model").Node;
85
85
  export declare const addNodeComment: (node: ManuscriptNode, state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
86
+ export declare const canInsertInlineComment: ($pos: ResolvedPos) => boolean;
86
87
  export declare const addInlineComment: (state: ManuscriptEditorState, dispatch?: Dispatch) => boolean;
87
88
  export declare const addRows: (direction: "top" | "bottom") => (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
88
89
  export declare const addHeaderRow: (direction: "above" | "below") => (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean;
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.18.1";
1
+ export declare const VERSION = "3.18.3";
2
2
  export declare const MATHJAX_VERSION = "3.2.2";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/body-editor",
3
3
  "description": "Prosemirror components for editing and viewing manuscripts",
4
- "version": "3.18.1",
4
+ "version": "3.18.3",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-body-editor",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -41,7 +41,7 @@
41
41
  "@citation-js/plugin-pubmed": "0.3.0",
42
42
  "@citation-js/plugin-ris": "0.7.18",
43
43
  "@iarna/word-count": "1.1.2",
44
- "@manuscripts/style-guide": "3.7.2",
44
+ "@manuscripts/style-guide": "3.7.3",
45
45
  "@manuscripts/track-changes-plugin": "2.4.0",
46
46
  "@manuscripts/transform": "4.5.6",
47
47
  "@popperjs/core": "2.11.8",
package/src/commands.ts CHANGED
@@ -1942,6 +1942,13 @@ export const addNodeComment = (
1942
1942
  return false
1943
1943
  }
1944
1944
 
1945
+ export const canInsertInlineComment = ($pos: ResolvedPos) =>
1946
+ $pos.parent.canReplaceWith(
1947
+ $pos.index(),
1948
+ $pos.index(),
1949
+ schema.nodes.highlight_marker
1950
+ )
1951
+
1945
1952
  export const addInlineComment = (
1946
1953
  state: ManuscriptEditorState,
1947
1954
  dispatch?: Dispatch
@@ -1951,6 +1958,11 @@ export const addInlineComment = (
1951
1958
  if (!node) {
1952
1959
  return false
1953
1960
  }
1961
+
1962
+ if (!canInsertInlineComment(selection.$from)) {
1963
+ return false
1964
+ }
1965
+
1954
1966
  let from = selection.from
1955
1967
  let to = selection.to
1956
1968
 
@@ -19,11 +19,9 @@ import {
19
19
  DeleteSolidIcon,
20
20
  Dialog,
21
21
  EditIcon,
22
- IconButton,
23
- PrimaryButton,
24
- SecondaryButton,
25
22
  withFocusTrap,
26
23
  } from '@manuscripts/style-guide'
24
+ import { Button, IconButton } from '@manuscripts/style-guide/mui'
27
25
  import {
28
26
  BibliographyItemAttrs,
29
27
  generateNodeID,
@@ -46,35 +44,6 @@ const CitedItemActions = styled.div`
46
44
  display: flex;
47
45
  align-items: center;
48
46
  margin-left: 12px;
49
-
50
- svg.remove-icon {
51
- color: #6e6e6e;
52
- }
53
- `
54
-
55
- const ActionButton = styled(IconButton).attrs({
56
- $size: 24,
57
- })`
58
- &:disabled {
59
- background-color: transparent !important;
60
- border-color: transparent !important;
61
- color: rgb(255, 255, 255);
62
- path,
63
- g {
64
- fill: ${(props) => props.theme.colors.background.tertiary} !important;
65
- }
66
- }
67
- &:not(:disabled):focus,
68
- &:not(:disabled):hover {
69
- path,
70
- g {
71
- fill: ${(props) => props.theme.colors.brand.medium} !important;
72
- }
73
- }
74
- `
75
-
76
- const EditReferenceButton = styled(ActionButton)`
77
- margin-right: ${(props) => props.theme.grid.unit * 3}px;
78
47
  `
79
48
 
80
49
  const Actions = styled(ButtonGroup)`
@@ -261,31 +230,34 @@ export const CitationEditor: React.FC<CitationEditorProps> = ({
261
230
  />
262
231
  <CitedItems>
263
232
  {cited.map((item) => (
264
- <CitedItem key={item.id}>
233
+ <CitedItem key={item.id} data-cy="cited-item">
265
234
  <ReferenceLine item={item} />
266
235
  <CitedItemActions>
267
- <EditReferenceButton
236
+ <IconButton
268
237
  value={item.id}
269
238
  disabled={!canEdit}
270
239
  onClick={() => setEditingForm({ show: true, item: item })}
271
240
  >
272
- <EditIcon />
273
- </EditReferenceButton>
274
- <ActionButton
241
+ <EditIcon fill={'currentColor'} />
242
+ </IconButton>
243
+ <IconButton
244
+ data-cy="remove-citation"
275
245
  disabled={!canEdit}
276
246
  onClick={() => setDeleteDialog({ show: true, id: item.id })}
277
247
  >
278
- <DeleteSolidIcon className={'remove-icon'} />
279
- </ActionButton>
248
+ <DeleteSolidIcon fill={'currentColor'} />
249
+ </IconButton>
280
250
  </CitedItemActions>
281
251
  </CitedItem>
282
252
  ))}
283
253
  </CitedItems>
284
254
  <Actions>
285
- <SecondaryButton onClick={onCancel}>Done</SecondaryButton>
286
- <PrimaryButton disabled={!canEdit} onClick={() => setSearching(true)}>
255
+ <Button variant="secondary" onClick={onCancel}>
256
+ Done
257
+ </Button>
258
+ <Button disabled={!canEdit} onClick={() => setSearching(true)}>
287
259
  Add Citation
288
- </PrimaryButton>
260
+ </Button>
289
261
  </Actions>
290
262
  </Container>
291
263
  )
@@ -17,12 +17,11 @@ import {
17
17
  DotsIcon,
18
18
  DropdownList,
19
19
  getFileIcon,
20
- IconButton,
21
- IconTextButton,
22
20
  TriangleCollapsedIcon,
23
21
  UploadIcon,
24
22
  useDropdown,
25
23
  } from '@manuscripts/style-guide'
24
+ import { Button, IconButton } from '@manuscripts/style-guide/mui'
26
25
  import { FigureNode } from '@manuscripts/transform'
27
26
  import { Node as ManuscriptNode } from 'prosemirror-model'
28
27
  import React, { SyntheticEvent, useCallback, useEffect, useRef } from 'react'
@@ -140,6 +139,7 @@ function getOtherFiles(
140
139
 
141
140
  type WrappedProps = FigureOptionsProps & ReactViewComponentProps<FigureNode>
142
141
 
142
+ // TODO: To be refactored with the new dropdown component
143
143
  export const FigureOptions: React.FC<WrappedProps> = ({
144
144
  can,
145
145
  getDoc,
@@ -221,7 +221,10 @@ export const FigureOptions: React.FC<WrappedProps> = ({
221
221
  ref={dropdownRef}
222
222
  >
223
223
  {showReplace && isEmbedMode && (
224
- <ListItemButton onClick={() => onReplaceEmbed && onReplaceEmbed()}>
224
+ <ListItemButton
225
+ variant="tertiary"
226
+ onClick={() => onReplaceEmbed && onReplaceEmbed()}
227
+ >
225
228
  Edit Link
226
229
  </ListItemButton>
227
230
  )}
@@ -236,6 +239,7 @@ export const FigureOptions: React.FC<WrappedProps> = ({
236
239
  {getSupplements(getFiles, getDoc, groupFiles, isEmbed).map(
237
240
  (file, index) => (
238
241
  <ListItemButton
242
+ variant="tertiary"
239
243
  key={file.id}
240
244
  id={index.toString()}
241
245
  onClick={() => onReplace && onReplace(file, true)}
@@ -248,6 +252,7 @@ export const FigureOptions: React.FC<WrappedProps> = ({
248
252
  {getOtherFiles(getFiles, getDoc, groupFiles, isEmbed).map(
249
253
  (file, index) => (
250
254
  <ListItemButton
255
+ variant="tertiary"
251
256
  key={file.id}
252
257
  id={index.toString()}
253
258
  onClick={() => onReplace && onReplace(file)}
@@ -258,7 +263,11 @@ export const FigureOptions: React.FC<WrappedProps> = ({
258
263
  )
259
264
  )}
260
265
  {showUpload && (
261
- <UploadButton onClick={onUpload} disabled={!showUpload}>
266
+ <UploadButton
267
+ variant="tertiary"
268
+ onClick={onUpload}
269
+ disabled={!showUpload}
270
+ >
262
271
  <UploadIcon /> Upload new...
263
272
  </UploadButton>
264
273
  )}
@@ -267,17 +276,27 @@ export const FigureOptions: React.FC<WrappedProps> = ({
267
276
  />
268
277
  )}
269
278
  {showDownload && (
270
- <ListItemButton onClick={onDownload} disabled={!showDownload}>
279
+ <ListItemButton
280
+ variant="tertiary"
281
+ onClick={onDownload}
282
+ disabled={!showDownload}
283
+ >
271
284
  Download
272
285
  </ListItemButton>
273
286
  )}
274
287
  {showDetach && (
275
- <ListItemButton onClick={onDetach} disabled={!showDetach}>
288
+ <ListItemButton
289
+ variant="tertiary"
290
+ onClick={onDetach}
291
+ disabled={!showDetach}
292
+ >
276
293
  Detach
277
294
  </ListItemButton>
278
295
  )}
279
296
  {showDelete() && (
280
- <ListItemButton onClick={onDelete}>Delete</ListItemButton>
297
+ <ListItemButton variant="tertiary" onClick={onDelete}>
298
+ Delete
299
+ </ListItemButton>
281
300
  )}
282
301
  </OptionsDropdownList>
283
302
  )}
@@ -315,6 +334,7 @@ const NestedDropdown: React.FC<{
315
334
  return (
316
335
  <DropdownWrapper ref={wrapperRef}>
317
336
  <NestedListButton
337
+ variant="tertiary"
318
338
  className="nested-list-button"
319
339
  onClick={toggleOpen}
320
340
  disabled={disabled}
@@ -352,26 +372,18 @@ const OptionsDropdownList = styled(DropdownList)`
352
372
  right: 4%;
353
373
  `
354
374
 
355
- const OptionsButton = styled(IconButton)`
356
- border: 1px solid #e2e2e2 !important;
357
- box-sizing: border-box;
358
- border-radius: 50%;
359
- width: ${(props) => props.theme.grid.unit * 6}px;
360
- height: ${(props) => props.theme.grid.unit * 6}px;
361
- margin: ${(props) => props.theme.grid.unit}px;
362
- visibility: hidden;
363
- background: #ffffff;
364
-
365
- &:hover {
366
- background: #f2fbfc !important;
367
- border: 1px solid #e2e2e2 !important;
375
+ const OptionsButton = styled(IconButton).attrs({
376
+ size: 'small',
377
+ bordered: true,
378
+ })`
379
+ && {
380
+ margin: ${(props) => props.theme.grid.unit}px;
381
+ visibility: hidden;
382
+ background: #ffffff;
368
383
  }
369
384
 
370
385
  &:active,
371
386
  &:focus {
372
- background: #f2fbfc !important;
373
- border: 1px solid #e2e2e2 !important;
374
-
375
387
  circle {
376
388
  fill: #1a9bc7;
377
389
  }
@@ -382,14 +394,12 @@ const OptionsButton = styled(IconButton)`
382
394
  }
383
395
  `
384
396
 
385
- const ListItemButton = styled(IconTextButton)`
386
- padding: 16px 14px;
387
- justify-content: space-between;
388
- align-items: center;
389
-
390
- &:hover,
391
- &:focus-visible {
392
- background: #f2fbfc;
397
+ const ListItemButton = styled(Button)`
398
+ && {
399
+ padding: 16px 14px;
400
+ justify-content: space-between;
401
+ align-items: center;
402
+ width: 100%;
393
403
  }
394
404
 
395
405
  &:is([disabled]) {
@@ -423,12 +433,12 @@ const NestedListDropdownList = styled(DropdownList)<{ $moveLeft?: boolean }>`
423
433
  ${(props) => (props.$moveLeft && 'right: 30%;') || 'left: 100%;'}
424
434
  `
425
435
 
426
- const UploadButton = styled(IconTextButton)`
427
- border-top: 1px solid #f2f2f2;
428
- padding: ${(props) => props.theme.grid.unit * 4}px;
429
- justify-content: flex-start;
430
-
431
- &:focus-visible {
432
- background: #f2fbfc;
436
+ const UploadButton = styled(Button)`
437
+ && {
438
+ border-top: 1px solid #f2f2f2;
439
+ padding: ${(props) => props.theme.grid.unit * 4}px;
440
+ justify-content: flex-start;
441
+ width: 100%;
442
+ border-radius: 0;
433
443
  }
434
444
  `
@@ -19,13 +19,11 @@ import {
19
19
  AddIcon,
20
20
  AddNewIcon,
21
21
  ButtonGroup,
22
- IconTextButton,
23
- PrimaryButton,
24
- SecondaryButton,
25
22
  withFocusTrap,
26
23
  withListNavigation,
27
24
  withNavigableListItem,
28
25
  } from '@manuscripts/style-guide'
26
+ import { Button } from '@manuscripts/style-guide/mui'
29
27
  import { isDeleted } from '@manuscripts/track-changes-plugin'
30
28
  import { FootnoteNode, InlineFootnoteNode } from '@manuscripts/transform'
31
29
  import React, { useState } from 'react'
@@ -131,19 +129,20 @@ export const FootnotesSelector: React.FC<FootnotesSelectorProps> = ({
131
129
  </NotesContainer>
132
130
  <Actions>
133
131
  <AddNewFootnote>
134
- <IconTextButton onClick={onAdd}>
135
- <AddNewIcon />
132
+ <Button variant="tertiary" onClick={onAdd} startIcon={<AddNewIcon />}>
136
133
  Add new
137
- </IconTextButton>
134
+ </Button>
138
135
  </AddNewFootnote>
139
136
  <ButtonGroup>
140
- <SecondaryButton onClick={onCancel}>Cancel</SecondaryButton>
141
- <PrimaryButton
137
+ <Button variant="secondary" onClick={onCancel}>
138
+ Cancel
139
+ </Button>
140
+ <Button
142
141
  onClick={handleClick}
143
142
  disabled={selections.size === 0 && !inlineFootnote}
144
143
  >
145
144
  {inlineFootnote ? 'Update' : 'Insert'}
146
- </PrimaryButton>
145
+ </Button>
147
146
  </ButtonGroup>
148
147
  </Actions>
149
148
  </Container>
@@ -19,12 +19,11 @@ import {
19
19
  FormContainer,
20
20
  FormRow,
21
21
  Label,
22
- PrimaryButton,
23
- SecondaryButton,
24
22
  TextField,
25
23
  InputErrorText,
26
24
  withFocusTrap,
27
25
  } from '@manuscripts/style-guide'
26
+ import { Button } from '@manuscripts/style-guide/mui'
28
27
  import React, { useCallback, useState } from 'react'
29
28
  import styled from 'styled-components'
30
29
 
@@ -46,7 +45,7 @@ const ActionGroup = styled.span`
46
45
  }
47
46
  `
48
47
 
49
- const RemoveButton = styled(SecondaryButton)`
48
+ const RemoveButton = styled(Button)`
50
49
  display: flex;
51
50
  justify-content: space-between;
52
51
  align-items: center;
@@ -201,17 +200,21 @@ export const LinkForm: React.FC<LinkFormProps> = ({
201
200
 
202
201
  <Actions>
203
202
  <ActionGroup>
204
- <RemoveButton type={'button'} onClick={onRemove}>
203
+ <RemoveButton
204
+ variant="secondary"
205
+ type={'button'}
206
+ onClick={onRemove}
207
+ >
205
208
  <DeleteIcon />
206
209
  <span>Remove Link</span>
207
210
  </RemoveButton>
208
211
  </ActionGroup>
209
212
 
210
213
  <ActionGroup>
211
- <SecondaryButton type={'button'} onClick={onCancel}>
214
+ <Button variant="secondary" type={'button'} onClick={onCancel}>
212
215
  Cancel
213
- </SecondaryButton>
214
- <PrimaryButton type={'submit'}>Save</PrimaryButton>
216
+ </Button>
217
+ <Button type={'submit'}>Save</Button>
215
218
  </ActionGroup>
216
219
  </Actions>
217
220
  </FormContainer>