@manuscripts/style-guide 3.8.1 → 3.8.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.
@@ -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 ProfileAvatarIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "44", height: "44", viewBox: "0 0 32 32", fill: "none", ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M16 0C24.837 0 32 7.163 32 16C32 24.837 24.837 32 16 32C7.163 32 0 24.837 0 16C0 7.163 7.163 0 16 0ZM16 17.585C14.7258 17.585 13.4651 17.8457 12.2954 18.351C11.1257 18.8563 10.0718 19.5956 9.19841 20.5234C8.32504 21.4512 7.65073 22.5478 7.21694 23.7459C6.78315 24.944 6.59907 26.2181 6.676 27.49C9.31009 29.6338 12.6038 30.802 16 30.797C19.396 30.802 22.6896 29.6342 25.324 27.491C25.4009 26.2191 25.2168 24.945 24.7831 23.7469C24.3493 22.5488 23.675 21.4522 22.8016 20.5244C21.9282 19.5966 20.8743 18.8573 19.7046 18.352C18.5349 17.8467 17.2742 17.586 16 17.586V17.585ZM16 1.203C7.828 1.203 1.203 7.828 1.203 16C1.203 20.03 2.815 23.685 5.429 26.354C5.672 21.779 8.82 17.976 13.062 16.753C12.0228 16.1131 11.2209 15.1516 10.778 14.0145C10.3351 12.8773 10.2754 11.6267 10.608 10.4526C10.9406 9.27843 11.6473 8.24491 12.6208 7.509C13.5943 6.7731 14.7814 6.37501 16.0018 6.37522C17.2221 6.37543 18.4091 6.77391 19.3823 7.51015C20.3556 8.24639 21.0619 9.28015 21.3941 10.4544C21.7263 11.6287 21.6662 12.8793 21.2229 14.0163C20.7796 15.1533 19.9774 16.1145 18.938 16.754C23.18 17.976 26.328 21.779 26.571 26.354C29.2842 23.5912 30.802 19.8723 30.797 16C30.797 7.828 24.172 1.203 16 1.203ZM16 7.621C15.4219 7.61225 14.8479 7.71854 14.3113 7.93369C13.7747 8.14885 13.2863 8.46857 12.8744 8.87426C12.4625 9.27994 12.1355 9.76349 11.9122 10.2968C11.6889 10.83 11.574 11.4024 11.574 11.9805C11.574 12.5586 11.6889 13.131 11.9122 13.6642C12.1355 14.1975 12.4625 14.6811 12.8744 15.0867C13.2863 15.4924 13.7747 15.8122 14.3113 16.0273C14.8479 16.2425 15.4219 16.3488 16 16.34C17.1448 16.3227 18.2368 15.8557 19.0402 15.0401C19.8436 14.2244 20.294 13.1254 20.294 11.9805C20.294 10.8356 19.8436 9.73663 19.0402 8.92095C18.2368 8.10527 17.1448 7.63834 16 7.621Z", fill: "#6E6E6E" }) }));
4
+ const ProfileAvatarIcon = (props) => ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "44", height: "44", viewBox: "0 0 32 32", fill: "none", ...props, display: "block", children: (0, jsx_runtime_1.jsx)("path", { d: "M16 0C24.837 0 32 7.163 32 16C32 24.837 24.837 32 16 32C7.163 32 0 24.837 0 16C0 7.163 7.163 0 16 0ZM16 17.585C14.7258 17.585 13.4651 17.8457 12.2954 18.351C11.1257 18.8563 10.0718 19.5956 9.19841 20.5234C8.32504 21.4512 7.65073 22.5478 7.21694 23.7459C6.78315 24.944 6.59907 26.2181 6.676 27.49C9.31009 29.6338 12.6038 30.802 16 30.797C19.396 30.802 22.6896 29.6342 25.324 27.491C25.4009 26.2191 25.2168 24.945 24.7831 23.7469C24.3493 22.5488 23.675 21.4522 22.8016 20.5244C21.9282 19.5966 20.8743 18.8573 19.7046 18.352C18.5349 17.8467 17.2742 17.586 16 17.586V17.585ZM16 1.203C7.828 1.203 1.203 7.828 1.203 16C1.203 20.03 2.815 23.685 5.429 26.354C5.672 21.779 8.82 17.976 13.062 16.753C12.0228 16.1131 11.2209 15.1516 10.778 14.0145C10.3351 12.8773 10.2754 11.6267 10.608 10.4526C10.9406 9.27843 11.6473 8.24491 12.6208 7.509C13.5943 6.7731 14.7814 6.37501 16.0018 6.37522C17.2221 6.37543 18.4091 6.77391 19.3823 7.51015C20.3556 8.24639 21.0619 9.28015 21.3941 10.4544C21.7263 11.6287 21.6662 12.8793 21.2229 14.0163C20.7796 15.1533 19.9774 16.1145 18.938 16.754C23.18 17.976 26.328 21.779 26.571 26.354C29.2842 23.5912 30.802 19.8723 30.797 16C30.797 7.828 24.172 1.203 16 1.203ZM16 7.621C15.4219 7.61225 14.8479 7.71854 14.3113 7.93369C13.7747 8.14885 13.2863 8.46857 12.8744 8.87426C12.4625 9.27994 12.1355 9.76349 11.9122 10.2968C11.6889 10.83 11.574 11.4024 11.574 11.9805C11.574 12.5586 11.6889 13.131 11.9122 13.6642C12.1355 14.1975 12.4625 14.6811 12.8744 15.0867C13.2863 15.4924 13.7747 15.8122 14.3113 16.0273C14.8479 16.2425 15.4219 16.3488 16 16.34C17.1448 16.3227 18.2368 15.8557 19.0402 15.0401C19.8436 14.2244 20.294 13.1254 20.294 11.9805C20.294 10.8356 19.8436 9.73663 19.0402 8.92095C18.2368 8.10527 17.1448 7.63834 16 7.621Z", fill: "currentColor" }) }));
5
5
  exports.default = ProfileAvatarIcon;
package/dist/cjs/index.js CHANGED
@@ -62,7 +62,6 @@ __exportStar(require("./components/ContextMenu"), exports);
62
62
  __exportStar(require("./components/RadioButton"), exports);
63
63
  var RadioGroup_1 = require("./components/RadioGroup");
64
64
  Object.defineProperty(exports, "StyledRadioGroup", { enumerable: true, get: function () { return RadioGroup_1.StyledRadioGroup; } });
65
- __exportStar(require("./components/Avatar"), exports);
66
65
  __exportStar(require("./components/Dialog"), exports);
67
66
  __exportStar(require("./components/DraggableModal"), exports);
68
67
  __exportStar(require("./components/Checkbox"), exports);
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Avatar = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const Avatar_1 = __importDefault(require("@mui/material/Avatar"));
9
+ const styles_1 = require("@mui/material/styles");
10
+ const icons_1 = require("../../../components/icons");
11
+ const INITIALS_PALETTE = [
12
+ '#1a9bc7',
13
+ '#31a056',
14
+ '#e65100',
15
+ '#6a1b9a',
16
+ '#c62828',
17
+ '#1565c0',
18
+ '#558b2f',
19
+ '#00695c',
20
+ ];
21
+ const getInitials = (name) => {
22
+ const words = name.trim().split(/\s+/);
23
+ if (words.length === 1) {
24
+ return words[0].slice(0, 2).toUpperCase();
25
+ }
26
+ return (words[0][0] + words[words.length - 1][0]).toUpperCase();
27
+ };
28
+ const Avatar = ({ size, name, color, opacity = 1, src, alt, ...rest }) => {
29
+ const initials = name ? getInitials(name) : undefined;
30
+ const initialsBg = name
31
+ ? INITIALS_PALETTE[name.charCodeAt(0) % INITIALS_PALETTE.length]
32
+ : undefined;
33
+ return ((0, jsx_runtime_1.jsx)(AvatarRoot, { ...rest, src: src, alt: alt ?? name, ownerState: { size, opacity, initialsBg, initials: !!initials, color }, children: initials ?? (0, jsx_runtime_1.jsx)(icons_1.ProfileIcon, { height: size, width: size }) }));
34
+ };
35
+ exports.Avatar = Avatar;
36
+ const AvatarRoot = (0, styles_1.styled)(Avatar_1.default)(({ theme, ownerState }) => ({
37
+ width: ownerState.size,
38
+ height: ownerState.size,
39
+ fontSize: Math.round(ownerState.size * 0.4),
40
+ opacity: ownerState.opacity,
41
+ backgroundColor: ownerState.initialsBg ?? 'transparent',
42
+ color: ownerState.initials
43
+ ? theme.palette.common.white
44
+ : ownerState.color || theme.palette.grey[700],
45
+ ...(!ownerState.initials && {
46
+ '&:hover': {
47
+ color: ownerState.color || theme.palette.info.main,
48
+ },
49
+ }),
50
+ }));
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2026 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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ __exportStar(require("./Avatar"), exports);
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Typography = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const Typography_1 = __importDefault(require("@mui/material/Typography"));
9
+ const styles_1 = require("@mui/material/styles");
10
+ const variantMap = {
11
+ h1: 'h1',
12
+ h2: 'h2',
13
+ h3: 'h3',
14
+ body: 'body1',
15
+ caption: 'caption',
16
+ };
17
+ const Typography = ({ variant = 'body', color = 'primary', fontWeight, italic, uppercase, clamp, ...rest }) => ((0, jsx_runtime_1.jsx)(TypographyRoot, { ...rest, variant: variantMap[variant], ownerState: { color, fontWeight, italic, uppercase, clamp } }));
18
+ exports.Typography = Typography;
19
+ const TypographyRoot = (0, styles_1.styled)(Typography_1.default)(({ theme, ownerState }) => {
20
+ const fontWeight = ownerState.fontWeight === undefined
21
+ ? undefined
22
+ : typeof ownerState.fontWeight === 'number'
23
+ ? ownerState.fontWeight
24
+ : {
25
+ regular: theme.typography.fontWeightRegular,
26
+ medium: theme.typography.fontWeightMedium,
27
+ bold: theme.typography.fontWeightBold,
28
+ }[ownerState.fontWeight];
29
+ return {
30
+ color: {
31
+ primary: theme.palette.text.primary,
32
+ secondary: theme.palette.text.secondary,
33
+ muted: theme.palette.text.disabled,
34
+ }[ownerState.color],
35
+ ...(fontWeight !== undefined && { fontWeight }),
36
+ ...(ownerState.italic && { fontStyle: 'italic' }),
37
+ ...(ownerState.uppercase && { textTransform: 'uppercase' }),
38
+ ...(ownerState.clamp && {
39
+ display: '-webkit-box',
40
+ overflow: 'hidden',
41
+ WebkitLineClamp: ownerState.clamp,
42
+ WebkitBoxOrient: 'vertical',
43
+ }),
44
+ };
45
+ });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /*!
3
+ * © 2026 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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ __exportStar(require("./Typography"), exports);
@@ -30,7 +30,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
32
  __exportStar(require("./theme"), exports);
33
+ __exportStar(require("./components/Avatar"), exports);
33
34
  __exportStar(require("./components/Button"), exports);
34
35
  __exportStar(require("./components/IconButton"), exports);
35
36
  __exportStar(require("./components/InspectorToggleButton"), exports);
36
37
  __exportStar(require("./components/ToggleButton"), exports);
38
+ __exportStar(require("./components/Typography"), exports);
@@ -28,10 +28,43 @@ exports.muiTheme = (0, styles_1.createTheme)({
28
28
  info: palette_1.palette.info,
29
29
  grey: palette_1.palette.grey,
30
30
  common: palette_1.palette.common,
31
+ text: {
32
+ primary: palette_1.palette.grey[900],
33
+ secondary: palette_1.palette.grey[700],
34
+ disabled: palette_1.palette.grey[400],
35
+ },
31
36
  },
32
37
  typography: {
33
38
  fontFamily: '"Lato", sans-serif',
34
39
  fontSize: 14,
40
+ fontWeightRegular: 400,
41
+ fontWeightMedium: 500,
42
+ fontWeightBold: 700,
43
+ h1: {
44
+ fontSize: '20px',
45
+ fontWeight: 700,
46
+ lineHeight: 1.25,
47
+ },
48
+ h2: {
49
+ fontSize: '18px',
50
+ fontWeight: 700,
51
+ lineHeight: '24px',
52
+ },
53
+ h3: {
54
+ fontSize: '16px',
55
+ fontWeight: 700,
56
+ lineHeight: '24px',
57
+ },
58
+ body1: {
59
+ fontSize: '14px',
60
+ fontWeight: 400,
61
+ lineHeight: '16px',
62
+ },
63
+ caption: {
64
+ fontSize: '12px',
65
+ fontWeight: 400,
66
+ lineHeight: '14px',
67
+ },
35
68
  button: {
36
69
  textTransform: 'none',
37
70
  fontWeight: 400,
@@ -64,6 +97,13 @@ exports.muiTheme = (0, styles_1.createTheme)({
64
97
  },
65
98
  },
66
99
  },
100
+ MuiAvatar: {
101
+ styleOverrides: {
102
+ root: {
103
+ fontWeight: 700,
104
+ },
105
+ },
106
+ },
67
107
  MuiIconButton: {
68
108
  styleOverrides: {
69
109
  root: {
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- const ProfileAvatarIcon = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "44", height: "44", viewBox: "0 0 32 32", fill: "none", ...props, children: _jsx("path", { d: "M16 0C24.837 0 32 7.163 32 16C32 24.837 24.837 32 16 32C7.163 32 0 24.837 0 16C0 7.163 7.163 0 16 0ZM16 17.585C14.7258 17.585 13.4651 17.8457 12.2954 18.351C11.1257 18.8563 10.0718 19.5956 9.19841 20.5234C8.32504 21.4512 7.65073 22.5478 7.21694 23.7459C6.78315 24.944 6.59907 26.2181 6.676 27.49C9.31009 29.6338 12.6038 30.802 16 30.797C19.396 30.802 22.6896 29.6342 25.324 27.491C25.4009 26.2191 25.2168 24.945 24.7831 23.7469C24.3493 22.5488 23.675 21.4522 22.8016 20.5244C21.9282 19.5966 20.8743 18.8573 19.7046 18.352C18.5349 17.8467 17.2742 17.586 16 17.586V17.585ZM16 1.203C7.828 1.203 1.203 7.828 1.203 16C1.203 20.03 2.815 23.685 5.429 26.354C5.672 21.779 8.82 17.976 13.062 16.753C12.0228 16.1131 11.2209 15.1516 10.778 14.0145C10.3351 12.8773 10.2754 11.6267 10.608 10.4526C10.9406 9.27843 11.6473 8.24491 12.6208 7.509C13.5943 6.7731 14.7814 6.37501 16.0018 6.37522C17.2221 6.37543 18.4091 6.77391 19.3823 7.51015C20.3556 8.24639 21.0619 9.28015 21.3941 10.4544C21.7263 11.6287 21.6662 12.8793 21.2229 14.0163C20.7796 15.1533 19.9774 16.1145 18.938 16.754C23.18 17.976 26.328 21.779 26.571 26.354C29.2842 23.5912 30.802 19.8723 30.797 16C30.797 7.828 24.172 1.203 16 1.203ZM16 7.621C15.4219 7.61225 14.8479 7.71854 14.3113 7.93369C13.7747 8.14885 13.2863 8.46857 12.8744 8.87426C12.4625 9.27994 12.1355 9.76349 11.9122 10.2968C11.6889 10.83 11.574 11.4024 11.574 11.9805C11.574 12.5586 11.6889 13.131 11.9122 13.6642C12.1355 14.1975 12.4625 14.6811 12.8744 15.0867C13.2863 15.4924 13.7747 15.8122 14.3113 16.0273C14.8479 16.2425 15.4219 16.3488 16 16.34C17.1448 16.3227 18.2368 15.8557 19.0402 15.0401C19.8436 14.2244 20.294 13.1254 20.294 11.9805C20.294 10.8356 19.8436 9.73663 19.0402 8.92095C18.2368 8.10527 17.1448 7.63834 16 7.621Z", fill: "#6E6E6E" }) }));
2
+ const ProfileAvatarIcon = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "44", height: "44", viewBox: "0 0 32 32", fill: "none", ...props, display: "block", children: _jsx("path", { d: "M16 0C24.837 0 32 7.163 32 16C32 24.837 24.837 32 16 32C7.163 32 0 24.837 0 16C0 7.163 7.163 0 16 0ZM16 17.585C14.7258 17.585 13.4651 17.8457 12.2954 18.351C11.1257 18.8563 10.0718 19.5956 9.19841 20.5234C8.32504 21.4512 7.65073 22.5478 7.21694 23.7459C6.78315 24.944 6.59907 26.2181 6.676 27.49C9.31009 29.6338 12.6038 30.802 16 30.797C19.396 30.802 22.6896 29.6342 25.324 27.491C25.4009 26.2191 25.2168 24.945 24.7831 23.7469C24.3493 22.5488 23.675 21.4522 22.8016 20.5244C21.9282 19.5966 20.8743 18.8573 19.7046 18.352C18.5349 17.8467 17.2742 17.586 16 17.586V17.585ZM16 1.203C7.828 1.203 1.203 7.828 1.203 16C1.203 20.03 2.815 23.685 5.429 26.354C5.672 21.779 8.82 17.976 13.062 16.753C12.0228 16.1131 11.2209 15.1516 10.778 14.0145C10.3351 12.8773 10.2754 11.6267 10.608 10.4526C10.9406 9.27843 11.6473 8.24491 12.6208 7.509C13.5943 6.7731 14.7814 6.37501 16.0018 6.37522C17.2221 6.37543 18.4091 6.77391 19.3823 7.51015C20.3556 8.24639 21.0619 9.28015 21.3941 10.4544C21.7263 11.6287 21.6662 12.8793 21.2229 14.0163C20.7796 15.1533 19.9774 16.1145 18.938 16.754C23.18 17.976 26.328 21.779 26.571 26.354C29.2842 23.5912 30.802 19.8723 30.797 16C30.797 7.828 24.172 1.203 16 1.203ZM16 7.621C15.4219 7.61225 14.8479 7.71854 14.3113 7.93369C13.7747 8.14885 13.2863 8.46857 12.8744 8.87426C12.4625 9.27994 12.1355 9.76349 11.9122 10.2968C11.6889 10.83 11.574 11.4024 11.574 11.9805C11.574 12.5586 11.6889 13.131 11.9122 13.6642C12.1355 14.1975 12.4625 14.6811 12.8744 15.0867C13.2863 15.4924 13.7747 15.8122 14.3113 16.0273C14.8479 16.2425 15.4219 16.3488 16 16.34C17.1448 16.3227 18.2368 15.8557 19.0402 15.0401C19.8436 14.2244 20.294 13.1254 20.294 11.9805C20.294 10.8356 19.8436 9.73663 19.0402 8.92095C18.2368 8.10527 17.1448 7.63834 16 7.621Z", fill: "currentColor" }) }));
3
3
  export default ProfileAvatarIcon;
package/dist/es/index.js CHANGED
@@ -21,7 +21,6 @@ export * from './components/Button';
21
21
  export * from './components/ContextMenu';
22
22
  export * from './components/RadioButton';
23
23
  export { StyledRadioGroup, } from './components/RadioGroup';
24
- export * from './components/Avatar';
25
24
  export * from './components/Dialog';
26
25
  export * from './components/DraggableModal';
27
26
  export * from './components/Checkbox';
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import MuiAvatar from '@mui/material/Avatar';
3
+ import { styled } from '@mui/material/styles';
4
+ import { ProfileIcon } from '../../../components/icons';
5
+ const INITIALS_PALETTE = [
6
+ '#1a9bc7',
7
+ '#31a056',
8
+ '#e65100',
9
+ '#6a1b9a',
10
+ '#c62828',
11
+ '#1565c0',
12
+ '#558b2f',
13
+ '#00695c',
14
+ ];
15
+ const getInitials = (name) => {
16
+ const words = name.trim().split(/\s+/);
17
+ if (words.length === 1) {
18
+ return words[0].slice(0, 2).toUpperCase();
19
+ }
20
+ return (words[0][0] + words[words.length - 1][0]).toUpperCase();
21
+ };
22
+ export const Avatar = ({ size, name, color, opacity = 1, src, alt, ...rest }) => {
23
+ const initials = name ? getInitials(name) : undefined;
24
+ const initialsBg = name
25
+ ? INITIALS_PALETTE[name.charCodeAt(0) % INITIALS_PALETTE.length]
26
+ : undefined;
27
+ return (_jsx(AvatarRoot, { ...rest, src: src, alt: alt ?? name, ownerState: { size, opacity, initialsBg, initials: !!initials, color }, children: initials ?? _jsx(ProfileIcon, { height: size, width: size }) }));
28
+ };
29
+ const AvatarRoot = styled(MuiAvatar)(({ theme, ownerState }) => ({
30
+ width: ownerState.size,
31
+ height: ownerState.size,
32
+ fontSize: Math.round(ownerState.size * 0.4),
33
+ opacity: ownerState.opacity,
34
+ backgroundColor: ownerState.initialsBg ?? 'transparent',
35
+ color: ownerState.initials
36
+ ? theme.palette.common.white
37
+ : ownerState.color || theme.palette.grey[700],
38
+ ...(!ownerState.initials && {
39
+ '&:hover': {
40
+ color: ownerState.color || theme.palette.info.main,
41
+ },
42
+ }),
43
+ }));
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * © 2019 Atypon Systems LLC
2
+ * © 2026 Atypon Systems LLC
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,11 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import React from 'react';
17
- interface SystemUserAvatarProps {
18
- src?: string;
19
- size: number;
20
- color?: string;
21
- }
22
- export declare const Avatar: React.FC<SystemUserAvatarProps>;
23
- export {};
16
+ export * from './Avatar';
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import MuiTypography from '@mui/material/Typography';
3
+ import { styled } from '@mui/material/styles';
4
+ const variantMap = {
5
+ h1: 'h1',
6
+ h2: 'h2',
7
+ h3: 'h3',
8
+ body: 'body1',
9
+ caption: 'caption',
10
+ };
11
+ export const Typography = ({ variant = 'body', color = 'primary', fontWeight, italic, uppercase, clamp, ...rest }) => (_jsx(TypographyRoot, { ...rest, variant: variantMap[variant], ownerState: { color, fontWeight, italic, uppercase, clamp } }));
12
+ const TypographyRoot = styled(MuiTypography)(({ theme, ownerState }) => {
13
+ const fontWeight = ownerState.fontWeight === undefined
14
+ ? undefined
15
+ : typeof ownerState.fontWeight === 'number'
16
+ ? ownerState.fontWeight
17
+ : {
18
+ regular: theme.typography.fontWeightRegular,
19
+ medium: theme.typography.fontWeightMedium,
20
+ bold: theme.typography.fontWeightBold,
21
+ }[ownerState.fontWeight];
22
+ return {
23
+ color: {
24
+ primary: theme.palette.text.primary,
25
+ secondary: theme.palette.text.secondary,
26
+ muted: theme.palette.text.disabled,
27
+ }[ownerState.color],
28
+ ...(fontWeight !== undefined && { fontWeight }),
29
+ ...(ownerState.italic && { fontStyle: 'italic' }),
30
+ ...(ownerState.uppercase && { textTransform: 'uppercase' }),
31
+ ...(ownerState.clamp && {
32
+ display: '-webkit-box',
33
+ overflow: 'hidden',
34
+ WebkitLineClamp: ownerState.clamp,
35
+ WebkitBoxOrient: 'vertical',
36
+ }),
37
+ };
38
+ });
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * © 2019 Atypon Systems LLC
2
+ * © 2026 Atypon Systems LLC
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -13,13 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import React from 'react';
17
- interface AvatarProps {
18
- src?: string;
19
- size: number;
20
- color?: string;
21
- opacity?: number;
22
- name?: string;
23
- }
24
- export declare const Avatar: React.FC<AvatarProps>;
25
- export {};
16
+ export * from './Typography';
@@ -14,7 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export * from './theme';
17
+ export * from './components/Avatar';
17
18
  export * from './components/Button';
18
19
  export * from './components/IconButton';
19
20
  export * from './components/InspectorToggleButton';
20
21
  export * from './components/ToggleButton';
22
+ export * from './components/Typography';
@@ -25,10 +25,43 @@ export const muiTheme = createTheme({
25
25
  info: palette.info,
26
26
  grey: palette.grey,
27
27
  common: palette.common,
28
+ text: {
29
+ primary: palette.grey[900],
30
+ secondary: palette.grey[700],
31
+ disabled: palette.grey[400],
32
+ },
28
33
  },
29
34
  typography: {
30
35
  fontFamily: '"Lato", sans-serif',
31
36
  fontSize: 14,
37
+ fontWeightRegular: 400,
38
+ fontWeightMedium: 500,
39
+ fontWeightBold: 700,
40
+ h1: {
41
+ fontSize: '20px',
42
+ fontWeight: 700,
43
+ lineHeight: 1.25,
44
+ },
45
+ h2: {
46
+ fontSize: '18px',
47
+ fontWeight: 700,
48
+ lineHeight: '24px',
49
+ },
50
+ h3: {
51
+ fontSize: '16px',
52
+ fontWeight: 700,
53
+ lineHeight: '24px',
54
+ },
55
+ body1: {
56
+ fontSize: '14px',
57
+ fontWeight: 400,
58
+ lineHeight: '16px',
59
+ },
60
+ caption: {
61
+ fontSize: '12px',
62
+ fontWeight: 400,
63
+ lineHeight: '14px',
64
+ },
32
65
  button: {
33
66
  textTransform: 'none',
34
67
  fontWeight: 400,
@@ -61,6 +94,13 @@ export const muiTheme = createTheme({
61
94
  },
62
95
  },
63
96
  },
97
+ MuiAvatar: {
98
+ styleOverrides: {
99
+ root: {
100
+ fontWeight: 700,
101
+ },
102
+ },
103
+ },
64
104
  MuiIconButton: {
65
105
  styleOverrides: {
66
106
  root: {
@@ -22,7 +22,6 @@ export * from './components/Button';
22
22
  export * from './components/ContextMenu';
23
23
  export * from './components/RadioButton';
24
24
  export { StyledRadioGroup, type StyledRadioGroupOption, type StyledRadioGroupProps, } from './components/RadioGroup';
25
- export * from './components/Avatar';
26
25
  export * from './components/Dialog';
27
26
  export * from './components/DraggableModal';
28
27
  export * from './components/Checkbox';
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * © 2026 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 { AvatarProps as MuiAvatarProps } from '@mui/material/Avatar';
17
+ import React from 'react';
18
+ export interface AvatarProps extends Omit<MuiAvatarProps, 'children' | 'color'> {
19
+ size: number;
20
+ name?: string;
21
+ color?: string;
22
+ opacity?: number;
23
+ }
24
+ export declare const Avatar: ({ size, name, color, opacity, src, alt, ...rest }: AvatarProps) => React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * © 2026 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 * from './Avatar';
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * © 2026 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 { TypographyProps as MuiTypographyProps } from '@mui/material/Typography';
17
+ import React from 'react';
18
+ export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'body' | 'caption';
19
+ export type TypographyColor = 'primary' | 'secondary' | 'muted';
20
+ export type TypographyFontWeight = 'regular' | 'medium' | 'bold' | number;
21
+ export interface TypographyProps extends Omit<MuiTypographyProps, 'variant' | 'color'> {
22
+ variant?: TypographyVariant;
23
+ color?: TypographyColor;
24
+ fontWeight?: TypographyFontWeight;
25
+ italic?: boolean;
26
+ uppercase?: boolean;
27
+ clamp?: 2 | 3;
28
+ }
29
+ export declare const Typography: ({ variant, color, fontWeight, italic, uppercase, clamp, ...rest }: TypographyProps) => React.JSX.Element;
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * © 2026 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 * from './Typography';
@@ -14,7 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export * from './theme';
17
+ export * from './components/Avatar';
17
18
  export * from './components/Button';
18
19
  export * from './components/IconButton';
19
20
  export * from './components/InspectorToggleButton';
20
21
  export * from './components/ToggleButton';
22
+ export * from './components/Typography';
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.8.1",
4
+ "version": "3.8.3",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -1,73 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Avatar = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const styled_components_1 = __importDefault(require("styled-components"));
10
- const icons_1 = require("./icons");
11
- const INITIALS_PALETTE = [
12
- '#1a9bc7',
13
- '#31a056',
14
- '#e65100',
15
- '#6a1b9a',
16
- '#c62828',
17
- '#1565c0',
18
- '#558b2f',
19
- '#00695c',
20
- ];
21
- const getInitials = (name) => {
22
- const words = name.trim().split(/\s+/);
23
- if (words.length === 1) {
24
- return words[0].slice(0, 2).toUpperCase();
25
- }
26
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
27
- };
28
- const AvatarContainer = styled_components_1.default.div `
29
- display: flex;
30
- align-items: center;
31
- justify-content: center;
32
- position: relative;
33
- opacity: ${(props) => props.$opacity};
34
- `;
35
- const RoundedImage = styled_components_1.default.img `
36
- width: ${(props) => props.$size}px;
37
- height: ${(props) => props.$size}px;
38
- border-radius: 50%;
39
- align-items: center;
40
- justify-content: center;
41
- `;
42
- const StyledAvatar = (0, styled_components_1.default)(icons_1.ProfileIcon) `
43
- path {
44
- fill: ${(props) => props.$color || props.theme.colors.text.secondary};
45
- }
46
-
47
- &:hover path {
48
- fill: ${(props) => props.$color || props.theme.colors.text.info};
49
- }
50
- `;
51
- const InitialsCircle = styled_components_1.default.div `
52
- width: ${(props) => props.$size}px;
53
- height: ${(props) => props.$size}px;
54
- border-radius: 50%;
55
- background: ${(props) => props.$bg};
56
- color: #ffffff;
57
- font-weight: bold;
58
- font-size: ${(props) => Math.round(props.$size * 0.4)}px;
59
- display: flex;
60
- align-items: center;
61
- justify-content: center;
62
- user-select: none;
63
- flex-shrink: 0;
64
- `;
65
- const Avatar = (props) => {
66
- const [srcError, setSrcError] = (0, react_1.useState)(false);
67
- const handleSrcError = (0, react_1.useCallback)(() => {
68
- setSrcError(true);
69
- }, []);
70
- const showInitials = (!props.src || srcError) && !!props.name;
71
- return ((0, jsx_runtime_1.jsx)(AvatarContainer, { "$opacity": props.opacity || 1, children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : showInitials ? ((0, jsx_runtime_1.jsx)(InitialsCircle, { "$size": props.size, "$bg": INITIALS_PALETTE[props.name.charCodeAt(0) % INITIALS_PALETTE.length], children: getInitials(props.name) })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
72
- };
73
- exports.Avatar = Avatar;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Avatar = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const styled_components_1 = __importDefault(require("styled-components"));
10
- const icons_1 = require("./icons");
11
- const SystemUserAvatarContainer = styled_components_1.default.div `
12
- display: flex;
13
- align-items: center;
14
- justify-content: center;
15
- position: relative;
16
- `;
17
- const RoundedImage = styled_components_1.default.img `
18
- width: ${(props) => props.$size}px;
19
- height: ${(props) => props.$size}px;
20
- border-radius: 50%;
21
- align-items: center;
22
- justify-content: center;
23
- `;
24
- const StyledAvatar = (0, styled_components_1.default)(icons_1.SystemUserAvatarIcon) `
25
- path {
26
- fill: ${(props) => props.$color || props.theme.colors.text.secondary};
27
- }
28
-
29
- &:hover path {
30
- fill: ${(props) => props.$color || props.theme.colors.text.info};
31
- }
32
- `;
33
- const Avatar = (props) => {
34
- const [srcError, setSrcError] = (0, react_1.useState)(false);
35
- const handleSrcError = (0, react_1.useCallback)(() => {
36
- setSrcError(true);
37
- }, []);
38
- return ((0, jsx_runtime_1.jsx)(SystemUserAvatarContainer, { children: props.src && !srcError ? ((0, jsx_runtime_1.jsx)(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : ((0, jsx_runtime_1.jsx)(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
39
- };
40
- exports.Avatar = Avatar;
@@ -1,66 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useState } from 'react';
3
- import styled from 'styled-components';
4
- import { ProfileIcon } from './icons';
5
- const INITIALS_PALETTE = [
6
- '#1a9bc7',
7
- '#31a056',
8
- '#e65100',
9
- '#6a1b9a',
10
- '#c62828',
11
- '#1565c0',
12
- '#558b2f',
13
- '#00695c',
14
- ];
15
- const getInitials = (name) => {
16
- const words = name.trim().split(/\s+/);
17
- if (words.length === 1) {
18
- return words[0].slice(0, 2).toUpperCase();
19
- }
20
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
21
- };
22
- const AvatarContainer = styled.div `
23
- display: flex;
24
- align-items: center;
25
- justify-content: center;
26
- position: relative;
27
- opacity: ${(props) => props.$opacity};
28
- `;
29
- const RoundedImage = styled.img `
30
- width: ${(props) => props.$size}px;
31
- height: ${(props) => props.$size}px;
32
- border-radius: 50%;
33
- align-items: center;
34
- justify-content: center;
35
- `;
36
- const StyledAvatar = styled(ProfileIcon) `
37
- path {
38
- fill: ${(props) => props.$color || props.theme.colors.text.secondary};
39
- }
40
-
41
- &:hover path {
42
- fill: ${(props) => props.$color || props.theme.colors.text.info};
43
- }
44
- `;
45
- const InitialsCircle = styled.div `
46
- width: ${(props) => props.$size}px;
47
- height: ${(props) => props.$size}px;
48
- border-radius: 50%;
49
- background: ${(props) => props.$bg};
50
- color: #ffffff;
51
- font-weight: bold;
52
- font-size: ${(props) => Math.round(props.$size * 0.4)}px;
53
- display: flex;
54
- align-items: center;
55
- justify-content: center;
56
- user-select: none;
57
- flex-shrink: 0;
58
- `;
59
- export const Avatar = (props) => {
60
- const [srcError, setSrcError] = useState(false);
61
- const handleSrcError = useCallback(() => {
62
- setSrcError(true);
63
- }, []);
64
- const showInitials = (!props.src || srcError) && !!props.name;
65
- return (_jsx(AvatarContainer, { "$opacity": props.opacity || 1, children: props.src && !srcError ? (_jsx(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : showInitials ? (_jsx(InitialsCircle, { "$size": props.size, "$bg": INITIALS_PALETTE[props.name.charCodeAt(0) % INITIALS_PALETTE.length], children: getInitials(props.name) })) : (_jsx(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
66
- };
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useState } from 'react';
3
- import styled from 'styled-components';
4
- import { SystemUserAvatarIcon } from './icons';
5
- const SystemUserAvatarContainer = styled.div `
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- position: relative;
10
- `;
11
- const RoundedImage = styled.img `
12
- width: ${(props) => props.$size}px;
13
- height: ${(props) => props.$size}px;
14
- border-radius: 50%;
15
- align-items: center;
16
- justify-content: center;
17
- `;
18
- const StyledAvatar = styled(SystemUserAvatarIcon) `
19
- path {
20
- fill: ${(props) => props.$color || props.theme.colors.text.secondary};
21
- }
22
-
23
- &:hover path {
24
- fill: ${(props) => props.$color || props.theme.colors.text.info};
25
- }
26
- `;
27
- export const Avatar = (props) => {
28
- const [srcError, setSrcError] = useState(false);
29
- const handleSrcError = useCallback(() => {
30
- setSrcError(true);
31
- }, []);
32
- return (_jsx(SystemUserAvatarContainer, { children: props.src && !srcError ? (_jsx(RoundedImage, { src: props.src, "$size": props.size, onError: handleSrcError })) : (_jsx(StyledAvatar, { height: props.size, width: props.size, "$color": props.color })) }));
33
- };