@manuscripts/style-guide 3.5.31 → 3.5.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Manuscripts Style Guide
2
+ # 2026-06-11 16:44:00
2
3
 
3
4
  React components for Manuscripts applications.
4
5
 
@@ -23,3 +24,4 @@ Run `yarn build` to build the `dist` folder for distribution.
23
24
  Run `yarn dev` to automatically rebuild when a file is changed.
24
25
 
25
26
  If a component needs new theme properties, add the types to `src/theme.ts` and add the corresponding values to `.storybook/theme.ts`.
27
+
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2025 Atypon Systems LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.ShortcutConnector = exports.Shortcut = void 0;
22
+ const styled_components_1 = __importDefault(require("styled-components"));
23
+ exports.Shortcut = styled_components_1.default.span `
24
+ display: inline-flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ min-width: 28px;
28
+ height: 28px;
29
+ border-radius: ${({ theme }) => theme.grid.radius.small};
30
+ background: ${({ theme }) => theme.colors.background.primary};
31
+ font-size: ${({ theme }) => theme.font.size.small};
32
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.10);
33
+ `;
34
+ exports.ShortcutConnector = styled_components_1.default.span `
35
+ padding: 0 ${({ theme }) => theme.grid.unit * 2}px;
36
+ `;
@@ -40,7 +40,7 @@ const react_dom_1 = require("react-dom");
40
40
  const styled_components_1 = __importStar(require("styled-components"));
41
41
  const Button_1 = require("./Button");
42
42
  const Sidebar_1 = require("./Sidebar");
43
- const StyledModalContent = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick = true, hideOverlay = false, pointerEventsOnBackdrop, children, className, style, }) => {
43
+ const StyledModalContent = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick = true, hideOverlay = false, pointerEventsOnBackdrop, children, className, style, ariaLabelledby, id, }) => {
44
44
  const dialogRef = (0, react_1.useRef)(null);
45
45
  const closedByCancelRef = (0, react_1.useRef)(false);
46
46
  (0, react_1.useEffect)(() => {
@@ -95,7 +95,7 @@ const StyledModalContent = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick
95
95
  return ((0, jsx_runtime_1.jsx)(Dialog, { ref: dialogRef, onClick: e => {
96
96
  e.stopPropagation();
97
97
  handleBackdropClick(e);
98
- }, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className ? `Modal ${className}` : 'Modal', style: style?.content, children: children }));
98
+ }, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className ? `Modal ${className}` : 'Modal', style: style?.content, "aria-labelledby": ariaLabelledby ? ariaLabelledby : undefined, id: id ? id : undefined, children: children }));
99
99
  };
100
100
  exports.StyledModalContent = StyledModalContent;
101
101
  const StyledModal = (props) => {
@@ -43,11 +43,14 @@ function trapFocus(e, element) {
43
43
  lastElement.focus();
44
44
  }
45
45
  }
46
- const useFocusCycle = (containerRef) => {
46
+ const useFocusCycle = (containerRef, enabled = true) => {
47
47
  (0, react_1.useEffect)(() => {
48
+ if (!enabled) {
49
+ return;
50
+ }
48
51
  const handleKeyDown = (e) => trapFocus(e, containerRef.current);
49
52
  document.addEventListener('keydown', handleKeyDown);
50
53
  return () => document.removeEventListener('keydown', handleKeyDown);
51
- }, [containerRef]);
54
+ }, [containerRef, enabled]);
52
55
  };
53
56
  exports.useFocusCycle = useFocusCycle;
package/dist/cjs/index.js CHANGED
@@ -70,8 +70,9 @@ __exportStar(require("./components/Form"), exports);
70
70
  __exportStar(require("./components/MultiValueInput"), exports);
71
71
  __exportStar(require("./components/Resizer"), exports);
72
72
  __exportStar(require("./components/SaveStatus"), exports);
73
- __exportStar(require("./components/StyledModal"), exports);
73
+ __exportStar(require("./components/Shortcut"), exports);
74
74
  __exportStar(require("./components/Sidebar"), exports);
75
+ __exportStar(require("./components/StyledModal"), exports);
75
76
  __exportStar(require("./components/TextField"), exports);
76
77
  __exportStar(require("./components/FormFieldContainer"), exports);
77
78
  __exportStar(require("./components/FormCommon"), exports);
@@ -0,0 +1,30 @@
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 styled from 'styled-components';
17
+ export const Shortcut = styled.span `
18
+ display: inline-flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ min-width: 28px;
22
+ height: 28px;
23
+ border-radius: ${({ theme }) => theme.grid.radius.small};
24
+ background: ${({ theme }) => theme.colors.background.primary};
25
+ font-size: ${({ theme }) => theme.font.size.small};
26
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.10);
27
+ `;
28
+ export const ShortcutConnector = styled.span `
29
+ padding: 0 ${({ theme }) => theme.grid.unit * 2}px;
30
+ `;
@@ -4,7 +4,7 @@ import { createPortal } from 'react-dom';
4
4
  import styled, { css } from 'styled-components';
5
5
  import { RoundIconButton } from './Button';
6
6
  import { SidebarStyles } from './Sidebar';
7
- export const StyledModalContent = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick = true, hideOverlay = false, pointerEventsOnBackdrop, children, className, style, }) => {
7
+ export const StyledModalContent = ({ isOpen, onRequestClose, shouldCloseOnOverlayClick = true, hideOverlay = false, pointerEventsOnBackdrop, children, className, style, ariaLabelledby, id, }) => {
8
8
  const dialogRef = useRef(null);
9
9
  const closedByCancelRef = useRef(false);
10
10
  useEffect(() => {
@@ -59,7 +59,7 @@ export const StyledModalContent = ({ isOpen, onRequestClose, shouldCloseOnOverla
59
59
  return (_jsx(Dialog, { ref: dialogRef, onClick: e => {
60
60
  e.stopPropagation();
61
61
  handleBackdropClick(e);
62
- }, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className ? `Modal ${className}` : 'Modal', style: style?.content, children: children }));
62
+ }, "$hideOverlay": hideOverlay, "$pointerEventsOnBackdrop": pointerEventsOnBackdrop, className: className ? `Modal ${className}` : 'Modal', style: style?.content, "aria-labelledby": ariaLabelledby ? ariaLabelledby : undefined, id: id ? id : undefined, children: children }));
63
63
  };
64
64
  export const StyledModal = (props) => {
65
65
  return createPortal(_jsx(StyledModalContent, { ...props }), document.body);
@@ -38,10 +38,13 @@ export function trapFocus(e, element) {
38
38
  lastElement.focus();
39
39
  }
40
40
  }
41
- export const useFocusCycle = (containerRef) => {
41
+ export const useFocusCycle = (containerRef, enabled = true) => {
42
42
  useEffect(() => {
43
+ if (!enabled) {
44
+ return;
45
+ }
43
46
  const handleKeyDown = (e) => trapFocus(e, containerRef.current);
44
47
  document.addEventListener('keydown', handleKeyDown);
45
48
  return () => document.removeEventListener('keydown', handleKeyDown);
46
- }, [containerRef]);
49
+ }, [containerRef, enabled]);
47
50
  };
package/dist/es/index.js CHANGED
@@ -29,8 +29,9 @@ export * from './components/Form';
29
29
  export * from './components/MultiValueInput';
30
30
  export * from './components/Resizer';
31
31
  export * from './components/SaveStatus';
32
- export * from './components/StyledModal';
32
+ export * from './components/Shortcut';
33
33
  export * from './components/Sidebar';
34
+ export * from './components/StyledModal';
34
35
  export * from './components/TextField';
35
36
  export * from './components/FormFieldContainer';
36
37
  export * from './components/FormCommon';
@@ -0,0 +1,17 @@
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
+ export declare const Shortcut: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
17
+ export declare const ShortcutConnector: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
@@ -25,6 +25,8 @@ interface StyledModalProps {
25
25
  style?: {
26
26
  content?: React.CSSProperties;
27
27
  };
28
+ ariaLabelledby?: string;
29
+ id?: string;
28
30
  }
29
31
  export declare const StyledModalContent: React.FC<StyledModalProps>;
30
32
  export declare const StyledModal: React.FC<StyledModalProps>;
@@ -1,4 +1,4 @@
1
1
  import { RefObject } from 'react';
2
2
  export declare function getFocusableElements(element: HTMLElement): HTMLElement[];
3
3
  export declare function trapFocus(e: KeyboardEvent, element: HTMLElement | null): void;
4
- export declare const useFocusCycle: (containerRef: RefObject<HTMLDivElement | null>) => void;
4
+ export declare const useFocusCycle: (containerRef: RefObject<HTMLDivElement | null>, enabled?: boolean) => void;
@@ -30,8 +30,9 @@ export * from './components/Form';
30
30
  export * from './components/MultiValueInput';
31
31
  export * from './components/Resizer';
32
32
  export * from './components/SaveStatus';
33
- export * from './components/StyledModal';
33
+ export * from './components/Shortcut';
34
34
  export * from './components/Sidebar';
35
+ export * from './components/StyledModal';
35
36
  export * from './components/TextField';
36
37
  export * from './components/FormFieldContainer';
37
38
  export * from './components/FormCommon';
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.5.31",
4
+ "version": "3.5.32",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",