@webpros/mui-theme 0.3.1 → 0.3.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.
- package/README.md +63 -12
- package/dist/package.json +6 -4
- package/dist/src/components/feedback/Dialog/Dialog.theme.js +4 -4
- package/dist/src/components/surfaces/AppBar/AppBar.theme.d.ts +1 -1
- package/dist/src/components/surfaces/AppBar/AppBar.theme.js +1 -12
- package/dist/src/index.d.ts +1 -0
- package/dist/src/providers/WebProsMuiThemeProvider.d.ts +18 -2
- package/dist/src/providers/WebProsMuiThemeProvider.js +1 -1
- package/dist/src/providers/WebProsTheme.d.ts +19 -1
- package/dist/src/providers/WebProsTheme.js +20 -7
- package/dist/src/tokens/ThemeColorTokens.d.ts +1 -2
- package/dist/src/tokens/ThemeColorTokens.js +20 -3
- package/dist/src/tokens/colors/Dark.js +10 -0
- package/dist/src/tokens/colors/Light.js +24 -14
- package/dist/src/tokens/colors/stateLayers.d.ts +5 -0
- package/dist/src/tokens/typography/typography.js +4 -4
- package/dist/src/utils/createIcon.js +14 -16
- package/dist/src/utils/getMUIComponents.d.ts +1 -2
- package/dist/src/utils/getMUIPalette.d.ts +2 -18
- package/dist/src/utils/getMUIPalette.js +4 -227
- package/package.json +6 -4
- package/dist/src/style/custom-color-palette.d.ts +0 -3
- package/dist/src/style/custom-color-palette.js +0 -73
- package/dist/src/tokens/legacyColors/LegacyDark.d.ts +0 -2
- package/dist/src/tokens/legacyColors/LegacyDark.js +0 -78
- package/dist/src/tokens/legacyColors/LegacyLight.d.ts +0 -2
- package/dist/src/tokens/legacyColors/LegacyLight.js +0 -76
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.d.ts +0 -72
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.js +0 -2
- package/dist/src/tokens/legacyColors/Tone.d.ts +0 -158
- package/dist/src/tokens/legacyColors/Tone.js +0 -157
- package/dist/src/tokens/legacyColors/index.d.ts +0 -2
- package/dist/src/tokens/legacyColors/index.js +0 -3
package/README.md
CHANGED
|
@@ -79,6 +79,57 @@ const App = () => (
|
|
|
79
79
|
import { Box } from '@mui/material'; // NOT import { Box } from '@webpros/mui-theme';
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
# Development
|
|
83
|
+
|
|
84
|
+
## Using Custom ESLint Rules
|
|
85
|
+
|
|
86
|
+
The package exports custom ESLint rules to enforce Material Design 3 design system best practices. To use them in your project:
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
// eslint.config.js
|
|
90
|
+
import webprosMuiThemeRules from '@webpros/mui-theme/eslint';
|
|
91
|
+
|
|
92
|
+
export default [
|
|
93
|
+
// ... your other config
|
|
94
|
+
{
|
|
95
|
+
plugins: {
|
|
96
|
+
'@webpros/mui-theme': webprosMuiThemeRules,
|
|
97
|
+
},
|
|
98
|
+
rules: {
|
|
99
|
+
'@webpros/mui-theme/no-palette-usage': 'error',
|
|
100
|
+
'@webpros/mui-theme/no-standard-typography-variants': 'error',
|
|
101
|
+
'@webpros/mui-theme/no-hardcoded-typography-in-sx': 'error',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For detailed documentation of available rules, see [configs/eslint/README.md](configs/eslint/README.md).
|
|
108
|
+
|
|
109
|
+
## Adding New Custom ESLint Rules
|
|
110
|
+
|
|
111
|
+
To add a new custom rule:
|
|
112
|
+
|
|
113
|
+
1. Create a new file in `configs/eslint/rules/` with your rule implementation (use CommonJS format)
|
|
114
|
+
2. Export the rule using `module.exports`
|
|
115
|
+
3. Import and add it to `configs/eslint/index.cjs` using `require()`
|
|
116
|
+
4. Add the rule to `eslint.config.js` in the plugins and rules sections
|
|
117
|
+
5. Document the rule in `configs/eslint/README.md`
|
|
118
|
+
|
|
119
|
+
### Testing Custom Rules
|
|
120
|
+
|
|
121
|
+
Test your custom rules by running ESLint on specific files:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Test on a specific file
|
|
125
|
+
npx eslint src/path/to/file.ts
|
|
126
|
+
|
|
127
|
+
# Test on all TypeScript files
|
|
128
|
+
npx eslint 'src/**/*.{ts,tsx}'
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
For more information about the existing custom rules and their usage, see [eslint/README.md](eslint/README.md).
|
|
132
|
+
|
|
82
133
|
# Tools configuration
|
|
83
134
|
|
|
84
135
|
## Webpack
|
|
@@ -86,17 +137,17 @@ import { Box } from '@mui/material'; // NOT import { Box } from '@webpros/mui-th
|
|
|
86
137
|
If you use Webpack, you probably need to add the following rules to your configuration:
|
|
87
138
|
|
|
88
139
|
```js
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
140
|
+
module: {
|
|
141
|
+
rules: [
|
|
142
|
+
{
|
|
143
|
+
test: /\.m?js/,
|
|
144
|
+
type: 'javascript/auto',
|
|
145
|
+
resolve: {
|
|
146
|
+
fullySpecified: false,
|
|
97
147
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
// your other rules
|
|
151
|
+
];
|
|
152
|
+
}
|
|
102
153
|
```
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpros/mui-theme",
|
|
3
3
|
"description": "MUI v7 theme for WebPros products",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"theming",
|
|
15
15
|
"ui"
|
|
16
16
|
],
|
|
17
|
-
"main": "
|
|
17
|
+
"main": "src/index.js",
|
|
18
18
|
"types": "dist/index.d.ts",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
"yarn": "^1.22.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "
|
|
41
|
+
"build": "yarn build:main && yarn build:eslint",
|
|
42
|
+
"build:main": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
43
|
+
"build:eslint": "tsc -p ./eslint/tsconfig.eslint.json",
|
|
42
44
|
"storybook:dev": "storybook dev -p 6006",
|
|
43
45
|
"storybook:build": "storybook build",
|
|
44
46
|
"test": "npm run prettier:test && npm run lint && npm run typecheck",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"prettier:write": "prettier --write \"**/*.{ts,tsx}\"",
|
|
49
51
|
"typecheck": "tsc --noEmit",
|
|
50
52
|
"extract-tokens": "node tools/extractM3Tokens.js",
|
|
51
|
-
"generate:icons": "node
|
|
53
|
+
"generate:icons": "node tools/generate-icons.js"
|
|
52
54
|
},
|
|
53
55
|
"peerDependencies": {
|
|
54
56
|
"@emotion/react": "^11.14.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
2
|
import { modalClasses, dialogContentClasses, dialogClasses, iconButtonClasses, } from '@mui/material';
|
|
3
3
|
export const getDialog = (theme) => {
|
|
4
|
-
const { spacing,
|
|
4
|
+
const { spacing, colors } = theme;
|
|
5
5
|
const closeButtonPosition = {
|
|
6
6
|
position: 'absolute',
|
|
7
7
|
right: spacing(3),
|
|
@@ -15,7 +15,7 @@ export const getDialog = (theme) => {
|
|
|
15
15
|
styleOverrides: {
|
|
16
16
|
root: {
|
|
17
17
|
padding: spacing(3.75, 8.25, 2.375, 4.5),
|
|
18
|
-
color:
|
|
18
|
+
color: colors.schemes.surfaces.onSurface,
|
|
19
19
|
[`& + .${dialogContentClasses.root}`]: {
|
|
20
20
|
paddingTop: '0 !important',
|
|
21
21
|
},
|
|
@@ -55,7 +55,7 @@ export const getDialog = (theme) => {
|
|
|
55
55
|
MuiDialogContent: {
|
|
56
56
|
styleOverrides: {
|
|
57
57
|
root: {
|
|
58
|
-
color:
|
|
58
|
+
color: colors.schemes.surfaces.onSurfaceVariant,
|
|
59
59
|
padding: spacing(0, 4.5, 1, 4.5),
|
|
60
60
|
},
|
|
61
61
|
dividers: {
|
|
@@ -88,7 +88,7 @@ export const getDialog = (theme) => {
|
|
|
88
88
|
MuiDialogContentText: {
|
|
89
89
|
styleOverrides: {
|
|
90
90
|
root: {
|
|
91
|
-
color:
|
|
91
|
+
color: colors.schemes.surfaces.onSurfaceVariant,
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
},
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
export const getAppBar = (
|
|
2
|
-
const { palette } = theme;
|
|
1
|
+
export const getAppBar = (_theme) => {
|
|
3
2
|
return {
|
|
4
3
|
MuiAppBar: {
|
|
5
4
|
defaultProps: {
|
|
6
5
|
elevation: 0,
|
|
7
6
|
color: 'default',
|
|
8
7
|
},
|
|
9
|
-
styleOverrides: {
|
|
10
|
-
colorDefault: {
|
|
11
|
-
background: palette.surface.main,
|
|
12
|
-
color: palette.onSurface.main,
|
|
13
|
-
},
|
|
14
|
-
colorPrimary: {
|
|
15
|
-
background: palette.surface.main,
|
|
16
|
-
color: palette.onSurface.main,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
8
|
},
|
|
20
9
|
};
|
|
21
10
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as WebProsMuiThemeProvider } from './providers/WebProsMuiThemeProvider';
|
|
2
|
+
export type { WebProsMuiThemeProviderProps } from './providers/WebProsMuiThemeProvider';
|
|
2
3
|
export { useThemeModeContext } from './providers/ThemeModeProvider';
|
|
3
4
|
export * from './utils';
|
|
4
5
|
export * from './tokens';
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { Localization } from '@mui/material/locale';
|
|
2
2
|
import { ThemeMode } from '../tokens/ThemeMode';
|
|
3
|
-
|
|
3
|
+
import { ThemeOptions, Theme } from '@mui/material';
|
|
4
|
+
import { M3Components } from '../utils';
|
|
5
|
+
export type WebProsMuiThemeProviderProps = {
|
|
4
6
|
children?: React.ReactNode;
|
|
5
7
|
themeMode?: ThemeMode;
|
|
6
8
|
localization?: Localization;
|
|
9
|
+
/**
|
|
10
|
+
* Modifier function to customize theme foundation (palette, typography, spacing, etc.).
|
|
11
|
+
* This function receives base theme options (without components) and should return modified options.
|
|
12
|
+
* Changes are applied before component styles are generated.
|
|
13
|
+
*/
|
|
14
|
+
themeOptionsModifier?: (options: Omit<ThemeOptions, 'components'>) => Omit<ThemeOptions, 'components'>;
|
|
15
|
+
/**
|
|
16
|
+
* Modifier function to customize MUI component styles and default props.
|
|
17
|
+
* This function receives generated component configurations and theme and should return modified configurations.
|
|
18
|
+
* Changes are applied after the full theme is created.
|
|
19
|
+
*
|
|
20
|
+
* **Important:** WebPros component styles are assembled in `getMUIComponents()`.
|
|
21
|
+
*/
|
|
22
|
+
themeComponentsModifier?: (options: M3Components, theme: Theme) => M3Components;
|
|
7
23
|
};
|
|
8
|
-
declare const WebProsMuiThemeProvider: ({ children, localization, themeMode }:
|
|
24
|
+
declare const WebProsMuiThemeProvider: ({ children, localization, themeMode, themeOptionsModifier, themeComponentsModifier, }: WebProsMuiThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
25
|
export default WebProsMuiThemeProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import ThemeModeProvider from './ThemeModeProvider';
|
|
3
3
|
import WebProsTheme from './WebProsTheme';
|
|
4
|
-
const WebProsMuiThemeProvider = ({ children, localization, themeMode }) => (_jsx(ThemeModeProvider, { children: _jsx(WebProsTheme, { mode: themeMode, localization: localization, children: children }) }));
|
|
4
|
+
const WebProsMuiThemeProvider = ({ children, localization, themeMode, themeOptionsModifier, themeComponentsModifier, }) => (_jsx(ThemeModeProvider, { children: _jsx(WebProsTheme, { mode: themeMode, localization: localization, themeOptionsModifier: themeOptionsModifier, themeComponentsModifier: themeComponentsModifier, children: children }) }));
|
|
5
5
|
export default WebProsMuiThemeProvider;
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
import { ThemeOptions, Theme } from '@mui/material';
|
|
1
2
|
import '../utils/getMUIThemeCustoimzationType';
|
|
3
|
+
import { M3Components } from '../utils/getMUIComponents';
|
|
2
4
|
import { ThemeMode } from '../tokens/ThemeMode';
|
|
3
5
|
import { Localization } from '@mui/material/locale';
|
|
4
6
|
type WebProsThemeProps = {
|
|
5
7
|
children?: React.ReactNode;
|
|
6
8
|
mode?: ThemeMode;
|
|
7
9
|
localization?: Localization;
|
|
10
|
+
/**
|
|
11
|
+
* Modifier function for theme foundation (palette, typography, spacing, etc.).
|
|
12
|
+
* Applied before component styles generation.
|
|
13
|
+
*
|
|
14
|
+
* **Performance Note**: To avoid unnecessary theme recreations, wrap modifier functions
|
|
15
|
+
* with `useCallback` if they depend on dynamic values, or define them outside component.
|
|
16
|
+
*/
|
|
17
|
+
themeOptionsModifier?: (options: Omit<ThemeOptions, 'components'>) => Omit<ThemeOptions, 'components'>;
|
|
18
|
+
/**
|
|
19
|
+
* Modifier function for MUI component configurations.
|
|
20
|
+
* Applied after theme creation with access to all theme tokens.
|
|
21
|
+
*
|
|
22
|
+
* **Performance Note**: To avoid unnecessary theme recreations, wrap modifier functions
|
|
23
|
+
* with `useCallback` if they depend on dynamic values, or define them outside component.
|
|
24
|
+
*/
|
|
25
|
+
themeComponentsModifier?: (options: M3Components, theme: Theme) => M3Components;
|
|
8
26
|
};
|
|
9
|
-
export declare const WebProsTheme: ({ children, mode, localization }: WebProsThemeProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const WebProsTheme: ({ children, mode, localization, themeOptionsModifier, themeComponentsModifier, }: WebProsThemeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
28
|
export default WebProsTheme;
|
|
@@ -11,21 +11,34 @@ import { enUS } from '@mui/material/locale';
|
|
|
11
11
|
import { patchMUIShadows } from '../utils/patchMUIShadows';
|
|
12
12
|
import { ThemeSchemeDefault } from '../tokens/ThemeScheme';
|
|
13
13
|
import { getMUITypography } from '../utils/getMUITypography';
|
|
14
|
-
export const WebProsTheme = ({ children, mode, localization = enUS }) => {
|
|
14
|
+
export const WebProsTheme = ({ children, mode, localization = enUS, themeOptionsModifier, themeComponentsModifier, }) => {
|
|
15
15
|
const themeModeContext = useContext(ThemeModeContext);
|
|
16
16
|
const themeMode = mode !== null && mode !== void 0 ? mode : themeModeContext.themeMode;
|
|
17
|
-
const typography = getMUITypography();
|
|
18
17
|
const webprosTheme = useMemo(() => {
|
|
18
|
+
const typography = getMUITypography();
|
|
19
19
|
const muiPalette = getMUIPalette(themeMode, ThemeSchemeDefault);
|
|
20
|
-
|
|
20
|
+
// Prepare base theme options (without components)
|
|
21
|
+
const baseThemeOptions = {
|
|
21
22
|
palette: muiPalette.palette,
|
|
22
23
|
colors: muiPalette.colors,
|
|
23
|
-
typography: Object.assign(Object.assign({},
|
|
24
|
-
}
|
|
24
|
+
typography: Object.assign(Object.assign({}, typography), { fontFamily: "'Roboto', 'Helvetica', 'Arial', sans-serif", fontSize: 14, fontWeightLight: 300, fontWeightRegular: 400, fontWeightMedium: 500, fontWeightBold: 700, h1: Object.assign({}, typography.DisplayLarge), h2: Object.assign({}, typography.DisplayMedium), h3: Object.assign({}, typography.DisplaySmall), h4: Object.assign({}, typography.HeadlineLarge), h5: Object.assign({}, typography.HeadlineMedium), h6: Object.assign({}, typography.HeadlineSmall), subtitle1: Object.assign({}, typography.TitleLarge), subtitle2: Object.assign({}, typography.TitleMedium), body1: Object.assign({}, typography.BodyMedium), body2: Object.assign({}, typography.BodySmall), button: Object.assign({}, typography.HeadlineLarge), caption: Object.assign({}, typography.BodySmall), overline: Object.assign({}, typography.LabelSmall) }),
|
|
25
|
+
};
|
|
26
|
+
// Apply themeOptionsModifier (palette, typography, spacing, etc.)
|
|
27
|
+
let themeOptions = baseThemeOptions;
|
|
28
|
+
if (themeOptionsModifier) {
|
|
29
|
+
themeOptions = themeOptionsModifier(themeOptions);
|
|
30
|
+
}
|
|
31
|
+
let theme = createTheme(themeOptions, localization);
|
|
25
32
|
patchMUIShadows(theme);
|
|
26
|
-
|
|
33
|
+
// Apply themeComponentsModifier (component styles and props)
|
|
34
|
+
if (themeComponentsModifier) {
|
|
35
|
+
theme = deepmerge(theme, themeComponentsModifier(getMUIComponents(theme, themeMode), theme));
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
theme = deepmerge(theme, getMUIComponents(theme, themeMode));
|
|
39
|
+
}
|
|
27
40
|
return theme;
|
|
28
|
-
}, [themeMode, localization]);
|
|
41
|
+
}, [themeMode, localization, themeOptionsModifier, themeComponentsModifier]);
|
|
29
42
|
return (_jsxs(ThemeProvider, { theme: webprosTheme, children: [_jsx(CssBaseline, { enableColorScheme: true }), children] }));
|
|
30
43
|
};
|
|
31
44
|
export default WebProsTheme;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ThemeColorTokensLegacy } from '../tokens/legacyColors/ThemeColorTokensLegacy';
|
|
2
1
|
import { Schemes, SchemesGenerated, StateLayers, StateLayersGenerated, InverseSchemes, InverseSchemesGenerated, InverseStateLayers, InverseStateLayersGenerated } from '../tokens/colors';
|
|
3
|
-
export type ThemeColorTokens =
|
|
2
|
+
export type ThemeColorTokens = {
|
|
4
3
|
schemes: Schemes;
|
|
5
4
|
stateLayers: StateLayers;
|
|
6
5
|
inverseSchemes: InverseSchemes;
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
2
|
import { DarkSchemes, DarkSchemesGenerated, DarkStateLayers, DarkStateLayersGenerated, DarkInverseSchemes, DarkInverseSchemesGenerated, DarkInverseStateLayers, DarkInverseStateLayersGenerated, LightSchemes, LightSchemesGenerated, LightStateLayers, LightStateLayersGenerated, LightInverseSchemes, LightInverseSchemesGenerated, LightInverseStateLayers, LightInverseStateLayersGenerated, } from '../tokens/colors';
|
|
3
|
-
import { LegacyDarkTokensDefault, LegacyLightTokensDefault, } from '../tokens/legacyColors';
|
|
4
3
|
// reference
|
|
5
|
-
export const LightTokensDefault =
|
|
4
|
+
export const LightTokensDefault = {
|
|
5
|
+
schemes: LightSchemes,
|
|
6
|
+
stateLayers: LightStateLayers,
|
|
7
|
+
inverseSchemes: LightInverseSchemes,
|
|
8
|
+
inverseStateLayers: LightInverseStateLayers,
|
|
9
|
+
generatedSchemes: LightSchemesGenerated,
|
|
10
|
+
generatedStateLayers: LightStateLayersGenerated,
|
|
11
|
+
generatedInverseSchemes: LightInverseSchemesGenerated,
|
|
12
|
+
generatedInverseStateLayers: LightInverseStateLayersGenerated,
|
|
13
|
+
};
|
|
6
14
|
// reference
|
|
7
15
|
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=53699-35493&t=pvKyGGnGRUL3kYn8-1
|
|
8
|
-
export const DarkTokensDefault =
|
|
16
|
+
export const DarkTokensDefault = {
|
|
17
|
+
schemes: DarkSchemes,
|
|
18
|
+
stateLayers: DarkStateLayers,
|
|
19
|
+
inverseSchemes: DarkInverseSchemes,
|
|
20
|
+
inverseStateLayers: DarkInverseStateLayers,
|
|
21
|
+
generatedSchemes: DarkSchemesGenerated,
|
|
22
|
+
generatedStateLayers: DarkStateLayersGenerated,
|
|
23
|
+
generatedInverseSchemes: DarkInverseSchemesGenerated,
|
|
24
|
+
generatedInverseStateLayers: DarkInverseStateLayersGenerated,
|
|
25
|
+
};
|
|
@@ -298,6 +298,8 @@ export const DarkStateLayers = {
|
|
|
298
298
|
opacity12: 'rgba(140, 49, 72, 0.12)',
|
|
299
299
|
opacity16: 'rgba(140, 49, 72, 0.16)',
|
|
300
300
|
opacity10: 'rgba(140, 49, 72, 0.1)',
|
|
301
|
+
opacity56: 'rgba(140, 49, 72, 0.56)',
|
|
302
|
+
opacity78: 'rgba(140, 49, 72, 0.78)',
|
|
301
303
|
},
|
|
302
304
|
onErrorContainer: {
|
|
303
305
|
opacity08: 'rgba(255, 242, 245, 0.08)',
|
|
@@ -399,6 +401,8 @@ export const DarkStateLayers = {
|
|
|
399
401
|
opacity08: 'rgba(123, 60, 15, 0.08)',
|
|
400
402
|
opacity12: 'rgba(123, 60, 15, 0.12)',
|
|
401
403
|
opacity16: 'rgba(123, 60, 15, 0.16)',
|
|
404
|
+
opacity56: 'rgba(123, 60, 15, 0.56)',
|
|
405
|
+
opacity78: 'rgba(123, 60, 15, 0.78)',
|
|
402
406
|
},
|
|
403
407
|
successContainer: {
|
|
404
408
|
opacity08: 'rgba(18, 95, 22, 0.08)',
|
|
@@ -470,6 +474,7 @@ export const DarkStateLayers = {
|
|
|
470
474
|
opacity16: 'rgba(159, 162, 179, 0.16)',
|
|
471
475
|
opacity38: 'rgba(159, 162, 179, 0.38)',
|
|
472
476
|
opacity10: 'rgba(159, 162, 179, 0.1)',
|
|
477
|
+
opacity78: 'rgba(159, 162, 179, 0.78)',
|
|
473
478
|
},
|
|
474
479
|
shadow: {
|
|
475
480
|
opacity08: 'rgba(0, 0, 0, 0.08)',
|
|
@@ -1024,6 +1029,8 @@ export const DarkStateLayersGenerated = {
|
|
|
1024
1029
|
'stateLayers.status.errorContainer.opacity12': { r: 140, g: 49, b: 72, a: 0.12 },
|
|
1025
1030
|
'stateLayers.status.errorContainer.opacity16': { r: 140, g: 49, b: 72, a: 0.16 },
|
|
1026
1031
|
'stateLayers.status.errorContainer.opacity10': { r: 140, g: 49, b: 72, a: 0.1 },
|
|
1032
|
+
'stateLayers.status.errorContainer.opacity56': { r: 140, g: 49, b: 72, a: 0.56 },
|
|
1033
|
+
'stateLayers.status.errorContainer.opacity78': { r: 140, g: 49, b: 72, a: 0.78 },
|
|
1027
1034
|
'stateLayers.status.onErrorContainer.opacity08': { r: 255, g: 242, b: 245, a: 0.08 },
|
|
1028
1035
|
'stateLayers.status.onErrorContainer.opacity12': { r: 255, g: 242, b: 245, a: 0.12 },
|
|
1029
1036
|
'stateLayers.status.onErrorContainer.opacity16': { r: 255, g: 242, b: 245, a: 0.16 },
|
|
@@ -1097,6 +1104,8 @@ export const DarkStateLayersGenerated = {
|
|
|
1097
1104
|
'stateLayers.status.warningContainer.opacity08': { r: 123, g: 60, b: 15, a: 0.08 },
|
|
1098
1105
|
'stateLayers.status.warningContainer.opacity12': { r: 123, g: 60, b: 15, a: 0.12 },
|
|
1099
1106
|
'stateLayers.status.warningContainer.opacity16': { r: 123, g: 60, b: 15, a: 0.16 },
|
|
1107
|
+
'stateLayers.status.warningContainer.opacity56': { r: 123, g: 60, b: 15, a: 0.56 },
|
|
1108
|
+
'stateLayers.status.warningContainer.opacity78': { r: 123, g: 60, b: 15, a: 0.78 },
|
|
1100
1109
|
'stateLayers.status.successContainer.opacity08': { r: 18, g: 95, b: 22, a: 0.08 },
|
|
1101
1110
|
'stateLayers.status.successContainer.opacity12': { r: 18, g: 95, b: 22, a: 0.12 },
|
|
1102
1111
|
'stateLayers.status.successContainer.opacity16': { r: 18, g: 95, b: 22, a: 0.16 },
|
|
@@ -1146,6 +1155,7 @@ export const DarkStateLayersGenerated = {
|
|
|
1146
1155
|
'stateLayers.surfaces.onSurfaceVariant.opacity16': { r: 159, g: 162, b: 179, a: 0.16 },
|
|
1147
1156
|
'stateLayers.surfaces.onSurfaceVariant.opacity38': { r: 159, g: 162, b: 179, a: 0.38 },
|
|
1148
1157
|
'stateLayers.surfaces.onSurfaceVariant.opacity10': { r: 159, g: 162, b: 179, a: 0.1 },
|
|
1158
|
+
'stateLayers.surfaces.onSurfaceVariant.opacity78': { r: 159, g: 162, b: 179, a: 0.78 },
|
|
1149
1159
|
'stateLayers.surfaces.shadow.opacity08': { r: 0, g: 0, b: 0, a: 0.08 },
|
|
1150
1160
|
'stateLayers.surfaces.shadow.opacity12': { r: 0, g: 0, b: 0, a: 0.12 },
|
|
1151
1161
|
'stateLayers.surfaces.shadow.opacity16': { r: 0, g: 0, b: 0, a: 0.16 },
|
|
@@ -4,7 +4,7 @@ export const LightSchemes = {
|
|
|
4
4
|
base: {
|
|
5
5
|
primary: 'rgba(95, 77, 152, 1)',
|
|
6
6
|
onPrimary: 'rgba(255, 255, 255, 1)',
|
|
7
|
-
primaryContainer: 'rgba(
|
|
7
|
+
primaryContainer: 'rgba(227, 224, 252, 1)',
|
|
8
8
|
onPrimaryContainer: 'rgba(84, 66, 138, 1)',
|
|
9
9
|
secondary: 'rgba(95, 102, 144, 1)',
|
|
10
10
|
onSecondary: 'rgba(255, 255, 255, 1)',
|
|
@@ -14,7 +14,7 @@ export const LightSchemes = {
|
|
|
14
14
|
onTertiary: 'rgba(255, 255, 255, 1)',
|
|
15
15
|
tertiaryContainer: 'rgba(218, 233, 240, 1)',
|
|
16
16
|
onTertiaryContainer: 'rgba(17, 38, 47, 1)',
|
|
17
|
-
primaryVariant: 'rgba(
|
|
17
|
+
primaryVariant: 'rgba(115, 95, 173, 1)',
|
|
18
18
|
onPrimaryVariant: 'rgba(230, 228, 235, 1)',
|
|
19
19
|
onPrimaryBase: 'rgba(255, 255, 255, 1)',
|
|
20
20
|
onPrimaryBaseVariant: 'rgba(230, 228, 235, 1)',
|
|
@@ -23,7 +23,7 @@ export const LightSchemes = {
|
|
|
23
23
|
surfaceTint: 'rgba(86, 77, 130, 1)',
|
|
24
24
|
background: 'rgba(233, 235, 246, 1)',
|
|
25
25
|
onBackground: 'rgba(27, 28, 33, 1)',
|
|
26
|
-
surface: 'rgba(
|
|
26
|
+
surface: 'rgba(235, 235, 244, 1)',
|
|
27
27
|
onSurface: 'rgba(27, 28, 33, 1)',
|
|
28
28
|
surfaceVariant: 'rgba(247, 247, 252, 1)',
|
|
29
29
|
onSurfaceVariant: 'rgba(83, 86, 111, 1)',
|
|
@@ -128,10 +128,10 @@ export const LightStateLayers = {
|
|
|
128
128
|
opacity28: 'rgba(255, 255, 255, 0.28)',
|
|
129
129
|
},
|
|
130
130
|
primaryContainer: {
|
|
131
|
-
opacity08: 'rgba(
|
|
132
|
-
opacity12: 'rgba(
|
|
133
|
-
opacity16: 'rgba(
|
|
134
|
-
opacity10: 'rgba(
|
|
131
|
+
opacity08: 'rgba(227, 224, 252, 0.08)',
|
|
132
|
+
opacity12: 'rgba(227, 224, 252, 0.12)',
|
|
133
|
+
opacity16: 'rgba(227, 224, 252, 0.16)',
|
|
134
|
+
opacity10: 'rgba(227, 224, 252, 0.1)',
|
|
135
135
|
},
|
|
136
136
|
onPrimaryContainer: {
|
|
137
137
|
opacity08: 'rgba(84, 66, 138, 0.08)',
|
|
@@ -298,6 +298,8 @@ export const LightStateLayers = {
|
|
|
298
298
|
opacity12: 'rgba(255, 233, 230, 0.12)',
|
|
299
299
|
opacity16: 'rgba(255, 233, 230, 0.16)',
|
|
300
300
|
opacity10: 'rgba(255, 233, 230, 0.1)',
|
|
301
|
+
opacity56: 'rgba(255, 233, 230, 0.56)',
|
|
302
|
+
opacity78: 'rgba(255, 233, 230, 0.78)',
|
|
301
303
|
},
|
|
302
304
|
onErrorContainer: {
|
|
303
305
|
opacity08: 'rgba(155, 30, 30, 0.08)',
|
|
@@ -399,6 +401,8 @@ export const LightStateLayers = {
|
|
|
399
401
|
opacity08: 'rgba(255, 239, 210, 0.08)',
|
|
400
402
|
opacity12: 'rgba(255, 239, 210, 0.12)',
|
|
401
403
|
opacity16: 'rgba(255, 239, 210, 0.16)',
|
|
404
|
+
opacity56: 'rgba(255, 239, 210, 0.56)',
|
|
405
|
+
opacity78: 'rgba(255, 239, 210, 0.78)',
|
|
402
406
|
},
|
|
403
407
|
successContainer: {
|
|
404
408
|
opacity08: 'rgba(225, 245, 227, 0.08)',
|
|
@@ -470,6 +474,7 @@ export const LightStateLayers = {
|
|
|
470
474
|
opacity16: 'rgba(83, 86, 111, 0.07)',
|
|
471
475
|
opacity38: 'rgba(83, 86, 111, 0.38)',
|
|
472
476
|
opacity10: 'rgba(83, 86, 111, 0.1)',
|
|
477
|
+
opacity78: 'rgba(83, 86, 111, 0.78)',
|
|
473
478
|
},
|
|
474
479
|
shadow: {
|
|
475
480
|
opacity08: 'rgba(0, 0, 0, 0.08)',
|
|
@@ -799,7 +804,7 @@ export const LightInverseStateLayers = {
|
|
|
799
804
|
export const LightSchemesGenerated = {
|
|
800
805
|
'schemes.base.primary': { r: 95, g: 77, b: 152, a: 1 },
|
|
801
806
|
'schemes.base.onPrimary': { r: 255, g: 255, b: 255, a: 1 },
|
|
802
|
-
'schemes.base.primaryContainer': { r:
|
|
807
|
+
'schemes.base.primaryContainer': { r: 227, g: 224, b: 252, a: 1 },
|
|
803
808
|
'schemes.base.onPrimaryContainer': { r: 84, g: 66, b: 138, a: 1 },
|
|
804
809
|
'schemes.base.secondary': { r: 95, g: 102, b: 144, a: 1 },
|
|
805
810
|
'schemes.base.onSecondary': { r: 255, g: 255, b: 255, a: 1 },
|
|
@@ -809,14 +814,14 @@ export const LightSchemesGenerated = {
|
|
|
809
814
|
'schemes.base.onTertiary': { r: 255, g: 255, b: 255, a: 1 },
|
|
810
815
|
'schemes.base.tertiaryContainer': { r: 218, g: 233, b: 240, a: 1 },
|
|
811
816
|
'schemes.base.onTertiaryContainer': { r: 17, g: 38, b: 47, a: 1 },
|
|
812
|
-
'schemes.base.primaryVariant': { r:
|
|
817
|
+
'schemes.base.primaryVariant': { r: 115, g: 95, b: 173, a: 1 },
|
|
813
818
|
'schemes.base.onPrimaryVariant': { r: 230, g: 228, b: 235, a: 1 },
|
|
814
819
|
'schemes.base.onPrimaryBase': { r: 255, g: 255, b: 255, a: 1 },
|
|
815
820
|
'schemes.base.onPrimaryBaseVariant': { r: 230, g: 228, b: 235, a: 1 },
|
|
816
821
|
'schemes.surfaces.surfaceTint': { r: 86, g: 77, b: 130, a: 1 },
|
|
817
822
|
'schemes.surfaces.background': { r: 233, g: 235, b: 246, a: 1 },
|
|
818
823
|
'schemes.surfaces.onBackground': { r: 27, g: 28, b: 33, a: 1 },
|
|
819
|
-
'schemes.surfaces.surface': { r:
|
|
824
|
+
'schemes.surfaces.surface': { r: 235, g: 235, b: 244, a: 1 },
|
|
820
825
|
'schemes.surfaces.onSurface': { r: 27, g: 28, b: 33, a: 1 },
|
|
821
826
|
'schemes.surfaces.surfaceVariant': { r: 247, g: 247, b: 252, a: 1 },
|
|
822
827
|
'schemes.surfaces.onSurfaceVariant': { r: 83, g: 86, b: 111, a: 1 },
|
|
@@ -906,10 +911,10 @@ export const LightStateLayersGenerated = {
|
|
|
906
911
|
'stateLayers.base.onPrimary.opacity10': { r: 255, g: 255, b: 255, a: 0.1 },
|
|
907
912
|
'stateLayers.base.onPrimary.opacity38': { r: 255, g: 255, b: 255, a: 0.38 },
|
|
908
913
|
'stateLayers.base.onPrimary.opacity28': { r: 255, g: 255, b: 255, a: 0.28 },
|
|
909
|
-
'stateLayers.base.primaryContainer.opacity08': { r:
|
|
910
|
-
'stateLayers.base.primaryContainer.opacity12': { r:
|
|
911
|
-
'stateLayers.base.primaryContainer.opacity16': { r:
|
|
912
|
-
'stateLayers.base.primaryContainer.opacity10': { r:
|
|
914
|
+
'stateLayers.base.primaryContainer.opacity08': { r: 227, g: 224, b: 252, a: 0.08 },
|
|
915
|
+
'stateLayers.base.primaryContainer.opacity12': { r: 227, g: 224, b: 252, a: 0.12 },
|
|
916
|
+
'stateLayers.base.primaryContainer.opacity16': { r: 227, g: 224, b: 252, a: 0.16 },
|
|
917
|
+
'stateLayers.base.primaryContainer.opacity10': { r: 227, g: 224, b: 252, a: 0.1 },
|
|
913
918
|
'stateLayers.base.onPrimaryContainer.opacity08': { r: 84, g: 66, b: 138, a: 0.08 },
|
|
914
919
|
'stateLayers.base.onPrimaryContainer.opacity12': { r: 84, g: 66, b: 138, a: 0.12 },
|
|
915
920
|
'stateLayers.base.onPrimaryContainer.opacity16': { r: 84, g: 66, b: 138, a: 0.16 },
|
|
@@ -1024,6 +1029,8 @@ export const LightStateLayersGenerated = {
|
|
|
1024
1029
|
'stateLayers.status.errorContainer.opacity12': { r: 255, g: 233, b: 230, a: 0.12 },
|
|
1025
1030
|
'stateLayers.status.errorContainer.opacity16': { r: 255, g: 233, b: 230, a: 0.16 },
|
|
1026
1031
|
'stateLayers.status.errorContainer.opacity10': { r: 255, g: 233, b: 230, a: 0.1 },
|
|
1032
|
+
'stateLayers.status.errorContainer.opacity56': { r: 255, g: 233, b: 230, a: 0.56 },
|
|
1033
|
+
'stateLayers.status.errorContainer.opacity78': { r: 255, g: 233, b: 230, a: 0.78 },
|
|
1027
1034
|
'stateLayers.status.onErrorContainer.opacity08': { r: 155, g: 30, b: 30, a: 0.08 },
|
|
1028
1035
|
'stateLayers.status.onErrorContainer.opacity12': { r: 155, g: 30, b: 30, a: 0.12 },
|
|
1029
1036
|
'stateLayers.status.onErrorContainer.opacity16': { r: 155, g: 30, b: 30, a: 0.16 },
|
|
@@ -1097,6 +1104,8 @@ export const LightStateLayersGenerated = {
|
|
|
1097
1104
|
'stateLayers.status.warningContainer.opacity08': { r: 255, g: 239, b: 210, a: 0.08 },
|
|
1098
1105
|
'stateLayers.status.warningContainer.opacity12': { r: 255, g: 239, b: 210, a: 0.12 },
|
|
1099
1106
|
'stateLayers.status.warningContainer.opacity16': { r: 255, g: 239, b: 210, a: 0.16 },
|
|
1107
|
+
'stateLayers.status.warningContainer.opacity56': { r: 255, g: 239, b: 210, a: 0.56 },
|
|
1108
|
+
'stateLayers.status.warningContainer.opacity78': { r: 255, g: 239, b: 210, a: 0.78 },
|
|
1100
1109
|
'stateLayers.status.successContainer.opacity08': { r: 225, g: 245, b: 227, a: 0.08 },
|
|
1101
1110
|
'stateLayers.status.successContainer.opacity12': { r: 225, g: 245, b: 227, a: 0.12 },
|
|
1102
1111
|
'stateLayers.status.successContainer.opacity16': { r: 225, g: 245, b: 227, a: 0.16 },
|
|
@@ -1146,6 +1155,7 @@ export const LightStateLayersGenerated = {
|
|
|
1146
1155
|
'stateLayers.surfaces.onSurfaceVariant.opacity16': { r: 83, g: 86, b: 111, a: 0.07 },
|
|
1147
1156
|
'stateLayers.surfaces.onSurfaceVariant.opacity38': { r: 83, g: 86, b: 111, a: 0.38 },
|
|
1148
1157
|
'stateLayers.surfaces.onSurfaceVariant.opacity10': { r: 83, g: 86, b: 111, a: 0.1 },
|
|
1158
|
+
'stateLayers.surfaces.onSurfaceVariant.opacity78': { r: 83, g: 86, b: 111, a: 0.78 },
|
|
1149
1159
|
'stateLayers.surfaces.shadow.opacity08': { r: 0, g: 0, b: 0, a: 0.08 },
|
|
1150
1160
|
'stateLayers.surfaces.shadow.opacity12': { r: 0, g: 0, b: 0, a: 0.12 },
|
|
1151
1161
|
'stateLayers.surfaces.shadow.opacity16': { r: 0, g: 0, b: 0, a: 0.16 },
|
|
@@ -189,6 +189,8 @@ export type StateLayers = {
|
|
|
189
189
|
opacity12: string;
|
|
190
190
|
opacity16: string;
|
|
191
191
|
opacity10: string;
|
|
192
|
+
opacity56: string;
|
|
193
|
+
opacity78: string;
|
|
192
194
|
};
|
|
193
195
|
onErrorContainer: {
|
|
194
196
|
opacity08: string;
|
|
@@ -290,6 +292,8 @@ export type StateLayers = {
|
|
|
290
292
|
opacity08: string;
|
|
291
293
|
opacity12: string;
|
|
292
294
|
opacity16: string;
|
|
295
|
+
opacity56: string;
|
|
296
|
+
opacity78: string;
|
|
293
297
|
};
|
|
294
298
|
successContainer: {
|
|
295
299
|
opacity08: string;
|
|
@@ -361,6 +365,7 @@ export type StateLayers = {
|
|
|
361
365
|
opacity16: string;
|
|
362
366
|
opacity38: string;
|
|
363
367
|
opacity10: string;
|
|
368
|
+
opacity78: string;
|
|
364
369
|
};
|
|
365
370
|
shadow: {
|
|
366
371
|
opacity08: string;
|
|
@@ -57,8 +57,8 @@ export const typographyVariants = {
|
|
|
57
57
|
},
|
|
58
58
|
DisplaySmall: {
|
|
59
59
|
fontFamily: 'Roboto',
|
|
60
|
-
fontSize: '
|
|
61
|
-
lineHeight: '
|
|
60
|
+
fontSize: '26px',
|
|
61
|
+
lineHeight: '44px',
|
|
62
62
|
letterSpacing: '0px',
|
|
63
63
|
fontWeight: 400,
|
|
64
64
|
},
|
|
@@ -71,8 +71,8 @@ export const typographyVariants = {
|
|
|
71
71
|
},
|
|
72
72
|
HeadlineLarge: {
|
|
73
73
|
fontFamily: 'Roboto',
|
|
74
|
-
fontSize: '
|
|
75
|
-
lineHeight: '
|
|
74
|
+
fontSize: '19px',
|
|
75
|
+
lineHeight: '32px',
|
|
76
76
|
letterSpacing: '0px',
|
|
77
77
|
fontWeight: 400,
|
|
78
78
|
},
|
|
@@ -16,29 +16,27 @@ function extractPath(svg) {
|
|
|
16
16
|
const StyledIconWrapper = styled('span', {
|
|
17
17
|
shouldForwardProp: (prop) => prop !== 'iconColor',
|
|
18
18
|
})(({ theme, iconColor }) => {
|
|
19
|
+
const { colors } = theme;
|
|
19
20
|
if (!iconColor || iconColor === 'inherit') {
|
|
20
21
|
return { display: 'inline-flex', color: 'inherit' };
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
// Map MUI color tokens to M3 color schemes
|
|
24
|
+
const colorMapping = {
|
|
25
|
+
primary: colors.schemes.base.primary,
|
|
26
|
+
secondary: colors.schemes.base.secondary,
|
|
27
|
+
error: colors.schemes.status.error,
|
|
28
|
+
warning: colors.schemes.status.warning,
|
|
29
|
+
info: colors.schemes.status.info,
|
|
30
|
+
success: colors.schemes.status.success,
|
|
31
|
+
action: colors.schemes.surfaces.onSurfaceVariant,
|
|
32
|
+
disabled: colors.stateLayers.surfaces.onSurface.opacity38,
|
|
33
|
+
};
|
|
34
|
+
if (colorMapping[iconColor]) {
|
|
31
35
|
return {
|
|
32
36
|
display: 'inline-flex',
|
|
33
|
-
color:
|
|
37
|
+
color: colorMapping[iconColor],
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
|
-
if (iconColor === 'action') {
|
|
37
|
-
return { display: 'inline-flex', color: theme.palette.action.active };
|
|
38
|
-
}
|
|
39
|
-
if (iconColor === 'disabled') {
|
|
40
|
-
return { display: 'inline-flex', color: theme.palette.action.disabled };
|
|
41
|
-
}
|
|
42
40
|
return { display: 'inline-flex', color: iconColor };
|
|
43
41
|
});
|
|
44
42
|
function extractPathsData(svg) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Theme } from '@mui/material';
|
|
2
2
|
import { ThemeMode } from '../tokens/ThemeMode';
|
|
3
|
-
type M3Components = {
|
|
3
|
+
export type M3Components = {
|
|
4
4
|
components: Theme['components'];
|
|
5
5
|
};
|
|
6
6
|
export declare const getMUIComponents: (theme: Theme, _mode: ThemeMode) => M3Components;
|
|
7
|
-
export {};
|