@webpros/mui-theme 0.2.0 → 0.3.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webpros/mui-theme",
3
- "description": "MUI v6 theme for WebPros products",
4
- "version": "0.2.0",
3
+ "description": "MUI v7 theme for WebPros products",
4
+ "version": "0.3.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,6 +20,10 @@
20
20
  ".": {
21
21
  "import": "./dist/src/index.js",
22
22
  "types": "./dist/src/index.d.ts"
23
+ },
24
+ "./icons": {
25
+ "import": "./dist/src/icons/index.js",
26
+ "types": "./dist/src/icons/index.d.ts"
23
27
  }
24
28
  },
25
29
  "type": "module",
@@ -43,15 +47,16 @@
43
47
  "prettier:test": "prettier --check \"**/*.{ts,tsx}\"",
44
48
  "prettier:write": "prettier --write \"**/*.{ts,tsx}\"",
45
49
  "typecheck": "tsc --noEmit",
46
- "extract-tokens": "node tools/extractM3Tokens.js"
50
+ "extract-tokens": "node tools/extractM3Tokens.js",
51
+ "generate:icons": "node scripts/generate-icons.cjs"
47
52
  },
48
53
  "peerDependencies": {
49
54
  "@emotion/react": "^11.14.0",
50
55
  "@emotion/styled": "^11.14.1",
51
56
  "@fontsource/roboto": "^5.2.6",
52
57
  "@material/material-color-utilities": "^0.3.0",
53
- "@mui/material": "^6.4.0",
54
- "@mui/utils": "^6.4.0",
58
+ "@mui/material": "^7.3.6",
59
+ "@mui/utils": "^7.3.6",
55
60
  "@mui/x-data-grid": "^7.29.0",
56
61
  "@mui/x-date-pickers": "^7.29.0",
57
62
  "@phosphor-icons/react": "^2.1.0",
@@ -67,8 +72,8 @@
67
72
  "@eslint/js": "^9.38.0",
68
73
  "@fontsource/roboto": "^5.2.6",
69
74
  "@material/material-color-utilities": "^0.3.0",
70
- "@mui/material": "^6.4.0",
71
- "@mui/utils": "^6.4.0",
75
+ "@mui/material": "^7.3.6",
76
+ "@mui/utils": "^7.3.6",
72
77
  "@mui/x-data-grid": "^7.29.0",
73
78
  "@mui/x-date-pickers": "^7.29.0",
74
79
  "@phosphor-icons/react": "^2.1.0",
@@ -80,8 +85,8 @@
80
85
  "@storybook/react-vite": "^9.1.16",
81
86
  "@stylistic/eslint-plugin": "^5.5.0",
82
87
  "@types/node": "^24.8.1",
83
- "@types/react": "^19.2.2",
84
- "@types/react-dom": "^19.2.2",
88
+ "@types/react": "18.3.1",
89
+ "@types/react-dom": "^18.3.1",
85
90
  "@vitejs/plugin-react": "^5.0.4",
86
91
  "eslint": "^9.38.0",
87
92
  "eslint-config-prettier": "^10.1.8",
@@ -112,5 +117,8 @@
112
117
  "extends": [
113
118
  "plugin:storybook/recommended"
114
119
  ]
120
+ },
121
+ "resolutions": {
122
+ "react-is": "^18.3.1"
115
123
  }
116
124
  }
@@ -11,6 +11,7 @@ export const getAlert = (theme) => {
11
11
  styleOverrides: {
12
12
  root: {
13
13
  borderRadius: '6px',
14
+ padding: '8px',
14
15
  '& svg': {
15
16
  width: '20px',
16
17
  height: '20px',
@@ -1,4 +1,9 @@
1
1
  import { Theme, ComponentsProps, ComponentsOverrides, ComponentsVariants } from '@mui/material';
2
+ declare module '@mui/material/DialogActions' {
3
+ interface DialogActionsProps {
4
+ alignment?: 'left' | 'right';
5
+ }
6
+ }
2
7
  interface M3Dialog {
3
8
  MuiDialog: {
4
9
  defaultProps?: ComponentsProps['MuiDialog'];
@@ -1,7 +1,12 @@
1
1
  // Copyright 2025 WebPros International GmbH. All rights reserved.
2
- import { modalClasses, dialogContentClasses, dialogClasses, } from '@mui/material';
2
+ import { modalClasses, dialogContentClasses, dialogClasses, iconButtonClasses, } from '@mui/material';
3
3
  export const getDialog = (theme) => {
4
- const { spacing, palette } = theme;
4
+ const { spacing, palette, colors } = theme;
5
+ const closeButtonPosition = {
6
+ position: 'absolute',
7
+ right: spacing(3),
8
+ top: 25,
9
+ };
5
10
  return {
6
11
  MuiDialogTitle: {
7
12
  defaultProps: {
@@ -9,21 +14,29 @@ export const getDialog = (theme) => {
9
14
  },
10
15
  styleOverrides: {
11
16
  root: {
12
- padding: `${spacing(2)} ${spacing(3)} ${spacing(1.5)}`,
13
- // By default, MUI removes top padding from DialogContent when it follows DialogTitle,
14
- // which can cause content to appear 'behind' the title. We're changing default padding to
15
- // create proper spacing between title and content without adjusting design of all dialogs
16
- // important set because with value 1 it does not work
17
+ padding: spacing(3.75, 8.25, 2.375, 4.5),
18
+ color: palette.onSurface.main,
17
19
  [`& + .${dialogContentClasses.root}`]: {
18
- paddingTop: `${spacing(1)} !important`,
20
+ paddingTop: '0 !important',
19
21
  },
22
+ [`& .${iconButtonClasses.root}`]: closeButtonPosition,
20
23
  },
21
24
  },
22
25
  },
23
26
  MuiDialog: {
27
+ defaultProps: {
28
+ PaperProps: {
29
+ elevation: 3,
30
+ },
31
+ },
24
32
  styleOverrides: {
25
33
  paper: {
26
- borderRadius: spacing(3.5),
34
+ borderRadius: 10,
35
+ backgroundColor: colors.schemes.surfaces.elevatedContainer,
36
+ [`& > .${iconButtonClasses.root}`]: closeButtonPosition,
37
+ [`& > .${iconButtonClasses.root} + .${dialogContentClasses.root}`]: {
38
+ paddingTop: spacing(5.125),
39
+ },
27
40
  [`&.${dialogClasses.paperFullScreen}`]: {
28
41
  borderRadius: 0,
29
42
  maxWidth: 'none',
@@ -34,9 +47,8 @@ export const getDialog = (theme) => {
34
47
  height: 'auto',
35
48
  [`&.${modalClasses.root}.${dialogClasses.root} .${dialogClasses.paper}`]: {
36
49
  height: 'auto',
37
- minHeight: '200px',
50
+ minHeight: spacing(25),
38
51
  },
39
- borderRadius: spacing(1),
40
52
  },
41
53
  },
42
54
  },
@@ -44,17 +56,34 @@ export const getDialog = (theme) => {
44
56
  styleOverrides: {
45
57
  root: {
46
58
  color: palette.onSurfaceVariant.main,
47
- padding: `0 ${spacing(3)} ${spacing(3)}`,
59
+ padding: spacing(0, 4.5, 1, 4.5),
60
+ },
61
+ dividers: {
62
+ padding: spacing(2, 4.5),
63
+ borderColor: colors.schemes.surfaces.outlineVariant,
48
64
  },
49
65
  },
50
66
  },
51
67
  MuiDialogActions: {
52
68
  styleOverrides: {
53
69
  root: {
54
- padding: `${spacing(1)} ${spacing(3)} ${spacing(3)}`,
55
- justifyContent: 'flex-start',
70
+ padding: spacing(2, 4.25, 2.5, 2.375),
71
+ justifyContent: 'flex-end',
72
+ gap: spacing(0.5),
73
+ '& > :not(style) ~ :not(style)': {
74
+ marginLeft: 0,
75
+ },
56
76
  },
57
77
  },
78
+ variants: [
79
+ {
80
+ props: { alignment: 'left' },
81
+ style: {
82
+ justifyContent: 'flex-start',
83
+ padding: spacing(2, 2.375, 2.5, 4.25),
84
+ },
85
+ },
86
+ ],
58
87
  },
59
88
  MuiDialogContentText: {
60
89
  styleOverrides: {
@@ -7,31 +7,40 @@ export const getLinearProgress = (theme) => {
7
7
  const palette = colors[schemesPath];
8
8
  const layers = colors[layersPath];
9
9
  const colorMap = {
10
- primary: { primary: palette.base.primary, secondary: layers.base.primary.opacity28 },
10
+ primary: {
11
+ primary: palette.base.primary,
12
+ secondary: layers.base.primary.opacity28,
13
+ },
11
14
  secondary: {
12
15
  primary: palette.base.secondary,
13
16
  secondary: layers.base.secondary.opacity12,
14
17
  },
15
- error: { primary: palette.status.error, secondary: layers.status.error.opacity28 },
16
- info: { primary: palette.status.info, secondary: layers.status.undefined.opacity28 },
18
+ error: {
19
+ primary: palette.status.error,
20
+ secondary: layers.status.error.opacity28,
21
+ },
22
+ info: {
23
+ primary: palette.status.info,
24
+ secondary: layers.status.info.opacity28,
25
+ },
17
26
  success: {
18
27
  primary: palette.status.success,
19
28
  secondary: layers.status.success.opacity28,
20
29
  },
21
30
  warning: {
22
31
  primary: palette.status.warning,
23
- secondary: layers.status.undefined.opacity28,
32
+ secondary: layers.status.warning.opacity28,
33
+ },
34
+ inherit: {
35
+ primary: palette.surfaces.onSurface,
36
+ secondary: layers.surfaces.onSurface.opacity28,
24
37
  },
25
- inherit: { primary: 'inherit', secondary: 'inherit' },
26
38
  };
27
39
  const simpleVariants = ['determinate', 'indeterminate', 'query'].map((variant) => ({
28
40
  props: { color, viewContext, variant },
29
41
  style: {
30
42
  background: colorMap[color].secondary,
31
- '.MuiLinearProgress-bar1': {
32
- background: colorMap[color].primary,
33
- },
34
- '.MuiLinearProgress-bar2': {
43
+ '.MuiLinearProgress-bar': {
35
44
  background: colorMap[color].primary,
36
45
  },
37
46
  },
@@ -58,14 +67,13 @@ export const getLinearProgress = (theme) => {
58
67
  MuiLinearProgress: {
59
68
  styleOverrides: {
60
69
  root: {
61
- borderRadius: '20px',
70
+ borderRadius: '2px',
62
71
  '.MuiLinearProgress-bar': {
63
72
  strokeLinecap: 'round',
64
- borderRadius: '20px',
73
+ borderRadius: '2px',
65
74
  },
66
75
  },
67
76
  },
68
- // @ts-expect-error
69
77
  variants: [
70
78
  ...getLinearProgressColors('primary'),
71
79
  ...getLinearProgressColors('secondary'),
@@ -9,6 +9,10 @@ export const getSnackbar = (theme) => {
9
9
  '& .MuiSnackbarContent-root': {
10
10
  backgroundColor: colors.inverseSchemes.surfaces.elevatedContainerLowest,
11
11
  alignItems: 'baseline',
12
+ paddingTop: 0,
13
+ },
14
+ '& .MuiSnackbarContent-action': {
15
+ marginRight: 0,
12
16
  },
13
17
  },
14
18
  },
@@ -54,7 +54,7 @@ export const getOutlinedInput = () => {
54
54
  },
55
55
  },
56
56
  {
57
- props: ({ ownerState }) => ownerState.multiline,
57
+ props: ({ ownerState }) => !!ownerState.multiline,
58
58
  style: {
59
59
  padding: 0,
60
60
  },
@@ -28,7 +28,7 @@ export const getTabs = (theme) => ({
28
28
  root: {
29
29
  [`&.${tabsClasses.vertical}`]: {
30
30
  [`& .${tabClasses.root}`]: {
31
- padding: '10px 16px 10px 10px',
31
+ padding: '10px 52px 10px 10px',
32
32
  flexDirection: 'row',
33
33
  justifyContent: 'flex-start',
34
34
  textAlign: 'left',
@@ -0,0 +1,4 @@
1
+ export declare const CaretDoubleRightSmall: import("@phosphor-icons/react").Icon;
2
+ export declare const CloseSmall: import("@phosphor-icons/react").Icon;
3
+ export declare const Domino: import("@phosphor-icons/react").Icon;
4
+ export declare const Error: import("@phosphor-icons/react").Icon;
@@ -0,0 +1,12 @@
1
+ // Copyright 2025 WebPros International GmbH. All rights reserved.
2
+ // This file is auto-generated by scripts/generate-icons.cjs
3
+ // Do not edit manually. Run "yarn generate:icons" to regenerate.
4
+ import { createIcon, createStaticIcon } from '../utils/createIcon';
5
+ import caretDoubleRightSmallSvg from './svg/caret-double-right-small.svg?raw';
6
+ import closeSmallSvg from './svg/close-small.svg?raw';
7
+ import dominoSvg from './svg/domino.svg?raw';
8
+ import errorSvg from './svg/error.svg?raw';
9
+ export const CaretDoubleRightSmall = createIcon('CaretDoubleRightSmall', caretDoubleRightSmallSvg);
10
+ export const CloseSmall = createIcon('CloseSmall', closeSmallSvg);
11
+ export const Domino = createIcon('Domino', dominoSvg);
12
+ export const Error = createStaticIcon('Error', errorSvg);
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // Copyright 2025 WebPros International GmbH. All rights reserved.
3
- import Grid from '@mui/material/Grid2/Grid2';
3
+ import Grid from '@mui/material/Grid';
4
4
  import { ColorItem } from '@storybook/addon-docs/blocks';
5
5
  import { LegacyDarkTokensDefault } from '../tokens/legacyColors';
6
6
  export const AdditionalColorPalette = () => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // Copyright 2025 WebPros International GmbH. All rights reserved.
3
- import Grid from '@mui/material/Grid2/Grid2';
3
+ import Grid from '@mui/material/Grid';
4
4
  import { ColorItem } from '@storybook/addon-docs/blocks';
5
5
  import { LegacyDarkTokensDefault, LegacyLightTokensDefault, } from '../tokens/legacyColors';
6
6
  export const CustomColorPalette = ({ mode }) => {
@@ -319,7 +319,7 @@ export const DarkStateLayers = {
319
319
  opacity08: 'rgba(86, 150, 206, 0.08)',
320
320
  opacity12: 'rgba(86, 150, 206, 0.12)',
321
321
  opacity16: 'rgba(86, 150, 206, 0.16)',
322
- opacity28: 'rgba(86, 150, 206, 0.2)',
322
+ opacity28: 'rgba(86, 150, 206, 0.28)',
323
323
  opacity48: 'rgba(86, 150, 206, 0.48)',
324
324
  },
325
325
  success: {
@@ -780,6 +780,20 @@ export const DarkInverseStateLayers = {
780
780
  opacity28: 'rgba(191, 197, 202, 0.28)',
781
781
  opacity38: 'rgba(191, 197, 202, 0.38)',
782
782
  },
783
+ info: {
784
+ opacity08: 'rgba(71, 189, 243, 0.08)',
785
+ opacity12: 'rgba(71, 189, 243, 0.12)',
786
+ opacity16: 'rgba(71, 189, 243, 0.2)',
787
+ opacity28: 'rgba(71, 189, 243, 0.28)',
788
+ opacity38: 'rgba(68, 119, 187, 0.38)',
789
+ },
790
+ warning: {
791
+ opacity08: 'rgba(242, 154, 66, 0.08)',
792
+ opacity12: 'rgba(242, 154, 66, 0.12)',
793
+ opacity16: 'rgba(242, 154, 66, 0.2)',
794
+ opacity28: 'rgba(242, 154, 66, 0.28)',
795
+ opacity38: 'rgba(242, 154, 66, 0.38)',
796
+ },
783
797
  },
784
798
  };
785
799
  export const DarkSchemesGenerated = {
@@ -1025,7 +1039,7 @@ export const DarkStateLayersGenerated = {
1025
1039
  'stateLayers.status.info.opacity08': { r: 86, g: 150, b: 206, a: 0.08 },
1026
1040
  'stateLayers.status.info.opacity12': { r: 86, g: 150, b: 206, a: 0.12 },
1027
1041
  'stateLayers.status.info.opacity16': { r: 86, g: 150, b: 206, a: 0.16 },
1028
- 'stateLayers.status.info.opacity28': { r: 86, g: 150, b: 206, a: 0.2 },
1042
+ 'stateLayers.status.info.opacity28': { r: 86, g: 150, b: 206, a: 0.28 },
1029
1043
  'stateLayers.status.info.opacity48': { r: 86, g: 150, b: 206, a: 0.48 },
1030
1044
  'stateLayers.status.success.opacity08': { r: 110, g: 187, b: 114, a: 0.08 },
1031
1045
  'stateLayers.status.success.opacity12': { r: 110, g: 187, b: 114, a: 0.12 },
@@ -1395,4 +1409,14 @@ export const DarkInverseStateLayersGenerated = {
1395
1409
  'inverseStateLayers.status.onUndefinedContainer.opacity16': { r: 191, g: 197, b: 202, a: 0.16 },
1396
1410
  'inverseStateLayers.status.onUndefinedContainer.opacity28': { r: 191, g: 197, b: 202, a: 0.28 },
1397
1411
  'inverseStateLayers.status.onUndefinedContainer.opacity38': { r: 191, g: 197, b: 202, a: 0.38 },
1412
+ 'inverseStateLayers.status.info.opacity08': { r: 71, g: 189, b: 243, a: 0.08 },
1413
+ 'inverseStateLayers.status.info.opacity12': { r: 71, g: 189, b: 243, a: 0.12 },
1414
+ 'inverseStateLayers.status.info.opacity16': { r: 71, g: 189, b: 243, a: 0.2 },
1415
+ 'inverseStateLayers.status.info.opacity28': { r: 71, g: 189, b: 243, a: 0.28 },
1416
+ 'inverseStateLayers.status.info.opacity38': { r: 68, g: 119, b: 187, a: 0.38 },
1417
+ 'inverseStateLayers.status.warning.opacity08': { r: 242, g: 154, b: 66, a: 0.08 },
1418
+ 'inverseStateLayers.status.warning.opacity12': { r: 242, g: 154, b: 66, a: 0.12 },
1419
+ 'inverseStateLayers.status.warning.opacity16': { r: 242, g: 154, b: 66, a: 0.2 },
1420
+ 'inverseStateLayers.status.warning.opacity28': { r: 242, g: 154, b: 66, a: 0.28 },
1421
+ 'inverseStateLayers.status.warning.opacity38': { r: 242, g: 154, b: 66, a: 0.38 },
1398
1422
  };
@@ -319,7 +319,7 @@ export const LightStateLayers = {
319
319
  opacity08: 'rgba(33, 110, 172, 0.08)',
320
320
  opacity12: 'rgba(33, 110, 172, 0.12)',
321
321
  opacity16: 'rgba(33, 110, 172, 0.16)',
322
- opacity28: 'rgba(33, 110, 172, 0.2)',
322
+ opacity28: 'rgba(33, 110, 172, 0.28)',
323
323
  opacity48: 'rgba(33, 110, 172, 0.48)',
324
324
  },
325
325
  success: {
@@ -536,28 +536,28 @@ export const LightStateLayers = {
536
536
  },
537
537
  stateLayers: {
538
538
  basePrimary: {
539
- opacity08: 'rgba(255, 255, 255, 0.08)',
540
- opacity12: 'rgba(255, 255, 255, 0.12)',
541
- opacity16: 'rgba(255, 255, 255, 0.2)',
542
- opacity64: 'rgba(255, 255, 255, 0.64)',
539
+ opacity08: 'rgba(14, 9, 0, 0.08)',
540
+ opacity12: 'rgba(14, 9, 0, 0.12)',
541
+ opacity16: 'rgba(14, 9, 0, 0.2)',
542
+ opacity64: 'rgba(14, 9, 0, 0.64)',
543
543
  },
544
544
  surfacesOnSurface: {
545
- opacity08: 'rgba(255, 255, 255, 0.08)',
546
- opacity12: 'rgba(255, 255, 255, 0.12)',
547
- opacity16: 'rgba(255, 255, 255, 0.16)',
548
- opacity28: 'rgba(255, 255, 255, 0.28)',
549
- opacity38: 'rgba(255, 255, 255, 0.38)',
550
- opacity48: 'rgba(255, 255, 255, 0.48)',
551
- opacity64: 'rgba(255, 255, 255, 0.64)',
552
- opacity10: 'rgba(255, 255, 255, 0.1)',
545
+ opacity08: 'rgba(14, 9, 0, 0.08)',
546
+ opacity12: 'rgba(14, 9, 0, 0.12)',
547
+ opacity16: 'rgba(14, 9, 0, 0.16)',
548
+ opacity28: 'rgba(14, 9, 0, 0.28)',
549
+ opacity38: 'rgba(14, 9, 0, 0.38)',
550
+ opacity48: 'rgba(14, 9, 0, 0.48)',
551
+ opacity64: 'rgba(14, 9, 0, 0.64)',
552
+ opacity10: 'rgba(14, 9, 0, 0.1)',
553
553
  },
554
554
  surfacesOnSurfaceVariant: {
555
- opacity08: 'rgba(255, 255, 255, 0.08)',
556
- opacity12: 'rgba(255, 255, 255, 0.12)',
557
- opacity16: 'rgba(255, 255, 255, 0.16)',
558
- opacity28: 'rgba(255, 255, 255, 0.28)',
559
- opacity48: 'rgba(255, 255, 255, 0.48)',
560
- opacity64: 'rgba(255, 255, 255, 0.64)',
555
+ opacity08: 'rgba(14, 9, 0, 0.08)',
556
+ opacity12: 'rgba(14, 9, 0, 0.12)',
557
+ opacity16: 'rgba(14, 9, 0, 0.16)',
558
+ opacity28: 'rgba(14, 9, 0, 0.28)',
559
+ opacity48: 'rgba(14, 9, 0, 0.48)',
560
+ opacity64: 'rgba(14, 9, 0, 0.64)',
561
561
  },
562
562
  },
563
563
  };
@@ -780,6 +780,20 @@ export const LightInverseStateLayers = {
780
780
  opacity28: 'rgba(206, 211, 214, 0.28)',
781
781
  opacity38: 'rgba(206, 211, 214, 0.38)',
782
782
  },
783
+ info: {
784
+ opacity08: 'rgba(107, 180, 239, 0.08)',
785
+ opacity12: 'rgba(107, 180, 239, 0.12)',
786
+ opacity16: 'rgba(107, 180, 239, 0.2)',
787
+ opacity28: 'rgba(107, 180, 239, 0.28)',
788
+ opacity38: 'rgba(107, 180, 239, 0.38)',
789
+ },
790
+ warning: {
791
+ opacity08: 'rgba(222, 144, 66, 0.08)',
792
+ opacity12: 'rgba(222, 144, 66, 0.12)',
793
+ opacity16: 'rgba(222, 144, 66, 0.2)',
794
+ opacity28: 'rgba(222, 144, 66, 0.28)',
795
+ opacity38: 'rgba(222, 144, 66, 0.38)',
796
+ },
783
797
  },
784
798
  };
785
799
  export const LightSchemesGenerated = {
@@ -1025,7 +1039,7 @@ export const LightStateLayersGenerated = {
1025
1039
  'stateLayers.status.info.opacity08': { r: 33, g: 110, b: 172, a: 0.08 },
1026
1040
  'stateLayers.status.info.opacity12': { r: 33, g: 110, b: 172, a: 0.12 },
1027
1041
  'stateLayers.status.info.opacity16': { r: 33, g: 110, b: 172, a: 0.16 },
1028
- 'stateLayers.status.info.opacity28': { r: 33, g: 110, b: 172, a: 0.2 },
1042
+ 'stateLayers.status.info.opacity28': { r: 33, g: 110, b: 172, a: 0.28 },
1029
1043
  'stateLayers.status.info.opacity48': { r: 33, g: 110, b: 172, a: 0.48 },
1030
1044
  'stateLayers.status.success.opacity08': { r: 67, g: 125, b: 70, a: 0.08 },
1031
1045
  'stateLayers.status.success.opacity12': { r: 67, g: 125, b: 70, a: 0.12 },
@@ -1174,54 +1188,24 @@ export const LightStateLayersGenerated = {
1174
1188
  'stateLayers.surfaces.surfaceDim.opacity12': { r: 206, g: 208, b: 224, a: 0.12 },
1175
1189
  'stateLayers.surfaces.surfaceDim.opacity16': { r: 206, g: 208, b: 224, a: 0.16 },
1176
1190
  'stateLayers.surfaces.surfaceDim.opacity10': { r: 206, g: 208, b: 224, a: 0.1 },
1177
- 'stateLayers.stateLayers.basePrimary.opacity08': { r: 255, g: 255, b: 255, a: 0.08 },
1178
- 'stateLayers.stateLayers.basePrimary.opacity12': { r: 255, g: 255, b: 255, a: 0.12 },
1179
- 'stateLayers.stateLayers.basePrimary.opacity16': { r: 255, g: 255, b: 255, a: 0.2 },
1180
- 'stateLayers.stateLayers.basePrimary.opacity64': { r: 255, g: 255, b: 255, a: 0.64 },
1181
- 'stateLayers.stateLayers.surfacesOnSurface.opacity08': { r: 255, g: 255, b: 255, a: 0.08 },
1182
- 'stateLayers.stateLayers.surfacesOnSurface.opacity12': { r: 255, g: 255, b: 255, a: 0.12 },
1183
- 'stateLayers.stateLayers.surfacesOnSurface.opacity16': { r: 255, g: 255, b: 255, a: 0.16 },
1184
- 'stateLayers.stateLayers.surfacesOnSurface.opacity28': { r: 255, g: 255, b: 255, a: 0.28 },
1185
- 'stateLayers.stateLayers.surfacesOnSurface.opacity38': { r: 255, g: 255, b: 255, a: 0.38 },
1186
- 'stateLayers.stateLayers.surfacesOnSurface.opacity48': { r: 255, g: 255, b: 255, a: 0.48 },
1187
- 'stateLayers.stateLayers.surfacesOnSurface.opacity64': { r: 255, g: 255, b: 255, a: 0.64 },
1188
- 'stateLayers.stateLayers.surfacesOnSurface.opacity10': { r: 255, g: 255, b: 255, a: 0.1 },
1189
- 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity08': {
1190
- r: 255,
1191
- g: 255,
1192
- b: 255,
1193
- a: 0.08,
1194
- },
1195
- 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity12': {
1196
- r: 255,
1197
- g: 255,
1198
- b: 255,
1199
- a: 0.12,
1200
- },
1201
- 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity16': {
1202
- r: 255,
1203
- g: 255,
1204
- b: 255,
1205
- a: 0.16,
1206
- },
1207
- 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity28': {
1208
- r: 255,
1209
- g: 255,
1210
- b: 255,
1211
- a: 0.28,
1212
- },
1213
- 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity48': {
1214
- r: 255,
1215
- g: 255,
1216
- b: 255,
1217
- a: 0.48,
1218
- },
1219
- 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity64': {
1220
- r: 255,
1221
- g: 255,
1222
- b: 255,
1223
- a: 0.64,
1224
- },
1191
+ 'stateLayers.stateLayers.basePrimary.opacity08': { r: 14, g: 9, b: 0, a: 0.08 },
1192
+ 'stateLayers.stateLayers.basePrimary.opacity12': { r: 14, g: 9, b: 0, a: 0.12 },
1193
+ 'stateLayers.stateLayers.basePrimary.opacity16': { r: 14, g: 9, b: 0, a: 0.2 },
1194
+ 'stateLayers.stateLayers.basePrimary.opacity64': { r: 14, g: 9, b: 0, a: 0.64 },
1195
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity08': { r: 14, g: 9, b: 0, a: 0.08 },
1196
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity12': { r: 14, g: 9, b: 0, a: 0.12 },
1197
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity16': { r: 14, g: 9, b: 0, a: 0.16 },
1198
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity28': { r: 14, g: 9, b: 0, a: 0.28 },
1199
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity38': { r: 14, g: 9, b: 0, a: 0.38 },
1200
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity48': { r: 14, g: 9, b: 0, a: 0.48 },
1201
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity64': { r: 14, g: 9, b: 0, a: 0.64 },
1202
+ 'stateLayers.stateLayers.surfacesOnSurface.opacity10': { r: 14, g: 9, b: 0, a: 0.1 },
1203
+ 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity08': { r: 14, g: 9, b: 0, a: 0.08 },
1204
+ 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity12': { r: 14, g: 9, b: 0, a: 0.12 },
1205
+ 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity16': { r: 14, g: 9, b: 0, a: 0.16 },
1206
+ 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity28': { r: 14, g: 9, b: 0, a: 0.28 },
1207
+ 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity48': { r: 14, g: 9, b: 0, a: 0.48 },
1208
+ 'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity64': { r: 14, g: 9, b: 0, a: 0.64 },
1225
1209
  };
1226
1210
  export const LightInverseSchemesGenerated = {
1227
1211
  'inverseSchemes.surfaces.surface': { r: 49, g: 48, b: 54, a: 1 },
@@ -1395,4 +1379,14 @@ export const LightInverseStateLayersGenerated = {
1395
1379
  'inverseStateLayers.status.onUndefinedContainer.opacity16': { r: 206, g: 211, b: 214, a: 0.16 },
1396
1380
  'inverseStateLayers.status.onUndefinedContainer.opacity28': { r: 206, g: 211, b: 214, a: 0.28 },
1397
1381
  'inverseStateLayers.status.onUndefinedContainer.opacity38': { r: 206, g: 211, b: 214, a: 0.38 },
1382
+ 'inverseStateLayers.status.info.opacity08': { r: 107, g: 180, b: 239, a: 0.08 },
1383
+ 'inverseStateLayers.status.info.opacity12': { r: 107, g: 180, b: 239, a: 0.12 },
1384
+ 'inverseStateLayers.status.info.opacity16': { r: 107, g: 180, b: 239, a: 0.2 },
1385
+ 'inverseStateLayers.status.info.opacity28': { r: 107, g: 180, b: 239, a: 0.28 },
1386
+ 'inverseStateLayers.status.info.opacity38': { r: 107, g: 180, b: 239, a: 0.38 },
1387
+ 'inverseStateLayers.status.warning.opacity08': { r: 222, g: 144, b: 66, a: 0.08 },
1388
+ 'inverseStateLayers.status.warning.opacity12': { r: 222, g: 144, b: 66, a: 0.12 },
1389
+ 'inverseStateLayers.status.warning.opacity16': { r: 222, g: 144, b: 66, a: 0.2 },
1390
+ 'inverseStateLayers.status.warning.opacity28': { r: 222, g: 144, b: 66, a: 0.28 },
1391
+ 'inverseStateLayers.status.warning.opacity38': { r: 222, g: 144, b: 66, a: 0.38 },
1398
1392
  };
@@ -168,6 +168,20 @@ export type InverseStateLayers = {
168
168
  opacity28: string;
169
169
  opacity38: string;
170
170
  };
171
+ info: {
172
+ opacity08: string;
173
+ opacity12: string;
174
+ opacity16: string;
175
+ opacity28: string;
176
+ opacity38: string;
177
+ };
178
+ warning: {
179
+ opacity08: string;
180
+ opacity12: string;
181
+ opacity16: string;
182
+ opacity28: string;
183
+ opacity38: string;
184
+ };
171
185
  };
172
186
  };
173
187
  export type InverseStateLayersKey = `inverseStateLayers.${RecursiveKeyOf<InverseStateLayers>}`;
@@ -0,0 +1,12 @@
1
+ import { Icon, IconWeight, IconProps } from '@phosphor-icons/react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ type MuiColorToken = 'inherit' | 'primary' | 'secondary' | 'error' | 'warning' | 'info' | 'success' | 'action' | 'disabled';
4
+ export type CustomIconProps = Omit<IconProps, 'color'> & {
5
+ color?: string | MuiColorToken;
6
+ sx?: SxProps<Theme>;
7
+ };
8
+ export type CustomIcon = Icon;
9
+ type WeightPaths = Partial<Record<IconWeight, string>>;
10
+ export declare function createStaticIcon(displayName: string, svg: string): CustomIcon;
11
+ export declare function createIcon(displayName: string, svgOrPath: string | WeightPaths): CustomIcon;
12
+ export {};
@@ -0,0 +1,94 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ // Copyright 2025 WebPros International GmbH. All rights reserved.
4
+ import { forwardRef } from 'react';
5
+ import { SSRBase } from '@phosphor-icons/react/dist/ssr';
6
+ import { styled } from '@mui/material/styles';
7
+ import Box from '@mui/material/Box';
8
+ function extractPath(svg) {
9
+ const cleanedSvg = svg.replace(/fill="[^"]*"/g, '');
10
+ const match = cleanedSvg.match(/d="([^"]+)"/);
11
+ if (!(match === null || match === void 0 ? void 0 : match[1])) {
12
+ throw new Error('createIcon: No path found in SVG. Make sure SVG contains a <path d="..."> element.');
13
+ }
14
+ return match[1];
15
+ }
16
+ const StyledIconWrapper = styled('span', {
17
+ shouldForwardProp: (prop) => prop !== 'iconColor',
18
+ })(({ theme, iconColor }) => {
19
+ if (!iconColor || iconColor === 'inherit') {
20
+ return { display: 'inline-flex', color: 'inherit' };
21
+ }
22
+ const paletteColors = [
23
+ 'primary',
24
+ 'secondary',
25
+ 'error',
26
+ 'warning',
27
+ 'info',
28
+ 'success',
29
+ ];
30
+ if (paletteColors.includes(iconColor)) {
31
+ return {
32
+ display: 'inline-flex',
33
+ color: theme.palette[iconColor].main,
34
+ };
35
+ }
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
+ return { display: 'inline-flex', color: iconColor };
43
+ });
44
+ function extractPathsData(svg) {
45
+ var _a, _b;
46
+ const pathRegex = /<path[^>]*d="([^"]+)"[^>]*\/?>/g;
47
+ const paths = [];
48
+ let match;
49
+ while ((match = pathRegex.exec(svg)) !== null) {
50
+ const fullMatch = match[0];
51
+ const d = (_a = match[1]) !== null && _a !== void 0 ? _a : '';
52
+ const fillMatch = fullMatch.match(/fill="([^"]*)"/);
53
+ const fill = (_b = fillMatch === null || fillMatch === void 0 ? void 0 : fillMatch[1]) !== null && _b !== void 0 ? _b : 'currentColor';
54
+ paths.push({ d, fill });
55
+ }
56
+ return paths;
57
+ }
58
+ export function createStaticIcon(displayName, svg) {
59
+ const pathsData = extractPathsData(svg);
60
+ const IconComponent = forwardRef((props, ref) => {
61
+ const _a = props, { sx, size = 24, variant = 'outline', color } = _a, rest = __rest(_a, ["sx", "size", "variant", "color"]);
62
+ const paths = pathsData.map((p, i) => {
63
+ if (variant === 'outline') {
64
+ if (i === 0) {
65
+ return (_jsx("path", { d: p.d, fill: "transparent", stroke: "currentColor", strokeWidth: 8 }, i));
66
+ }
67
+ return _jsx("path", { d: p.d, fill: "currentColor" }, i);
68
+ }
69
+ return _jsx("path", { d: p.d, fill: p.fill }, i);
70
+ });
71
+ return (_jsx(Box, { component: "span", ref: ref, sx: Object.assign({ display: 'inline-flex', verticalAlign: 'middle', width: size, height: size }, sx), children: _jsx(StyledIconWrapper, { iconColor: variant === 'outline' ? color : undefined, children: _jsx("svg", Object.assign({ viewBox: "0 0 256 256", width: "100%", height: "100%" }, rest, { children: paths })) }) }));
72
+ });
73
+ IconComponent.displayName = displayName;
74
+ return IconComponent;
75
+ }
76
+ export function createIcon(displayName, svgOrPath) {
77
+ const weights = new Map();
78
+ if (typeof svgOrPath === 'string') {
79
+ const pathData = svgOrPath.includes('<svg') ? extractPath(svgOrPath) : svgOrPath;
80
+ weights.set('regular', _jsx("path", { d: pathData }));
81
+ }
82
+ else {
83
+ Object.entries(svgOrPath).forEach(([weight, pathOrSvg]) => {
84
+ const pathData = pathOrSvg.includes('<svg') ? extractPath(pathOrSvg) : pathOrSvg;
85
+ weights.set(weight, _jsx("path", { d: pathData }));
86
+ });
87
+ }
88
+ const IconComponent = forwardRef((props, ref) => {
89
+ const _a = props, { color, sx } = _a, rest = __rest(_a, ["color", "sx"]);
90
+ return (_jsx(Box, { component: "span", sx: Object.assign({ display: 'inline-flex', verticalAlign: 'middle' }, sx), children: _jsx(StyledIconWrapper, { iconColor: color, children: _jsx(SSRBase, Object.assign({ ref: ref }, rest, { color: "currentColor", weights: weights })) }) }));
91
+ });
92
+ IconComponent.displayName = displayName;
93
+ return IconComponent;
94
+ }
@@ -1,9 +1,9 @@
1
- import { ThemeOptions } from '@mui/material';
1
+ import { PaletteColor, PaletteColorOptions, ThemeOptions } from '@mui/material';
2
2
  import { ThemeMode } from '../tokens/ThemeMode';
3
3
  import { ThemeScheme } from '../tokens/ThemeScheme';
4
4
  import { Schemes, StateLayers } from '../tokens/colors';
5
5
  import { AdditionalColorTone } from '../tokens/legacyColors/Tone';
6
- declare module '@mui/material/styles/createPalette' {
6
+ declare module '@mui/material/styles' {
7
7
  interface M3Palette {
8
8
  onPrimary: PaletteColor;
9
9
  primaryContainer: PaletteColor;
@@ -7,7 +7,7 @@ declare module '@mui/material/styles' {
7
7
  interface TypographyVariantsOptions extends TypescaleTypographyVariants {
8
8
  }
9
9
  }
10
- declare module '@mui/material/styles/createTheme' {
10
+ declare module '@mui/material/styles' {
11
11
  interface Theme {
12
12
  colors: {
13
13
  schemes: Schemes;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webpros/mui-theme",
3
- "description": "MUI v6 theme for WebPros products",
4
- "version": "0.2.0",
3
+ "description": "MUI v7 theme for WebPros products",
4
+ "version": "0.3.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,6 +20,10 @@
20
20
  ".": {
21
21
  "import": "./dist/src/index.js",
22
22
  "types": "./dist/src/index.d.ts"
23
+ },
24
+ "./icons": {
25
+ "import": "./dist/src/icons/index.js",
26
+ "types": "./dist/src/icons/index.d.ts"
23
27
  }
24
28
  },
25
29
  "type": "module",
@@ -43,15 +47,16 @@
43
47
  "prettier:test": "prettier --check \"**/*.{ts,tsx}\"",
44
48
  "prettier:write": "prettier --write \"**/*.{ts,tsx}\"",
45
49
  "typecheck": "tsc --noEmit",
46
- "extract-tokens": "node tools/extractM3Tokens.js"
50
+ "extract-tokens": "node tools/extractM3Tokens.js",
51
+ "generate:icons": "node scripts/generate-icons.cjs"
47
52
  },
48
53
  "peerDependencies": {
49
54
  "@emotion/react": "^11.14.0",
50
55
  "@emotion/styled": "^11.14.1",
51
56
  "@fontsource/roboto": "^5.2.6",
52
57
  "@material/material-color-utilities": "^0.3.0",
53
- "@mui/material": "^6.4.0",
54
- "@mui/utils": "^6.4.0",
58
+ "@mui/material": "^7.3.6",
59
+ "@mui/utils": "^7.3.6",
55
60
  "@mui/x-data-grid": "^7.29.0",
56
61
  "@mui/x-date-pickers": "^7.29.0",
57
62
  "@phosphor-icons/react": "^2.1.0",
@@ -67,8 +72,8 @@
67
72
  "@eslint/js": "^9.38.0",
68
73
  "@fontsource/roboto": "^5.2.6",
69
74
  "@material/material-color-utilities": "^0.3.0",
70
- "@mui/material": "^6.4.0",
71
- "@mui/utils": "^6.4.0",
75
+ "@mui/material": "^7.3.6",
76
+ "@mui/utils": "^7.3.6",
72
77
  "@mui/x-data-grid": "^7.29.0",
73
78
  "@mui/x-date-pickers": "^7.29.0",
74
79
  "@phosphor-icons/react": "^2.1.0",
@@ -80,8 +85,8 @@
80
85
  "@storybook/react-vite": "^9.1.16",
81
86
  "@stylistic/eslint-plugin": "^5.5.0",
82
87
  "@types/node": "^24.8.1",
83
- "@types/react": "^19.2.2",
84
- "@types/react-dom": "^19.2.2",
88
+ "@types/react": "18.3.1",
89
+ "@types/react-dom": "^18.3.1",
85
90
  "@vitejs/plugin-react": "^5.0.4",
86
91
  "eslint": "^9.38.0",
87
92
  "eslint-config-prettier": "^10.1.8",
@@ -112,5 +117,8 @@
112
117
  "extends": [
113
118
  "plugin:storybook/recommended"
114
119
  ]
120
+ },
121
+ "resolutions": {
122
+ "react-is": "^18.3.1"
115
123
  }
116
124
  }