@manuscripts/style-guide 3.8.1 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/mui/components/Typography/Typography.js +48 -0
- package/dist/cjs/mui/components/Typography/index.js +32 -0
- package/dist/cjs/mui/index.js +1 -0
- package/dist/cjs/mui/theme/theme.js +33 -0
- package/dist/es/mui/components/Typography/Typography.js +41 -0
- package/dist/es/mui/components/Typography/index.js +16 -0
- package/dist/es/mui/index.js +1 -0
- package/dist/es/mui/theme/theme.js +33 -0
- package/dist/types/mui/components/Typography/Typography.d.ts +29 -0
- package/dist/types/mui/components/Typography/index.d.ts +16 -0
- package/dist/types/mui/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
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 variantMap = {
|
|
10
|
+
h1: 'h1',
|
|
11
|
+
h2: 'h2',
|
|
12
|
+
h3: 'h3',
|
|
13
|
+
body: 'body1',
|
|
14
|
+
caption: 'caption',
|
|
15
|
+
};
|
|
16
|
+
const colorMap = {
|
|
17
|
+
primary: 'text.primary',
|
|
18
|
+
secondary: 'text.secondary',
|
|
19
|
+
muted: 'text.disabled',
|
|
20
|
+
};
|
|
21
|
+
const fontWeightMap = {
|
|
22
|
+
regular: 400,
|
|
23
|
+
medium: 500,
|
|
24
|
+
bold: 700,
|
|
25
|
+
};
|
|
26
|
+
const Typography = ({ variant = 'body', color = 'primary', fontWeight, italic, uppercase, clamp, sx, ...rest }) => {
|
|
27
|
+
const resolvedWeight = fontWeight === undefined
|
|
28
|
+
? undefined
|
|
29
|
+
: typeof fontWeight === 'number'
|
|
30
|
+
? fontWeight
|
|
31
|
+
: fontWeightMap[fontWeight];
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Typography_1.default, { variant: variantMap[variant], sx: [
|
|
33
|
+
{
|
|
34
|
+
color: colorMap[color],
|
|
35
|
+
...(resolvedWeight !== undefined && { fontWeight: resolvedWeight }),
|
|
36
|
+
...(italic && { fontStyle: 'italic' }),
|
|
37
|
+
...(uppercase && { textTransform: 'uppercase' }),
|
|
38
|
+
...(clamp && {
|
|
39
|
+
display: '-webkit-box',
|
|
40
|
+
overflow: 'hidden',
|
|
41
|
+
WebkitLineClamp: clamp,
|
|
42
|
+
WebkitBoxOrient: 'vertical',
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
...(Array.isArray(sx) ? sx : sx ? [sx] : []),
|
|
46
|
+
], ...rest }));
|
|
47
|
+
};
|
|
48
|
+
exports.Typography = Typography;
|
|
@@ -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);
|
package/dist/cjs/mui/index.js
CHANGED
|
@@ -34,3 +34,4 @@ __exportStar(require("./components/Button"), exports);
|
|
|
34
34
|
__exportStar(require("./components/IconButton"), exports);
|
|
35
35
|
__exportStar(require("./components/InspectorToggleButton"), exports);
|
|
36
36
|
__exportStar(require("./components/ToggleButton"), exports);
|
|
37
|
+
__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,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import MuiTypography from '@mui/material/Typography';
|
|
3
|
+
const variantMap = {
|
|
4
|
+
h1: 'h1',
|
|
5
|
+
h2: 'h2',
|
|
6
|
+
h3: 'h3',
|
|
7
|
+
body: 'body1',
|
|
8
|
+
caption: 'caption',
|
|
9
|
+
};
|
|
10
|
+
const colorMap = {
|
|
11
|
+
primary: 'text.primary',
|
|
12
|
+
secondary: 'text.secondary',
|
|
13
|
+
muted: 'text.disabled',
|
|
14
|
+
};
|
|
15
|
+
const fontWeightMap = {
|
|
16
|
+
regular: 400,
|
|
17
|
+
medium: 500,
|
|
18
|
+
bold: 700,
|
|
19
|
+
};
|
|
20
|
+
export const Typography = ({ variant = 'body', color = 'primary', fontWeight, italic, uppercase, clamp, sx, ...rest }) => {
|
|
21
|
+
const resolvedWeight = fontWeight === undefined
|
|
22
|
+
? undefined
|
|
23
|
+
: typeof fontWeight === 'number'
|
|
24
|
+
? fontWeight
|
|
25
|
+
: fontWeightMap[fontWeight];
|
|
26
|
+
return (_jsx(MuiTypography, { variant: variantMap[variant], sx: [
|
|
27
|
+
{
|
|
28
|
+
color: colorMap[color],
|
|
29
|
+
...(resolvedWeight !== undefined && { fontWeight: resolvedWeight }),
|
|
30
|
+
...(italic && { fontStyle: 'italic' }),
|
|
31
|
+
...(uppercase && { textTransform: 'uppercase' }),
|
|
32
|
+
...(clamp && {
|
|
33
|
+
display: '-webkit-box',
|
|
34
|
+
overflow: 'hidden',
|
|
35
|
+
WebkitLineClamp: clamp,
|
|
36
|
+
WebkitBoxOrient: 'vertical',
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
...(Array.isArray(sx) ? sx : sx ? [sx] : []),
|
|
40
|
+
], ...rest }));
|
|
41
|
+
};
|
|
@@ -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';
|
package/dist/es/mui/index.js
CHANGED
|
@@ -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,
|
|
@@ -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, sx, ...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';
|
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.
|
|
4
|
+
"version": "3.8.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|