@manuscripts/style-guide 3.3.11 → 3.3.13

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.
Files changed (35) hide show
  1. package/dist/cjs/components/Button.js +10 -0
  2. package/dist/cjs/components/Checkbox.js +5 -0
  3. package/dist/cjs/components/Menus/Menus.js +67 -5
  4. package/dist/cjs/components/Menus/Submenu.js +80 -8
  5. package/dist/cjs/components/NavDropdown.js +1 -1
  6. package/dist/cjs/components/Resizer/ResizerButton.js +1 -1
  7. package/dist/cjs/components/SaveStatus.js +3 -3
  8. package/dist/cjs/components/ToggleHeader.js +16 -4
  9. package/dist/cjs/components/icons/index.js +4 -2
  10. package/dist/cjs/components/icons/save-status-error.js +5 -0
  11. package/dist/cjs/components/icons/save-status-saved.js +1 -1
  12. package/dist/cjs/components/icons/save-status-saving.js +1 -1
  13. package/dist/cjs/hooks/use-menus.js +4 -0
  14. package/dist/es/components/Button.js +10 -0
  15. package/dist/es/components/Checkbox.js +5 -0
  16. package/dist/es/components/Menus/Menus.js +67 -5
  17. package/dist/es/components/Menus/Submenu.js +80 -8
  18. package/dist/es/components/NavDropdown.js +1 -1
  19. package/dist/es/components/Resizer/ResizerButton.js +1 -1
  20. package/dist/es/components/SaveStatus.js +4 -4
  21. package/dist/es/components/ToggleHeader.js +16 -4
  22. package/dist/es/components/icons/index.js +1 -0
  23. package/dist/es/components/icons/save-status-error.js +3 -0
  24. package/dist/es/components/icons/save-status-saved.js +1 -1
  25. package/dist/es/components/icons/save-status-saving.js +1 -1
  26. package/dist/es/hooks/use-menus.js +4 -0
  27. package/dist/types/components/Menus/Menus.d.ts +1 -0
  28. package/dist/types/components/Menus/Submenu.d.ts +1 -0
  29. package/dist/types/components/NavDropdown.d.ts +1 -0
  30. package/dist/types/components/icons/index.d.ts +1 -0
  31. package/dist/types/components/icons/save-status-error.d.ts +19 -0
  32. package/dist/types/hooks/use-menus.d.ts +1 -0
  33. package/dist/types/lib/menus.d.ts +1 -0
  34. package/dist/types/theme.d.ts +4 -0
  35. package/package.json +1 -1
@@ -128,6 +128,11 @@ exports.SecondaryButton = (0, styled_components_1.default)(ButtonTemplate) `
128
128
  &:not([disabled]):active {
129
129
  ${(props) => btnColors(props.theme.colors.button.secondary.color.active, props.theme.colors.button.secondary.background.active, props.theme.colors.button.secondary.border.active, false)}
130
130
  }
131
+
132
+ &:focus-visible {
133
+ outline: 3px solid ${(props) => props.theme.colors.outline.focus};
134
+ outline-offset: 4px;
135
+ }
131
136
  `;
132
137
  exports.PrimaryButton = (0, styled_components_1.default)(ButtonTemplate) `
133
138
  ${(props) => btnColors(props.theme.colors.button.primary.color.default, props.theme.colors.button.primary.background.default, props.theme.colors.button.primary.border.default, false)}
@@ -136,6 +141,11 @@ exports.PrimaryButton = (0, styled_components_1.default)(ButtonTemplate) `
136
141
  ${(props) => btnColors(props.theme.colors.button.primary.color.hover, props.theme.colors.button.primary.background.hover, props.theme.colors.button.primary.border.hover, false)}
137
142
  }
138
143
 
144
+ &:focus-visible {
145
+ outline: 3px solid ${(props) => props.theme.colors.outline.focus} !important;
146
+ outline-offset: 4px;
147
+ }
148
+
139
149
  &:not([disabled]):active {
140
150
  ${(props) => btnColors(props.theme.colors.button.primary.color.active, props.theme.colors.button.primary.background.active, props.theme.colors.button.primary.border.active, false)}
141
151
  }
@@ -65,6 +65,11 @@ exports.CheckboxLabel = styled_components_1.default.label `
65
65
  input:focus + div::before {
66
66
  border-color: ${(props) => props.theme.colors.button.primary.border.hover};
67
67
  }
68
+
69
+ input:focus-visible + div::before {
70
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
71
+ outline-offset: 2px;
72
+ }
68
73
  `;
69
74
  exports.CheckboxField = styled_components_1.default.input.attrs({
70
75
  type: 'checkbox',
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Menus = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
8
9
  const styled_components_1 = __importDefault(require("styled-components"));
9
10
  const Submenu_1 = require("./Submenu");
10
11
  const MenusContainer = styled_components_1.default.div `
@@ -14,6 +15,11 @@ const MenusContainer = styled_components_1.default.div `
14
15
  const MenuHeading = styled_components_1.default.div `
15
16
  padding: 4px 8px;
16
17
  cursor: pointer;
18
+
19
+ &:focus-visible {
20
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
21
+ outline-offset: -2px;
22
+ }
17
23
  `;
18
24
  const MenuContainer = styled_components_1.default.div `
19
25
  position: relative;
@@ -28,13 +34,69 @@ const MenuContainer = styled_components_1.default.div `
28
34
  }
29
35
  }
30
36
  `;
31
- const Menus = ({ menus, innerRef, handleClick, }) => {
32
- return ((0, jsx_runtime_1.jsx)(MenusContainer, { ref: innerRef, "data-cy": 'manuscript-menus', children: menus.map((menu, index) => {
33
- return ((0, jsx_runtime_1.jsxs)(MenuContainer, { "data-cy": 'menu', isEnabled: menu.isEnabled, children: [(0, jsx_runtime_1.jsx)(MenuHeading, { onMouseDown: (e) => {
37
+ const Menus = ({ menus, innerRef, handleClick, closeAll, }) => {
38
+ const menuHeadingsRef = (0, react_1.useRef)([]);
39
+ (0, react_1.useEffect)(() => {
40
+ menuHeadingsRef.current.forEach((heading, index) => {
41
+ if (heading) {
42
+ heading.tabIndex = index === 0 ? 0 : -1;
43
+ }
44
+ });
45
+ }, [menus]);
46
+ const handleKeyDown = (event) => {
47
+ const target = event.target;
48
+ const currentIndex = menuHeadingsRef.current.findIndex((heading) => heading === target);
49
+ if (currentIndex === -1) {
50
+ return;
51
+ }
52
+ switch (event.key) {
53
+ case 'ArrowRight': {
54
+ event.preventDefault();
55
+ const nextIndex = (currentIndex + 1) % menuHeadingsRef.current.length;
56
+ menuHeadingsRef.current[nextIndex]?.focus();
57
+ break;
58
+ }
59
+ case 'ArrowLeft': {
60
+ event.preventDefault();
61
+ const prevIndex = (currentIndex - 1 + menuHeadingsRef.current.length) %
62
+ menuHeadingsRef.current.length;
63
+ menuHeadingsRef.current[prevIndex]?.focus();
64
+ break;
65
+ }
66
+ case 'Enter': {
67
+ event.preventDefault();
68
+ handleClick([currentIndex]);
69
+ break;
70
+ }
71
+ case 'Escape': {
72
+ event.preventDefault();
73
+ event.stopPropagation();
74
+ closeAll();
75
+ break;
76
+ }
77
+ case 'ArrowDown': {
78
+ event.preventDefault();
79
+ const menu = menus[currentIndex];
80
+ if (menu && !menu.isOpen) {
81
+ handleClick([currentIndex]);
82
+ }
83
+ const menuContainer = event.currentTarget.children[currentIndex];
84
+ setTimeout(() => {
85
+ const firstItem = menuContainer?.querySelector('[data-submenu-item]');
86
+ firstItem?.focus();
87
+ }, 0);
88
+ break;
89
+ }
90
+ }
91
+ };
92
+ return ((0, jsx_runtime_1.jsx)(MenusContainer, { ref: innerRef, "data-cy": 'manuscript-menus', onKeyDown: handleKeyDown, children: menus.map((menu, index) => {
93
+ return ((0, jsx_runtime_1.jsxs)(MenuContainer, { "data-cy": 'menu', isEnabled: menu.isEnabled, children: [(0, jsx_runtime_1.jsx)(MenuHeading, { ref: (el) => {
94
+ menuHeadingsRef.current[index] = el;
95
+ }, onMouseDown: (e) => {
34
96
  e.preventDefault();
35
97
  handleClick([index]);
36
- }, isOpen: menu.isOpen, children: (0, jsx_runtime_1.jsx)(Submenu_1.Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && ((0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainerWrapper, { children: (0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainer, { children: menu.submenu.map((submenu, sindex) => {
37
- return ((0, jsx_runtime_1.jsx)(Submenu_1.Submenu, { menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]) }, `${index}-${sindex}`));
98
+ }, isOpen: menu.isOpen, children: (0, jsx_runtime_1.jsx)(Submenu_1.Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && ((0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainerWrapper, { children: (0, jsx_runtime_1.jsx)(Submenu_1.SubmenusContainer, { "data-submenu-container": true, tabIndex: -1, children: menu.submenu.map((submenu, sindex) => {
99
+ return ((0, jsx_runtime_1.jsx)(Submenu_1.Submenu, { menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), closeAll: closeAll }, `${index}-${sindex}`));
38
100
  }) }) }))] }, `menu-${index}`));
39
101
  }) }));
40
102
  };
@@ -38,6 +38,10 @@ exports.SubmenusContainer = styled_components_1.default.div `
38
38
  &[data-placement='right-start'] {
39
39
  top: 8px;
40
40
  }
41
+
42
+ &:focus-visible {
43
+ outline: none;
44
+ }
41
45
  `;
42
46
  exports.NestedSubmenusContainer = (0, styled_components_1.default)(exports.SubmenusContainer) `
43
47
  position: absolute;
@@ -66,9 +70,10 @@ const Container = styled_components_1.default.div `
66
70
  align-items: center;
67
71
  cursor: pointer;
68
72
  padding: 8px 16px 8px 4px;
73
+ outline: none;
69
74
  ${(props) => props.isOpen && 'background: #f2fbfc;'}
70
75
 
71
- &:hover {
76
+ &:hover, &:focus {
72
77
  background: #f2fbfc;
73
78
  }
74
79
 
@@ -78,26 +83,93 @@ const Container = styled_components_1.default.div `
78
83
  }
79
84
  `;
80
85
  const activeContent = (menu) => (menu.isActive ? '✓' : '');
81
- const SubmenuLabel = ({ menu, handleClick }) => {
86
+ const SubmenuLabel = ({ menu, handleClick, closeAll, }) => {
82
87
  if ((0, menus_1.isMenuSeparator)(menu)) {
83
88
  return null;
84
89
  }
85
- return ((0, jsx_runtime_1.jsxs)(Container, { isOpen: menu.isOpen, "data-cy": 'submenu', className: menu.isEnabled ? '' : 'disabled', onMouseDown: (e) => {
90
+ const handleKeyDown = (e) => {
91
+ if ((0, menus_1.isMenuSeparator)(menu)) {
92
+ return;
93
+ }
94
+ const currentElement = e.currentTarget;
95
+ const submenuContainer = currentElement.closest('[data-submenu-container]');
96
+ if (!submenuContainer) {
97
+ return;
98
+ }
99
+ const items = Array.from(submenuContainer.querySelectorAll('[data-submenu-item]'));
100
+ const currentIndex = items.indexOf(currentElement);
101
+ const focusMenuHeading = () => {
102
+ const menuContainer = currentElement.closest('[data-cy="menu"]');
103
+ const menuHeading = menuContainer?.querySelector('[tabindex]');
104
+ menuHeading?.focus();
105
+ };
106
+ e.preventDefault();
107
+ e.stopPropagation();
108
+ switch (e.key) {
109
+ case 'ArrowDown': {
110
+ const nextIndex = currentIndex + 1;
111
+ const nextItem = items[nextIndex] || items[0];
112
+ nextItem?.focus();
113
+ break;
114
+ }
115
+ case 'ArrowUp': {
116
+ const prevIndex = currentIndex - 1;
117
+ const prevItem = items[prevIndex] || items[items.length - 1];
118
+ prevItem?.focus();
119
+ break;
120
+ }
121
+ case 'ArrowRight': {
122
+ if (menu.submenu) {
123
+ handleClick([]);
124
+ setTimeout(() => {
125
+ const nestedContainer = currentElement.nextElementSibling;
126
+ const firstItem = nestedContainer?.querySelector('[data-submenu-item]');
127
+ firstItem?.focus();
128
+ }, 0);
129
+ }
130
+ break;
131
+ }
132
+ case 'ArrowLeft': {
133
+ const parentContainer = submenuContainer?.parentElement?.closest('[data-submenu-container]');
134
+ if (parentContainer) {
135
+ const parentLabel = parentContainer.querySelector(':scope > [data-submenu-item]');
136
+ parentLabel?.focus();
137
+ }
138
+ else {
139
+ focusMenuHeading();
140
+ closeAll();
141
+ }
142
+ break;
143
+ }
144
+ case 'Escape': {
145
+ closeAll();
146
+ focusMenuHeading();
147
+ break;
148
+ }
149
+ case 'Enter': {
150
+ if (menu.isEnabled) {
151
+ handleClick([]);
152
+ }
153
+ break;
154
+ }
155
+ }
156
+ };
157
+ return ((0, jsx_runtime_1.jsxs)(Container, { isOpen: menu.isOpen, "data-cy": 'submenu', "data-submenu-item": true, className: menu.isEnabled ? '' : 'disabled', tabIndex: -1, onMouseDown: (e) => {
86
158
  e.preventDefault();
87
159
  handleClick([]);
88
- }, children: [(0, jsx_runtime_1.jsx)(Active, { children: activeContent(menu) }), (0, jsx_runtime_1.jsx)(exports.Text, { children: menu.label }), menu.submenu && (0, jsx_runtime_1.jsx)(Arrow, {}), menu.shortcut && (0, jsx_runtime_1.jsx)(Shortcut_1.Shortcut, { shortcut: menu.shortcut })] }));
160
+ }, onKeyDown: handleKeyDown, children: [(0, jsx_runtime_1.jsx)(Active, { children: activeContent(menu) }), (0, jsx_runtime_1.jsx)(exports.Text, { children: menu.label }), menu.submenu && (0, jsx_runtime_1.jsx)(Arrow, {}), menu.shortcut && (0, jsx_runtime_1.jsx)(Shortcut_1.Shortcut, { shortcut: menu.shortcut })] }));
89
161
  };
90
162
  exports.SubmenuLabel = SubmenuLabel;
91
- const Submenu = ({ menu, handleClick }) => {
163
+ const Submenu = ({ menu, handleClick, closeAll, }) => {
92
164
  if ((0, menus_1.isMenuSeparator)(menu)) {
93
165
  return (0, jsx_runtime_1.jsx)(Separator, {});
94
166
  }
95
167
  if (menu.component) {
96
- return (0, jsx_runtime_1.jsx)(menu.component, { menu: menu, handleClick: handleClick });
168
+ return (0, jsx_runtime_1.jsx)(menu.component, { menu: menu, handleClick: handleClick, closeAll: closeAll });
97
169
  }
98
170
  if (!menu.submenu) {
99
- return (0, jsx_runtime_1.jsx)(exports.SubmenuLabel, { menu: menu, handleClick: handleClick });
171
+ return ((0, jsx_runtime_1.jsx)(exports.SubmenuLabel, { menu: menu, handleClick: handleClick, closeAll: closeAll }));
100
172
  }
101
- return ((0, jsx_runtime_1.jsxs)(exports.SubmenuContainer, { "data-cy": 'submenu', children: [(0, jsx_runtime_1.jsx)(exports.SubmenuLabel, { menu: menu, handleClick: handleClick }), menu.submenu && menu.isOpen && ((0, jsx_runtime_1.jsx)(exports.NestedSubmenusContainer, { children: menu.submenu.map((submenu, index) => ((0, jsx_runtime_1.jsx)(exports.Submenu, { menu: submenu, handleClick: (i) => handleClick([index, ...i]) }, `menu-${index}`))) }))] }));
173
+ return ((0, jsx_runtime_1.jsxs)(exports.SubmenuContainer, { "data-cy": 'submenu', children: [(0, jsx_runtime_1.jsx)(exports.SubmenuLabel, { menu: menu, handleClick: handleClick, closeAll: closeAll }), menu.submenu && menu.isOpen && ((0, jsx_runtime_1.jsx)(exports.NestedSubmenusContainer, { "data-submenu-container": true, children: menu.submenu.map((submenu, index) => ((0, jsx_runtime_1.jsx)(exports.Submenu, { menu: submenu, handleClick: (i) => handleClick([index, ...i]), closeAll: closeAll }, `menu-${index}`))) }))] }));
102
174
  };
103
175
  exports.Submenu = Submenu;
@@ -142,5 +142,5 @@ exports.NavDropdownButtonContainer = (0, styled_components_1.default)(Button_1.S
142
142
  stroke: currentColor;
143
143
  }
144
144
  `;
145
- const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, }) => ((0, jsx_runtime_1.jsxs)(exports.NavDropdownButtonContainer, { as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle', children: [(0, jsx_runtime_1.jsx)(exports.NavDropdownButtonText, { children: children }), !!notificationsCount && ((0, jsx_runtime_1.jsx)(exports.NotificationsBadge, { isOpen: isOpen, children: notificationsCount })), !removeChevron && (0, jsx_runtime_1.jsx)(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
145
+ const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, buttonRef, }) => ((0, jsx_runtime_1.jsxs)(exports.NavDropdownButtonContainer, { ref: buttonRef, as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle', tabIndex: 0, children: [(0, jsx_runtime_1.jsx)(exports.NavDropdownButtonText, { children: children }), !!notificationsCount && ((0, jsx_runtime_1.jsx)(exports.NotificationsBadge, { isOpen: isOpen, children: notificationsCount })), !removeChevron && (0, jsx_runtime_1.jsx)(exports.NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
146
146
  exports.NavDropdownButton = NavDropdownButton;
@@ -21,7 +21,7 @@ class ResizerButton extends react_1.default.PureComponent {
21
21
  render() {
22
22
  const { buttonInner, direction, side, isCollapsed, onClick, isVisible } = this.props;
23
23
  const ResizerButtonInner = buttonInner || inners[direction][side];
24
- return ((0, jsx_runtime_1.jsx)(ResizerButtonInner, { "aria-expanded": !isCollapsed, isCollapsed: isCollapsed, isVisible: isVisible, onClick: onClick, onMouseDown: (event) => event.preventDefault() }));
24
+ return ((0, jsx_runtime_1.jsx)(ResizerButtonInner, { "aria-expanded": !isCollapsed, isCollapsed: isCollapsed, isVisible: isVisible, onClick: onClick, onMouseDown: (event) => event.preventDefault(), tabIndex: 0 }));
25
25
  }
26
26
  }
27
27
  exports.ResizerButton = ResizerButton;
@@ -16,7 +16,7 @@ const SaveStatus = ({ status }) => {
16
16
  case 'saved':
17
17
  return ((0, jsx_runtime_1.jsxs)(Container, { children: [(0, jsx_runtime_1.jsx)(PopPop, { children: (0, jsx_runtime_1.jsx)(icons_1.SaveStatusSavedIcon, {}) }), (0, jsx_runtime_1.jsx)(Text, { children: "Saved" })] }));
18
18
  case 'failed':
19
- return ((0, jsx_runtime_1.jsxs)(FailedContainer, { children: [(0, jsx_runtime_1.jsx)(PopPop, { children: (0, jsx_runtime_1.jsx)(icons_1.AttentionRedIcon, {}) }), (0, jsx_runtime_1.jsx)(FailedText, { children: "Failed To Save" })] }));
19
+ return ((0, jsx_runtime_1.jsxs)(FailedContainer, { children: [(0, jsx_runtime_1.jsx)(PopPop, { children: (0, jsx_runtime_1.jsx)(icons_1.SaveStatusErrorIcon, {}) }), (0, jsx_runtime_1.jsx)(FailedText, { children: "Save error" })] }));
20
20
  default:
21
21
  return null;
22
22
  }
@@ -36,7 +36,7 @@ const Text = styled_components_1.default.span `
36
36
  margin-left: 0.5em;
37
37
  font-family: ${(props) => props.theme.font.family.Lato};
38
38
  font-size: 14px;
39
- font-weight: 700;
39
+ font-weight: 400;
40
40
  `;
41
41
  const FailedContainer = (0, styled_components_1.default)(Container) `
42
42
  path {
@@ -45,7 +45,7 @@ const FailedContainer = (0, styled_components_1.default)(Container) `
45
45
  }
46
46
  `;
47
47
  const FailedText = (0, styled_components_1.default)(Text) `
48
- color: ${(props) => props.theme.colors.text.error};
48
+ color: ${(props) => props.theme.colors.text.secondary};
49
49
  `;
50
50
  const RotateContinuous = styled_components_1.default.div `
51
51
  svg {
@@ -8,10 +8,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const icons_1 = require("./icons");
10
10
  const ToggleHeader = ({ title, isOpen, onToggle, }) => {
11
- return ((0, jsx_runtime_1.jsxs)(ToggleHeaderContainer, { onClick: (e) => {
12
- e.stopPropagation();
13
- onToggle();
14
- }, children: [(0, jsx_runtime_1.jsx)("span", { children: title }), (0, jsx_runtime_1.jsx)(exports.ToggleIcon, { isOpen: isOpen, children: isOpen ? (0, jsx_runtime_1.jsx)(icons_1.TriangleExpandedIcon, {}) : (0, jsx_runtime_1.jsx)(icons_1.TriangleCollapsedIcon, {}) })] }));
11
+ const handleToggle = (e) => {
12
+ e.stopPropagation();
13
+ onToggle();
14
+ };
15
+ const handleKeyDown = (e) => {
16
+ if (e.key === 'Enter') {
17
+ e.preventDefault();
18
+ handleToggle(e);
19
+ }
20
+ };
21
+ return ((0, jsx_runtime_1.jsxs)(ToggleHeaderContainer, { onClick: handleToggle, children: [(0, jsx_runtime_1.jsx)("span", { children: title }), (0, jsx_runtime_1.jsx)(exports.ToggleIcon, { isOpen: isOpen, onKeyDown: handleKeyDown, tabIndex: 0, children: isOpen ? (0, jsx_runtime_1.jsx)(icons_1.TriangleExpandedIcon, {}) : (0, jsx_runtime_1.jsx)(icons_1.TriangleCollapsedIcon, {}) })] }));
15
22
  };
16
23
  exports.ToggleHeader = ToggleHeader;
17
24
  const ToggleHeaderContainer = styled_components_1.default.div `
@@ -37,6 +44,11 @@ exports.ToggleIcon = styled_components_1.default.div `
37
44
  text-align: center;
38
45
  cursor: pointer;
39
46
 
47
+ &:focus-visible {
48
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
49
+ outline-offset: 2px;
50
+ }
51
+
40
52
  svg {
41
53
  width: 19px;
42
54
  height: 19px;
@@ -19,8 +19,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.FileVideoIcon = exports.FileUnknownIcon = exports.FileTableIcon = exports.FilePdfIcon = exports.FileMainDocumentIcon = exports.FileLatexIcon = exports.FileImageIcon = exports.FileGraphicalAbstractIcon = exports.FileFigureIcon = exports.FileDocumentIcon = exports.FileCorruptedIcon = exports.FileCompressedIcon = exports.FileCodeIcon = exports.FileAudioIcon = exports.EditAttrsTrackingIcon = exports.EditIcon = exports.DraggableIcon = exports.DotsIcon = exports.DeleteIcon = exports.DeleteSolidIcon = exports.CorrespondingAuthorIcon = exports.CommentIcon = exports.CommentResolveIcon = exports.CommentReplyIcon = exports.CitationCountIcon = exports.SystemUserAvatarIcon = exports.ChatIcon = exports.BookIcon = exports.AffiliationPlaceholderIcon = exports.AuthorPlaceholderIcon = exports.AffiliationIcon = exports.AlertIcon = exports.AvatarIcon = exports.AttentionRedIcon = exports.AttentionOrangeIcon = exports.AttentionGreenIcon = exports.AttentionBlueIcon = exports.AttachIcon = exports.ArrowUpIcon = exports.ArrowLeftIcon = exports.ArrowDownCircleIcon = exports.ArrowDownIcon = exports.AddRoleIcon = exports.AddIcon = exports.AddOutlineIcon = exports.AddNewIcon = exports.AddedIcon = exports.AddFigureIcon = exports.AddCommentIcon = exports.AddAuthorIcon = void 0;
22
- exports.ToolbarUnderlineIcon = exports.ToolbarTableIcon = exports.ToolbarSymbolIcon = exports.ToolbarSuperscriptIcon = exports.ToolbarSubscriptIcon = exports.ToolbarSpecialCharactersIcon = exports.ToolbarOrderedListIcon = exports.ToolbarItalicIcon = exports.ToolbarFigureIcon = exports.ToolbarEquationIcon = exports.ToolbarCodeIcon = exports.ToolbarCitationIcon = exports.ToolbarBoxedTextIcon = exports.ToolbarBoldIcon = exports.TickIcon = exports.TaskStepDoneIcon = exports.SliderOnIcon = exports.SliderOffIcon = exports.SectionCategoryIcon = exports.SearchIcon = exports.ScrollIcon = exports.SaveStatusSavingIcon = exports.SaveStatusSavedIcon = exports.SaveStatusOfflineIcon = exports.RoleReadingIcon = exports.RoleAnnotatingIcon = exports.PlusIcon = exports.OutlineUnorderedListIcon = exports.OutlineTableIcon = exports.OutlineSectionIcon = exports.OutlinePullQuoteIcon = exports.OutlineParagraphIcon = exports.OutlineOrderedListIcon = exports.OutlineManuscriptIcon = exports.OutlineFigureIcon = exports.OutlineEmbedIcon = exports.OutlineEquationIcon = exports.OutlineCodeIcon = exports.OutlineBlockQuoteIcon = exports.ManuscriptIcon = exports.LogoutIcon = exports.LockIcon = exports.LinkIcon = exports.InspectorPluginIcon = exports.ImageRightIcon = exports.ImageDefaultIcon = exports.ImageLeftIcon = exports.HelpIcon = exports.HandleOutlineIcon = exports.HandleInspectorIcon = void 0;
23
- exports.DangerIcon = exports.AddInstitutionIcon = exports.AddUserIcon = exports.ProfileIcon = exports.CrclTickAnimation = exports.VerticalEllipsisIcon = exports.UploadIcon = exports.TriangleExpandedIcon = exports.TriangleCollapsedIcon = exports.TranslateIcon = exports.ToolbarUnindentIcon = exports.ToolbarIndentIcon = exports.ToolbarUnorderedListIcon = void 0;
22
+ exports.ToolbarTableIcon = exports.ToolbarSymbolIcon = exports.ToolbarSuperscriptIcon = exports.ToolbarSubscriptIcon = exports.ToolbarSpecialCharactersIcon = exports.ToolbarOrderedListIcon = exports.ToolbarItalicIcon = exports.ToolbarFigureIcon = exports.ToolbarEquationIcon = exports.ToolbarCodeIcon = exports.ToolbarCitationIcon = exports.ToolbarBoxedTextIcon = exports.ToolbarBoldIcon = exports.TickIcon = exports.TaskStepDoneIcon = exports.SliderOnIcon = exports.SliderOffIcon = exports.SectionCategoryIcon = exports.SearchIcon = exports.ScrollIcon = exports.SaveStatusErrorIcon = exports.SaveStatusSavingIcon = exports.SaveStatusSavedIcon = exports.SaveStatusOfflineIcon = exports.RoleReadingIcon = exports.RoleAnnotatingIcon = exports.PlusIcon = exports.OutlineUnorderedListIcon = exports.OutlineTableIcon = exports.OutlineSectionIcon = exports.OutlinePullQuoteIcon = exports.OutlineParagraphIcon = exports.OutlineOrderedListIcon = exports.OutlineManuscriptIcon = exports.OutlineFigureIcon = exports.OutlineEmbedIcon = exports.OutlineEquationIcon = exports.OutlineCodeIcon = exports.OutlineBlockQuoteIcon = exports.ManuscriptIcon = exports.LogoutIcon = exports.LockIcon = exports.LinkIcon = exports.InspectorPluginIcon = exports.ImageRightIcon = exports.ImageDefaultIcon = exports.ImageLeftIcon = exports.HelpIcon = exports.HandleOutlineIcon = exports.HandleInspectorIcon = void 0;
23
+ exports.DangerIcon = exports.AddInstitutionIcon = exports.AddUserIcon = exports.ProfileIcon = exports.CrclTickAnimation = exports.VerticalEllipsisIcon = exports.UploadIcon = exports.TriangleExpandedIcon = exports.TriangleCollapsedIcon = exports.TranslateIcon = exports.ToolbarUnindentIcon = exports.ToolbarIndentIcon = exports.ToolbarUnorderedListIcon = exports.ToolbarUnderlineIcon = void 0;
24
24
  var add_author_1 = require("./add-author");
25
25
  Object.defineProperty(exports, "AddAuthorIcon", { enumerable: true, get: function () { return __importDefault(add_author_1).default; } });
26
26
  var add_comment_1 = require("./add-comment");
@@ -179,6 +179,8 @@ var save_status_saved_1 = require("./save-status-saved");
179
179
  Object.defineProperty(exports, "SaveStatusSavedIcon", { enumerable: true, get: function () { return __importDefault(save_status_saved_1).default; } });
180
180
  var save_status_saving_1 = require("./save-status-saving");
181
181
  Object.defineProperty(exports, "SaveStatusSavingIcon", { enumerable: true, get: function () { return __importDefault(save_status_saving_1).default; } });
182
+ var save_status_error_1 = require("./save-status-error");
183
+ Object.defineProperty(exports, "SaveStatusErrorIcon", { enumerable: true, get: function () { return __importDefault(save_status_error_1).default; } });
182
184
  var scroll_1 = require("./scroll");
183
185
  Object.defineProperty(exports, "ScrollIcon", { enumerable: true, get: function () { return __importDefault(scroll_1).default; } });
184
186
  var search_1 = require("./search");
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const SaveStatusErrorIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M1.78138 8.66481C-0.264932 9.8341 0.0274413 13.0505 2.65849 13.0511H12.8905C15.5215 13.0511 17.2757 8.07953 12.8904 6.90971C12.5981 3.1078 7.04369 1.35262 4.99722 5.44728C3.24317 5.44728 1.78146 6.61707 1.78138 8.66481Z", fill: "white" }), (0, jsx_runtime_1.jsx)("path", { d: "M4.72879 5.01736C5.87898 2.95783 7.91126 2.36194 9.70374 2.79082C11.4478 3.20821 13.0047 4.60833 13.2924 6.5716C14.3175 6.9008 15.037 7.4474 15.4775 8.12298C15.9565 8.85769 16.0788 9.70245 15.9548 10.4877C15.7142 12.0118 14.4922 13.49 12.8904 13.49H2.65842C1.90751 13.4898 1.28935 13.2579 0.834706 12.8599C0.382925 12.4644 0.119408 11.9279 0.0324793 11.3628C-0.129481 10.3096 0.315 9.11972 1.34973 8.41657C1.40498 7.39534 1.80147 6.55959 2.43174 5.96841C3.04545 5.39277 3.85636 5.07181 4.72879 5.01736ZM9.49933 3.64419C7.99607 3.28458 6.3123 3.79692 5.38942 5.6434C5.31514 5.79202 5.16325 5.88616 4.99715 5.88616C4.21663 5.88616 3.52442 6.1456 3.03127 6.60815C2.54256 7.06657 2.21994 7.75174 2.2199 8.66504C2.21982 8.82233 2.13541 8.96738 1.99893 9.04546C1.13936 9.53664 0.779611 10.4521 0.899227 11.2297C0.958506 11.6148 1.13361 11.9555 1.41254 12.1996C1.68873 12.4414 2.09385 12.6125 2.65842 12.6126H12.8904C13.9195 12.6126 14.8901 11.6047 15.0881 10.3507C15.1834 9.74683 15.0864 9.12867 14.7432 8.60221C14.4018 8.07861 13.7893 7.60354 12.7773 7.33358C12.5974 7.28556 12.4673 7.12915 12.453 6.94345C12.3239 5.26421 11.0281 4.00999 9.49933 3.64419Z", fill: "#F35143" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.52701 9.50991C8.40149 9.50991 8.30327 9.4717 8.23233 9.39527C8.16138 9.31884 8.11773 9.20693 8.10136 9.05953L7.83942 6.25898C7.81213 6.01332 7.85852 5.81679 7.97857 5.6694C8.09863 5.51654 8.28144 5.44011 8.52701 5.44011C8.76166 5.44011 8.93901 5.51654 9.05907 5.6694C9.17912 5.81679 9.22551 6.01332 9.19822 6.25898L8.93629 9.05953C8.91992 9.20693 8.87626 9.31884 8.80532 9.39527C8.73983 9.4717 8.64706 9.50991 8.52701 9.50991ZM8.52701 11.3278C8.30873 11.3278 8.1341 11.2623 8.00313 11.1313C7.87762 11.0003 7.81486 10.831 7.81486 10.6236C7.81486 10.4216 7.87762 10.2578 8.00313 10.1323C8.1341 10.0012 8.30873 9.93572 8.52701 9.93572C8.74529 9.93572 8.91446 10.0012 9.03451 10.1323C9.16002 10.2578 9.22278 10.4216 9.22278 10.6236C9.22278 10.831 9.16002 11.0003 9.03451 11.1313C8.91446 11.2623 8.74529 11.3278 8.52701 11.3278Z", fill: "#F35143" })] }));
5
+ exports.default = SaveStatusErrorIcon;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const SaveStatusSavedIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M9 16.5C13.1421 16.5 16.5 13.1421 16.5 9C16.5 4.85786 13.1421 1.5 9 1.5C4.85786 1.5 1.5 4.85786 1.5 9C1.5 13.1421 4.85786 16.5 9 16.5Z", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.5 8.5L8 11L13 6", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })] }));
4
+ const SaveStatusSavedIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M4.72879 5.01493C5.87898 2.95619 7.91126 2.36052 9.70374 2.78924C11.4478 3.20647 13.0047 4.60605 13.2923 6.56856C14.3175 6.89764 15.037 7.44403 15.4775 8.11934C15.9565 8.85377 16.0788 9.69821 15.9548 10.4832C15.7142 12.0067 14.4922 13.4843 12.8904 13.4843H2.65842C1.90751 13.4841 1.28935 13.2523 0.834706 12.8545C0.382925 12.4591 0.119408 11.9228 0.0324793 11.3579C-0.129481 10.3052 0.315 9.1157 1.34973 8.41283C1.40498 7.39199 1.80147 6.55656 2.43174 5.96561C3.04545 5.39019 3.85636 5.06936 4.72879 5.01493ZM9.49933 3.64229C7.99607 3.28281 6.3123 3.79496 5.38941 5.64072C5.31514 5.78928 5.16325 5.88339 4.99715 5.88339C4.21663 5.88339 3.52442 6.14273 3.03127 6.6051C2.54256 7.06335 2.21994 7.74825 2.2199 8.6612C2.21982 8.81843 2.13541 8.96342 1.99893 9.04148C1.13936 9.53246 0.779611 10.4476 0.899227 11.2249C0.958506 11.6098 1.13361 11.9504 1.41254 12.1944C1.68873 12.4361 2.09385 12.6071 2.65842 12.6072H12.8904C13.9195 12.6072 14.8901 11.5998 15.0881 10.3462C15.1834 9.74258 15.0864 9.12466 14.7432 8.5984C14.4018 8.075 13.7893 7.60011 12.7773 7.33025C12.5974 7.28225 12.4673 7.1259 12.453 6.94027C12.3239 5.26168 11.0281 4.00794 9.49933 3.64229Z", fill: "#353535" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.83375 8.60263C5.61415 8.37347 5.25942 8.36752 5.03713 8.59372L5.16258 8.46607C4.94222 8.6903 4.94257 9.0575 5.16092 9.28367L6.64735 10.8234C6.8668 11.0507 7.22857 11.0583 7.45382 10.8418L10.6709 7.75008C10.8968 7.53293 10.9033 7.17708 10.681 6.95088L10.8064 7.07853C10.5861 6.85429 10.2218 6.84877 9.9951 7.06413L7.04469 9.86626L5.83375 8.60263Z", fill: "#353535" }), (0, jsx_runtime_1.jsx)("path", { d: "M9.9951 7.06413C10.1999 6.86962 10.5167 6.85567 10.7385 7.01999C10.8996 7.24472 10.875 7.55387 10.6709 7.75008L7.45382 10.8418C7.24263 11.0448 6.91162 11.0506 6.69024 10.8633L6.64735 10.8234L5.16092 9.28367C4.96369 9.07931 4.94457 8.75992 5.1052 8.5348C5.32688 8.37089 5.63536 8.39561 5.83375 8.60263L7.04469 9.86626L9.9951 7.06413ZM5.16258 8.46607C5.14132 8.4877 5.12235 8.51076 5.1052 8.5348C5.08152 8.55231 5.05858 8.5719 5.03713 8.59372L5.16258 8.46607ZM10.8064 7.07853C10.7852 7.05691 10.7622 7.03754 10.7385 7.01999C10.7213 6.99601 10.7024 6.97269 10.681 6.95088L10.8064 7.07853Z", fill: "#353535" })] }));
5
5
  exports.default = SaveStatusSavedIcon;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
- const SaveStatusSavingIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "17", height: "18", viewBox: "0 0 17 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M1.5 8.5C1.5 4.634 4.634 1.5 8.5 1.5C11.136 1.5 13.328 3.141 14.5 5.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.5 1.5V5.5H10.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.5 9.5C15.5 13.366 12.366 16.5 8.5 16.5C5.864 16.5 3.672 14.859 2.5 12.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), (0, jsx_runtime_1.jsx)("path", { d: "M2.5 16.5V12.5H6.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })] }));
4
+ const SaveStatusSavingIcon = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M5.00952 0.601385C8.65885 -0.895443 12.7584 0.497603 14.8201 3.71791C15.0887 4.1375 14.9696 4.6974 14.5538 4.96847C14.138 5.23951 13.5831 5.11924 13.3145 4.69972C11.7115 2.19573 8.52138 1.11368 5.6846 2.27721C3.41043 3.21003 1.97045 5.33611 1.79002 7.6519C1.75123 8.14991 1.31958 8.52218 0.826057 8.48304C0.33261 8.44382 -0.0359859 8.00811 0.00280092 7.51016C0.234328 4.53832 2.08281 1.80186 5.00952 0.601385Z", fill: "#6E6E6E" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.3651 5.05769C15.3638 5.30564 15.1649 5.50632 14.9192 5.5076L10.7188 5.52945C10.3184 5.53153 10.1164 5.04312 10.3996 4.75742L14.6217 0.496996C14.9048 0.211301 15.3888 0.415086 15.3867 0.819115L15.3651 5.05769Z", fill: "#6E6E6E" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.9905 15.3986C7.34115 16.8954 3.24155 15.5024 1.17987 12.2821C0.91126 11.8625 1.03041 11.3026 1.44621 11.0315C1.862 10.7605 2.41687 10.8808 2.68552 11.3003C4.28853 13.8043 7.47862 14.8863 10.3154 13.7228C12.5896 12.79 14.0296 10.6639 14.21 8.3481C14.2488 7.8501 14.6804 7.47782 15.1739 7.51696C15.6674 7.55618 16.036 7.99189 15.9972 8.48984C15.7657 11.4617 13.9172 14.1981 10.9905 15.3986Z", fill: "#6E6E6E" }), (0, jsx_runtime_1.jsx)("path", { d: "M0.634908 10.9423C0.636174 10.6944 0.835054 10.4937 1.08077 10.4924L5.28122 10.4706C5.68161 10.4685 5.88357 10.9569 5.60044 11.2426L1.37834 15.503C1.09521 15.7887 0.611191 15.5849 0.613255 15.1809L0.634908 10.9423Z", fill: "#6E6E6E" })] }));
5
5
  exports.default = SaveStatusSavingIcon;
@@ -89,9 +89,13 @@ const useMenus = (menus) => {
89
89
  document.removeEventListener('click', handleClickOutside);
90
90
  };
91
91
  }, []);
92
+ const closeAll = (0, react_1.useCallback)(() => {
93
+ setPointer(initialPointer);
94
+ }, []);
92
95
  return {
93
96
  menus: state,
94
97
  handleClick,
98
+ closeAll,
95
99
  ref,
96
100
  };
97
101
  };
@@ -92,6 +92,11 @@ export const SecondaryButton = styled(ButtonTemplate) `
92
92
  &:not([disabled]):active {
93
93
  ${(props) => btnColors(props.theme.colors.button.secondary.color.active, props.theme.colors.button.secondary.background.active, props.theme.colors.button.secondary.border.active, false)}
94
94
  }
95
+
96
+ &:focus-visible {
97
+ outline: 3px solid ${(props) => props.theme.colors.outline.focus};
98
+ outline-offset: 4px;
99
+ }
95
100
  `;
96
101
  export const PrimaryButton = styled(ButtonTemplate) `
97
102
  ${(props) => btnColors(props.theme.colors.button.primary.color.default, props.theme.colors.button.primary.background.default, props.theme.colors.button.primary.border.default, false)}
@@ -100,6 +105,11 @@ export const PrimaryButton = styled(ButtonTemplate) `
100
105
  ${(props) => btnColors(props.theme.colors.button.primary.color.hover, props.theme.colors.button.primary.background.hover, props.theme.colors.button.primary.border.hover, false)}
101
106
  }
102
107
 
108
+ &:focus-visible {
109
+ outline: 3px solid ${(props) => props.theme.colors.outline.focus} !important;
110
+ outline-offset: 4px;
111
+ }
112
+
103
113
  &:not([disabled]):active {
104
114
  ${(props) => btnColors(props.theme.colors.button.primary.color.active, props.theme.colors.button.primary.background.active, props.theme.colors.button.primary.border.active, false)}
105
115
  }
@@ -59,6 +59,11 @@ export const CheckboxLabel = styled.label `
59
59
  input:focus + div::before {
60
60
  border-color: ${(props) => props.theme.colors.button.primary.border.hover};
61
61
  }
62
+
63
+ input:focus-visible + div::before {
64
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
65
+ outline-offset: 2px;
66
+ }
62
67
  `;
63
68
  export const CheckboxField = styled.input.attrs({
64
69
  type: 'checkbox',
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
2
3
  import styled from 'styled-components';
3
4
  import { Submenu, SubmenusContainer, SubmenusContainerWrapper, Text, } from './Submenu';
4
5
  const MenusContainer = styled.div `
@@ -8,6 +9,11 @@ const MenusContainer = styled.div `
8
9
  const MenuHeading = styled.div `
9
10
  padding: 4px 8px;
10
11
  cursor: pointer;
12
+
13
+ &:focus-visible {
14
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
15
+ outline-offset: -2px;
16
+ }
11
17
  `;
12
18
  const MenuContainer = styled.div `
13
19
  position: relative;
@@ -22,13 +28,69 @@ const MenuContainer = styled.div `
22
28
  }
23
29
  }
24
30
  `;
25
- export const Menus = ({ menus, innerRef, handleClick, }) => {
26
- return (_jsx(MenusContainer, { ref: innerRef, "data-cy": 'manuscript-menus', children: menus.map((menu, index) => {
27
- return (_jsxs(MenuContainer, { "data-cy": 'menu', isEnabled: menu.isEnabled, children: [_jsx(MenuHeading, { onMouseDown: (e) => {
31
+ export const Menus = ({ menus, innerRef, handleClick, closeAll, }) => {
32
+ const menuHeadingsRef = useRef([]);
33
+ useEffect(() => {
34
+ menuHeadingsRef.current.forEach((heading, index) => {
35
+ if (heading) {
36
+ heading.tabIndex = index === 0 ? 0 : -1;
37
+ }
38
+ });
39
+ }, [menus]);
40
+ const handleKeyDown = (event) => {
41
+ const target = event.target;
42
+ const currentIndex = menuHeadingsRef.current.findIndex((heading) => heading === target);
43
+ if (currentIndex === -1) {
44
+ return;
45
+ }
46
+ switch (event.key) {
47
+ case 'ArrowRight': {
48
+ event.preventDefault();
49
+ const nextIndex = (currentIndex + 1) % menuHeadingsRef.current.length;
50
+ menuHeadingsRef.current[nextIndex]?.focus();
51
+ break;
52
+ }
53
+ case 'ArrowLeft': {
54
+ event.preventDefault();
55
+ const prevIndex = (currentIndex - 1 + menuHeadingsRef.current.length) %
56
+ menuHeadingsRef.current.length;
57
+ menuHeadingsRef.current[prevIndex]?.focus();
58
+ break;
59
+ }
60
+ case 'Enter': {
61
+ event.preventDefault();
62
+ handleClick([currentIndex]);
63
+ break;
64
+ }
65
+ case 'Escape': {
66
+ event.preventDefault();
67
+ event.stopPropagation();
68
+ closeAll();
69
+ break;
70
+ }
71
+ case 'ArrowDown': {
72
+ event.preventDefault();
73
+ const menu = menus[currentIndex];
74
+ if (menu && !menu.isOpen) {
75
+ handleClick([currentIndex]);
76
+ }
77
+ const menuContainer = event.currentTarget.children[currentIndex];
78
+ setTimeout(() => {
79
+ const firstItem = menuContainer?.querySelector('[data-submenu-item]');
80
+ firstItem?.focus();
81
+ }, 0);
82
+ break;
83
+ }
84
+ }
85
+ };
86
+ return (_jsx(MenusContainer, { ref: innerRef, "data-cy": 'manuscript-menus', onKeyDown: handleKeyDown, children: menus.map((menu, index) => {
87
+ return (_jsxs(MenuContainer, { "data-cy": 'menu', isEnabled: menu.isEnabled, children: [_jsx(MenuHeading, { ref: (el) => {
88
+ menuHeadingsRef.current[index] = el;
89
+ }, onMouseDown: (e) => {
28
90
  e.preventDefault();
29
91
  handleClick([index]);
30
- }, isOpen: menu.isOpen, children: _jsx(Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && (_jsx(SubmenusContainerWrapper, { children: _jsx(SubmenusContainer, { children: menu.submenu.map((submenu, sindex) => {
31
- return (_jsx(Submenu, { menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]) }, `${index}-${sindex}`));
92
+ }, isOpen: menu.isOpen, children: _jsx(Text, { children: menu.label }) }), menu.isEnabled && menu.isOpen && menu.submenu && (_jsx(SubmenusContainerWrapper, { children: _jsx(SubmenusContainer, { "data-submenu-container": true, tabIndex: -1, children: menu.submenu.map((submenu, sindex) => {
93
+ return (_jsx(Submenu, { menu: submenu, handleClick: (i) => handleClick([index, sindex, ...i]), closeAll: closeAll }, `${index}-${sindex}`));
32
94
  }) }) }))] }, `menu-${index}`));
33
95
  }) }));
34
96
  };
@@ -32,6 +32,10 @@ export const SubmenusContainer = styled.div `
32
32
  &[data-placement='right-start'] {
33
33
  top: 8px;
34
34
  }
35
+
36
+ &:focus-visible {
37
+ outline: none;
38
+ }
35
39
  `;
36
40
  export const NestedSubmenusContainer = styled(SubmenusContainer) `
37
41
  position: absolute;
@@ -60,9 +64,10 @@ const Container = styled.div `
60
64
  align-items: center;
61
65
  cursor: pointer;
62
66
  padding: 8px 16px 8px 4px;
67
+ outline: none;
63
68
  ${(props) => props.isOpen && 'background: #f2fbfc;'}
64
69
 
65
- &:hover {
70
+ &:hover, &:focus {
66
71
  background: #f2fbfc;
67
72
  }
68
73
 
@@ -72,24 +77,91 @@ const Container = styled.div `
72
77
  }
73
78
  `;
74
79
  const activeContent = (menu) => (menu.isActive ? '✓' : '');
75
- export const SubmenuLabel = ({ menu, handleClick }) => {
80
+ export const SubmenuLabel = ({ menu, handleClick, closeAll, }) => {
76
81
  if (isMenuSeparator(menu)) {
77
82
  return null;
78
83
  }
79
- return (_jsxs(Container, { isOpen: menu.isOpen, "data-cy": 'submenu', className: menu.isEnabled ? '' : 'disabled', onMouseDown: (e) => {
84
+ const handleKeyDown = (e) => {
85
+ if (isMenuSeparator(menu)) {
86
+ return;
87
+ }
88
+ const currentElement = e.currentTarget;
89
+ const submenuContainer = currentElement.closest('[data-submenu-container]');
90
+ if (!submenuContainer) {
91
+ return;
92
+ }
93
+ const items = Array.from(submenuContainer.querySelectorAll('[data-submenu-item]'));
94
+ const currentIndex = items.indexOf(currentElement);
95
+ const focusMenuHeading = () => {
96
+ const menuContainer = currentElement.closest('[data-cy="menu"]');
97
+ const menuHeading = menuContainer?.querySelector('[tabindex]');
98
+ menuHeading?.focus();
99
+ };
100
+ e.preventDefault();
101
+ e.stopPropagation();
102
+ switch (e.key) {
103
+ case 'ArrowDown': {
104
+ const nextIndex = currentIndex + 1;
105
+ const nextItem = items[nextIndex] || items[0];
106
+ nextItem?.focus();
107
+ break;
108
+ }
109
+ case 'ArrowUp': {
110
+ const prevIndex = currentIndex - 1;
111
+ const prevItem = items[prevIndex] || items[items.length - 1];
112
+ prevItem?.focus();
113
+ break;
114
+ }
115
+ case 'ArrowRight': {
116
+ if (menu.submenu) {
117
+ handleClick([]);
118
+ setTimeout(() => {
119
+ const nestedContainer = currentElement.nextElementSibling;
120
+ const firstItem = nestedContainer?.querySelector('[data-submenu-item]');
121
+ firstItem?.focus();
122
+ }, 0);
123
+ }
124
+ break;
125
+ }
126
+ case 'ArrowLeft': {
127
+ const parentContainer = submenuContainer?.parentElement?.closest('[data-submenu-container]');
128
+ if (parentContainer) {
129
+ const parentLabel = parentContainer.querySelector(':scope > [data-submenu-item]');
130
+ parentLabel?.focus();
131
+ }
132
+ else {
133
+ focusMenuHeading();
134
+ closeAll();
135
+ }
136
+ break;
137
+ }
138
+ case 'Escape': {
139
+ closeAll();
140
+ focusMenuHeading();
141
+ break;
142
+ }
143
+ case 'Enter': {
144
+ if (menu.isEnabled) {
145
+ handleClick([]);
146
+ }
147
+ break;
148
+ }
149
+ }
150
+ };
151
+ return (_jsxs(Container, { isOpen: menu.isOpen, "data-cy": 'submenu', "data-submenu-item": true, className: menu.isEnabled ? '' : 'disabled', tabIndex: -1, onMouseDown: (e) => {
80
152
  e.preventDefault();
81
153
  handleClick([]);
82
- }, children: [_jsx(Active, { children: activeContent(menu) }), _jsx(Text, { children: menu.label }), menu.submenu && _jsx(Arrow, {}), menu.shortcut && _jsx(Shortcut, { shortcut: menu.shortcut })] }));
154
+ }, onKeyDown: handleKeyDown, children: [_jsx(Active, { children: activeContent(menu) }), _jsx(Text, { children: menu.label }), menu.submenu && _jsx(Arrow, {}), menu.shortcut && _jsx(Shortcut, { shortcut: menu.shortcut })] }));
83
155
  };
84
- export const Submenu = ({ menu, handleClick }) => {
156
+ export const Submenu = ({ menu, handleClick, closeAll, }) => {
85
157
  if (isMenuSeparator(menu)) {
86
158
  return _jsx(Separator, {});
87
159
  }
88
160
  if (menu.component) {
89
- return _jsx(menu.component, { menu: menu, handleClick: handleClick });
161
+ return _jsx(menu.component, { menu: menu, handleClick: handleClick, closeAll: closeAll });
90
162
  }
91
163
  if (!menu.submenu) {
92
- return _jsx(SubmenuLabel, { menu: menu, handleClick: handleClick });
164
+ return (_jsx(SubmenuLabel, { menu: menu, handleClick: handleClick, closeAll: closeAll }));
93
165
  }
94
- return (_jsxs(SubmenuContainer, { "data-cy": 'submenu', children: [_jsx(SubmenuLabel, { menu: menu, handleClick: handleClick }), menu.submenu && menu.isOpen && (_jsx(NestedSubmenusContainer, { children: menu.submenu.map((submenu, index) => (_jsx(Submenu, { menu: submenu, handleClick: (i) => handleClick([index, ...i]) }, `menu-${index}`))) }))] }));
166
+ return (_jsxs(SubmenuContainer, { "data-cy": 'submenu', children: [_jsx(SubmenuLabel, { menu: menu, handleClick: handleClick, closeAll: closeAll }), menu.submenu && menu.isOpen && (_jsx(NestedSubmenusContainer, { "data-submenu-container": true, children: menu.submenu.map((submenu, index) => (_jsx(Submenu, { menu: submenu, handleClick: (i) => handleClick([index, ...i]), closeAll: closeAll }, `menu-${index}`))) }))] }));
95
167
  };
@@ -106,4 +106,4 @@ export const NavDropdownButtonContainer = styled(SecondaryButton).attrs((props)
106
106
  stroke: currentColor;
107
107
  }
108
108
  `;
109
- export const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, }) => (_jsxs(NavDropdownButtonContainer, { as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle', children: [_jsx(NavDropdownButtonText, { children: children }), !!notificationsCount && (_jsx(NotificationsBadge, { isOpen: isOpen, children: notificationsCount })), !removeChevron && _jsx(NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
109
+ export const NavDropdownButton = ({ as, children, disabled, isOpen, notificationsCount, onClick, removeChevron, buttonRef, }) => (_jsxs(NavDropdownButtonContainer, { ref: buttonRef, as: as, disabled: disabled, onClick: onClick, isOpen: isOpen, className: 'dropdown-toggle', tabIndex: 0, children: [_jsx(NavDropdownButtonText, { children: children }), !!notificationsCount && (_jsx(NotificationsBadge, { isOpen: isOpen, children: notificationsCount })), !removeChevron && _jsx(NavDropdownToggle, { className: isOpen ? 'open' : '' })] }));
@@ -15,7 +15,7 @@ export class ResizerButton extends React.PureComponent {
15
15
  render() {
16
16
  const { buttonInner, direction, side, isCollapsed, onClick, isVisible } = this.props;
17
17
  const ResizerButtonInner = buttonInner || inners[direction][side];
18
- return (_jsx(ResizerButtonInner, { "aria-expanded": !isCollapsed, isCollapsed: isCollapsed, isVisible: isVisible, onClick: onClick, onMouseDown: (event) => event.preventDefault() }));
18
+ return (_jsx(ResizerButtonInner, { "aria-expanded": !isCollapsed, isCollapsed: isCollapsed, isVisible: isVisible, onClick: onClick, onMouseDown: (event) => event.preventDefault(), tabIndex: 0 }));
19
19
  }
20
20
  }
21
21
  ResizerButton.defaultProps = {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from 'styled-components';
3
- import { AttentionRedIcon, SaveStatusOfflineIcon, SaveStatusSavedIcon, SaveStatusSavingIcon, } from './icons';
3
+ import { SaveStatusErrorIcon, SaveStatusOfflineIcon, SaveStatusSavedIcon, SaveStatusSavingIcon, } from './icons';
4
4
  export const SaveStatus = ({ status }) => {
5
5
  switch (status) {
6
6
  case 'offline':
@@ -10,7 +10,7 @@ export const SaveStatus = ({ status }) => {
10
10
  case 'saved':
11
11
  return (_jsxs(Container, { children: [_jsx(PopPop, { children: _jsx(SaveStatusSavedIcon, {}) }), _jsx(Text, { children: "Saved" })] }));
12
12
  case 'failed':
13
- return (_jsxs(FailedContainer, { children: [_jsx(PopPop, { children: _jsx(AttentionRedIcon, {}) }), _jsx(FailedText, { children: "Failed To Save" })] }));
13
+ return (_jsxs(FailedContainer, { children: [_jsx(PopPop, { children: _jsx(SaveStatusErrorIcon, {}) }), _jsx(FailedText, { children: "Save error" })] }));
14
14
  default:
15
15
  return null;
16
16
  }
@@ -29,7 +29,7 @@ const Text = styled.span `
29
29
  margin-left: 0.5em;
30
30
  font-family: ${(props) => props.theme.font.family.Lato};
31
31
  font-size: 14px;
32
- font-weight: 700;
32
+ font-weight: 400;
33
33
  `;
34
34
  const FailedContainer = styled(Container) `
35
35
  path {
@@ -38,7 +38,7 @@ const FailedContainer = styled(Container) `
38
38
  }
39
39
  `;
40
40
  const FailedText = styled(Text) `
41
- color: ${(props) => props.theme.colors.text.error};
41
+ color: ${(props) => props.theme.colors.text.secondary};
42
42
  `;
43
43
  const RotateContinuous = styled.div `
44
44
  svg {
@@ -2,10 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styled from 'styled-components';
3
3
  import { TriangleCollapsedIcon, TriangleExpandedIcon } from './icons';
4
4
  export const ToggleHeader = ({ title, isOpen, onToggle, }) => {
5
- return (_jsxs(ToggleHeaderContainer, { onClick: (e) => {
6
- e.stopPropagation();
7
- onToggle();
8
- }, children: [_jsx("span", { children: title }), _jsx(ToggleIcon, { isOpen: isOpen, children: isOpen ? _jsx(TriangleExpandedIcon, {}) : _jsx(TriangleCollapsedIcon, {}) })] }));
5
+ const handleToggle = (e) => {
6
+ e.stopPropagation();
7
+ onToggle();
8
+ };
9
+ const handleKeyDown = (e) => {
10
+ if (e.key === 'Enter') {
11
+ e.preventDefault();
12
+ handleToggle(e);
13
+ }
14
+ };
15
+ return (_jsxs(ToggleHeaderContainer, { onClick: handleToggle, children: [_jsx("span", { children: title }), _jsx(ToggleIcon, { isOpen: isOpen, onKeyDown: handleKeyDown, tabIndex: 0, children: isOpen ? _jsx(TriangleExpandedIcon, {}) : _jsx(TriangleCollapsedIcon, {}) })] }));
9
16
  };
10
17
  const ToggleHeaderContainer = styled.div `
11
18
  display: flex;
@@ -30,6 +37,11 @@ export const ToggleIcon = styled.div `
30
37
  text-align: center;
31
38
  cursor: pointer;
32
39
 
40
+ &:focus-visible {
41
+ outline: 2px solid ${(props) => props.theme.colors.outline.focus};
42
+ outline-offset: 2px;
43
+ }
44
+
33
45
  svg {
34
46
  width: 19px;
35
47
  height: 19px;
@@ -92,6 +92,7 @@ export { default as RoleReadingIcon } from './role-reading';
92
92
  export { default as SaveStatusOfflineIcon } from './save-status-offline';
93
93
  export { default as SaveStatusSavedIcon } from './save-status-saved';
94
94
  export { default as SaveStatusSavingIcon } from './save-status-saving';
95
+ export { default as SaveStatusErrorIcon } from './save-status-error';
95
96
  export { default as ScrollIcon } from './scroll';
96
97
  export { default as SearchIcon } from './search';
97
98
  export { default as SectionCategoryIcon } from './section-category';
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const SaveStatusErrorIcon = (props) => (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M1.78138 8.66481C-0.264932 9.8341 0.0274413 13.0505 2.65849 13.0511H12.8905C15.5215 13.0511 17.2757 8.07953 12.8904 6.90971C12.5981 3.1078 7.04369 1.35262 4.99722 5.44728C3.24317 5.44728 1.78146 6.61707 1.78138 8.66481Z", fill: "white" }), _jsx("path", { d: "M4.72879 5.01736C5.87898 2.95783 7.91126 2.36194 9.70374 2.79082C11.4478 3.20821 13.0047 4.60833 13.2924 6.5716C14.3175 6.9008 15.037 7.4474 15.4775 8.12298C15.9565 8.85769 16.0788 9.70245 15.9548 10.4877C15.7142 12.0118 14.4922 13.49 12.8904 13.49H2.65842C1.90751 13.4898 1.28935 13.2579 0.834706 12.8599C0.382925 12.4644 0.119408 11.9279 0.0324793 11.3628C-0.129481 10.3096 0.315 9.11972 1.34973 8.41657C1.40498 7.39534 1.80147 6.55959 2.43174 5.96841C3.04545 5.39277 3.85636 5.07181 4.72879 5.01736ZM9.49933 3.64419C7.99607 3.28458 6.3123 3.79692 5.38942 5.6434C5.31514 5.79202 5.16325 5.88616 4.99715 5.88616C4.21663 5.88616 3.52442 6.1456 3.03127 6.60815C2.54256 7.06657 2.21994 7.75174 2.2199 8.66504C2.21982 8.82233 2.13541 8.96738 1.99893 9.04546C1.13936 9.53664 0.779611 10.4521 0.899227 11.2297C0.958506 11.6148 1.13361 11.9555 1.41254 12.1996C1.68873 12.4414 2.09385 12.6125 2.65842 12.6126H12.8904C13.9195 12.6126 14.8901 11.6047 15.0881 10.3507C15.1834 9.74683 15.0864 9.12867 14.7432 8.60221C14.4018 8.07861 13.7893 7.60354 12.7773 7.33358C12.5974 7.28556 12.4673 7.12915 12.453 6.94345C12.3239 5.26421 11.0281 4.00999 9.49933 3.64419Z", fill: "#F35143" }), _jsx("path", { d: "M8.52701 9.50991C8.40149 9.50991 8.30327 9.4717 8.23233 9.39527C8.16138 9.31884 8.11773 9.20693 8.10136 9.05953L7.83942 6.25898C7.81213 6.01332 7.85852 5.81679 7.97857 5.6694C8.09863 5.51654 8.28144 5.44011 8.52701 5.44011C8.76166 5.44011 8.93901 5.51654 9.05907 5.6694C9.17912 5.81679 9.22551 6.01332 9.19822 6.25898L8.93629 9.05953C8.91992 9.20693 8.87626 9.31884 8.80532 9.39527C8.73983 9.4717 8.64706 9.50991 8.52701 9.50991ZM8.52701 11.3278C8.30873 11.3278 8.1341 11.2623 8.00313 11.1313C7.87762 11.0003 7.81486 10.831 7.81486 10.6236C7.81486 10.4216 7.87762 10.2578 8.00313 10.1323C8.1341 10.0012 8.30873 9.93572 8.52701 9.93572C8.74529 9.93572 8.91446 10.0012 9.03451 10.1323C9.16002 10.2578 9.22278 10.4216 9.22278 10.6236C9.22278 10.831 9.16002 11.0003 9.03451 11.1313C8.91446 11.2623 8.74529 11.3278 8.52701 11.3278Z", fill: "#F35143" })] }));
3
+ export default SaveStatusErrorIcon;
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const SaveStatusSavedIcon = (props) => (_jsxs("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M9 16.5C13.1421 16.5 16.5 13.1421 16.5 9C16.5 4.85786 13.1421 1.5 9 1.5C4.85786 1.5 1.5 4.85786 1.5 9C1.5 13.1421 4.85786 16.5 9 16.5Z", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M5.5 8.5L8 11L13 6", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })] }));
2
+ const SaveStatusSavedIcon = (props) => (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M4.72879 5.01493C5.87898 2.95619 7.91126 2.36052 9.70374 2.78924C11.4478 3.20647 13.0047 4.60605 13.2923 6.56856C14.3175 6.89764 15.037 7.44403 15.4775 8.11934C15.9565 8.85377 16.0788 9.69821 15.9548 10.4832C15.7142 12.0067 14.4922 13.4843 12.8904 13.4843H2.65842C1.90751 13.4841 1.28935 13.2523 0.834706 12.8545C0.382925 12.4591 0.119408 11.9228 0.0324793 11.3579C-0.129481 10.3052 0.315 9.1157 1.34973 8.41283C1.40498 7.39199 1.80147 6.55656 2.43174 5.96561C3.04545 5.39019 3.85636 5.06936 4.72879 5.01493ZM9.49933 3.64229C7.99607 3.28281 6.3123 3.79496 5.38941 5.64072C5.31514 5.78928 5.16325 5.88339 4.99715 5.88339C4.21663 5.88339 3.52442 6.14273 3.03127 6.6051C2.54256 7.06335 2.21994 7.74825 2.2199 8.6612C2.21982 8.81843 2.13541 8.96342 1.99893 9.04148C1.13936 9.53246 0.779611 10.4476 0.899227 11.2249C0.958506 11.6098 1.13361 11.9504 1.41254 12.1944C1.68873 12.4361 2.09385 12.6071 2.65842 12.6072H12.8904C13.9195 12.6072 14.8901 11.5998 15.0881 10.3462C15.1834 9.74258 15.0864 9.12466 14.7432 8.5984C14.4018 8.075 13.7893 7.60011 12.7773 7.33025C12.5974 7.28225 12.4673 7.1259 12.453 6.94027C12.3239 5.26168 11.0281 4.00794 9.49933 3.64229Z", fill: "#353535" }), _jsx("path", { d: "M5.83375 8.60263C5.61415 8.37347 5.25942 8.36752 5.03713 8.59372L5.16258 8.46607C4.94222 8.6903 4.94257 9.0575 5.16092 9.28367L6.64735 10.8234C6.8668 11.0507 7.22857 11.0583 7.45382 10.8418L10.6709 7.75008C10.8968 7.53293 10.9033 7.17708 10.681 6.95088L10.8064 7.07853C10.5861 6.85429 10.2218 6.84877 9.9951 7.06413L7.04469 9.86626L5.83375 8.60263Z", fill: "#353535" }), _jsx("path", { d: "M9.9951 7.06413C10.1999 6.86962 10.5167 6.85567 10.7385 7.01999C10.8996 7.24472 10.875 7.55387 10.6709 7.75008L7.45382 10.8418C7.24263 11.0448 6.91162 11.0506 6.69024 10.8633L6.64735 10.8234L5.16092 9.28367C4.96369 9.07931 4.94457 8.75992 5.1052 8.5348C5.32688 8.37089 5.63536 8.39561 5.83375 8.60263L7.04469 9.86626L9.9951 7.06413ZM5.16258 8.46607C5.14132 8.4877 5.12235 8.51076 5.1052 8.5348C5.08152 8.55231 5.05858 8.5719 5.03713 8.59372L5.16258 8.46607ZM10.8064 7.07853C10.7852 7.05691 10.7622 7.03754 10.7385 7.01999C10.7213 6.99601 10.7024 6.97269 10.681 6.95088L10.8064 7.07853Z", fill: "#353535" })] }));
3
3
  export default SaveStatusSavedIcon;
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const SaveStatusSavingIcon = (props) => (_jsxs("svg", { width: "17", height: "18", viewBox: "0 0 17 18", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M1.5 8.5C1.5 4.634 4.634 1.5 8.5 1.5C11.136 1.5 13.328 3.141 14.5 5.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M14.5 1.5V5.5H10.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M15.5 9.5C15.5 13.366 12.366 16.5 8.5 16.5C5.864 16.5 3.672 14.859 2.5 12.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2.5 16.5V12.5H6.5", stroke: "#6E6E6E", strokeWidth: "1.5", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })] }));
2
+ const SaveStatusSavingIcon = (props) => (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M5.00952 0.601385C8.65885 -0.895443 12.7584 0.497603 14.8201 3.71791C15.0887 4.1375 14.9696 4.6974 14.5538 4.96847C14.138 5.23951 13.5831 5.11924 13.3145 4.69972C11.7115 2.19573 8.52138 1.11368 5.6846 2.27721C3.41043 3.21003 1.97045 5.33611 1.79002 7.6519C1.75123 8.14991 1.31958 8.52218 0.826057 8.48304C0.33261 8.44382 -0.0359859 8.00811 0.00280092 7.51016C0.234328 4.53832 2.08281 1.80186 5.00952 0.601385Z", fill: "#6E6E6E" }), _jsx("path", { d: "M15.3651 5.05769C15.3638 5.30564 15.1649 5.50632 14.9192 5.5076L10.7188 5.52945C10.3184 5.53153 10.1164 5.04312 10.3996 4.75742L14.6217 0.496996C14.9048 0.211301 15.3888 0.415086 15.3867 0.819115L15.3651 5.05769Z", fill: "#6E6E6E" }), _jsx("path", { d: "M10.9905 15.3986C7.34115 16.8954 3.24155 15.5024 1.17987 12.2821C0.91126 11.8625 1.03041 11.3026 1.44621 11.0315C1.862 10.7605 2.41687 10.8808 2.68552 11.3003C4.28853 13.8043 7.47862 14.8863 10.3154 13.7228C12.5896 12.79 14.0296 10.6639 14.21 8.3481C14.2488 7.8501 14.6804 7.47782 15.1739 7.51696C15.6674 7.55618 16.036 7.99189 15.9972 8.48984C15.7657 11.4617 13.9172 14.1981 10.9905 15.3986Z", fill: "#6E6E6E" }), _jsx("path", { d: "M0.634908 10.9423C0.636174 10.6944 0.835054 10.4937 1.08077 10.4924L5.28122 10.4706C5.68161 10.4685 5.88357 10.9569 5.60044 11.2426L1.37834 15.503C1.09521 15.7887 0.611191 15.5849 0.613255 15.1809L0.634908 10.9423Z", fill: "#6E6E6E" })] }));
3
3
  export default SaveStatusSavingIcon;
@@ -86,9 +86,13 @@ export const useMenus = (menus) => {
86
86
  document.removeEventListener('click', handleClickOutside);
87
87
  };
88
88
  }, []);
89
+ const closeAll = useCallback(() => {
90
+ setPointer(initialPointer);
91
+ }, []);
89
92
  return {
90
93
  menus: state,
91
94
  handleClick,
95
+ closeAll,
92
96
  ref,
93
97
  };
94
98
  };
@@ -19,6 +19,7 @@ interface MenusProps {
19
19
  menus: Menu[];
20
20
  innerRef: Ref<HTMLDivElement>;
21
21
  handleClick: (position: number[]) => void;
22
+ closeAll: () => void;
22
23
  }
23
24
  export declare const Menus: React.FC<MenusProps>;
24
25
  export {};
@@ -23,6 +23,7 @@ export declare const NestedSubmenusContainer: import("styled-components").Styled
23
23
  export interface SubmenuProps {
24
24
  menu: Menu | MenuSeparator;
25
25
  handleClick: (position: number[]) => void;
26
+ closeAll: () => void;
26
27
  }
27
28
  export declare const SubmenuLabel: React.FC<SubmenuProps>;
28
29
  export declare const Submenu: React.FC<SubmenuProps>;
@@ -52,6 +52,7 @@ interface DropdownButtonProps {
52
52
  onClick?: React.MouseEventHandler;
53
53
  removeChevron?: boolean;
54
54
  children: React.ReactNode;
55
+ buttonRef?: React.Ref<HTMLButtonElement>;
55
56
  }
56
57
  export declare const NavDropdownButton: React.FunctionComponent<DropdownButtonProps>;
57
58
  export {};
@@ -92,6 +92,7 @@ export { default as RoleReadingIcon } from './role-reading';
92
92
  export { default as SaveStatusOfflineIcon } from './save-status-offline';
93
93
  export { default as SaveStatusSavedIcon } from './save-status-saved';
94
94
  export { default as SaveStatusSavingIcon } from './save-status-saving';
95
+ export { default as SaveStatusErrorIcon } from './save-status-error';
95
96
  export { default as ScrollIcon } from './scroll';
96
97
  export { default as SearchIcon } from './search';
97
98
  export { default as SectionCategoryIcon } from './section-category';
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * © 2025 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 { IconProps } from './types';
18
+ declare const SaveStatusErrorIcon: React.FC<IconProps>;
19
+ export default SaveStatusErrorIcon;
@@ -2,5 +2,6 @@ import { Menu, MenuSpec } from '../lib/menus';
2
2
  export declare const useMenus: (menus: MenuSpec[]) => {
3
3
  menus: Menu[];
4
4
  handleClick: (indices: number[]) => void;
5
+ closeAll: () => void;
5
6
  ref: import("react").RefObject<HTMLDivElement | null>;
6
7
  };
@@ -21,6 +21,7 @@ export interface MenuShortcut {
21
21
  export interface MenuComponentProps {
22
22
  menu: Menu;
23
23
  handleClick: (position: number[]) => void;
24
+ closeAll: () => void;
24
25
  }
25
26
  export interface MenuSpec {
26
27
  id: string;
@@ -26,6 +26,10 @@ interface Colors {
26
26
  brand: Brand;
27
27
  button: Button;
28
28
  text: Text & Alerts & Variations;
29
+ outline: Outline;
30
+ }
31
+ interface Outline {
32
+ focus: string;
29
33
  }
30
34
  interface Font {
31
35
  family: FontFamily;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/style-guide",
3
3
  "description": "Shared components for Manuscripts applications",
4
- "version": "3.3.11",
4
+ "version": "3.3.13",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",