@webpros/mui-theme 0.2.0 → 0.3.1
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 +23 -1
- package/dist/package.json +17 -9
- package/dist/src/components/data-display/Table/Table.theme.js +5 -6
- package/dist/src/components/feedback/Alert/Alert.theme.js +1 -0
- package/dist/src/components/feedback/Dialog/Dialog.js +0 -1
- package/dist/src/components/feedback/Dialog/Dialog.theme.d.ts +5 -0
- package/dist/src/components/feedback/Dialog/Dialog.theme.js +43 -14
- package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.js +20 -12
- package/dist/src/components/feedback/Snackbar/Snackbar.theme.js +4 -0
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/components/index.js +0 -2
- package/dist/src/components/inputs/Button/Button.theme.d.ts +1 -1
- package/dist/src/components/inputs/Button/Button.theme.js +3 -0
- package/dist/src/components/inputs/IconButton/IconButton.theme.js +3 -0
- package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.js +1 -1
- package/dist/src/components/inputs/TimePicker/TimePicker.theme.js +2 -2
- package/dist/src/components/inputs/ToggleButton/ToggleButton.theme.d.ts +1 -1
- package/dist/src/components/inputs/ToggleButton/ToggleButton.theme.js +14 -14
- package/dist/src/components/inputs/ToggleButtonGroup/ToggleButtonGroup.theme.js +2 -9
- package/dist/src/components/navigation/Tabs/Tabs.theme.js +1 -1
- package/dist/src/constants.js +2 -2
- package/dist/src/icons/index.d.ts +4 -0
- package/dist/src/icons/index.js +12 -0
- package/dist/src/style/custom-color-palette.js +1 -1
- package/dist/src/tokens/colors/Dark.js +26 -2
- package/dist/src/tokens/colors/Light.js +62 -68
- package/dist/src/tokens/colors/inverseStateLayers.d.ts +14 -0
- package/dist/src/tokens/index.d.ts +0 -2
- package/dist/src/tokens/legacyColors/LegacyDark.js +0 -10
- package/dist/src/tokens/legacyColors/LegacyLight.js +0 -10
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.d.ts +0 -2
- package/dist/src/tokens/legacyColors/Tone.d.ts +0 -16
- package/dist/src/utils/createIcon.d.ts +12 -0
- package/dist/src/utils/createIcon.js +94 -0
- package/dist/src/utils/getMUIComponents.js +2 -2
- package/dist/src/utils/getMUIPalette.d.ts +3 -72
- package/dist/src/utils/getMUIPalette.js +177 -177
- package/dist/src/utils/getMUIThemeCustoimzationType.d.ts +1 -1
- package/dist/src/utils/getStateLayerColor.d.ts +0 -53
- package/dist/src/utils/getStateLayerColor.js +0 -58
- package/package.json +17 -9
- package/dist/src/components/data-display/DataGrid/DataGrid.d.ts +0 -4
- package/dist/src/components/data-display/DataGrid/DataGrid.js +0 -7
- package/dist/src/components/data-display/DataGrid/DataGrid.theme.d.ts +0 -11
- package/dist/src/components/data-display/DataGrid/DataGrid.theme.js +0 -21
- package/dist/src/components/data-display/DataGrid/index.d.ts +0 -1
- package/dist/src/components/data-display/DataGrid/index.js +0 -2
- package/dist/src/components/data-display/DataGrid/mock-data.d.ts +0 -18
- package/dist/src/components/data-display/DataGrid/mock-data.js +0 -184
- package/dist/src/components/surfaces/Card/Card.d.ts +0 -3
- package/dist/src/components/surfaces/Card/Card.js +0 -4
- package/dist/src/components/surfaces/Card/Card.theme.d.ts +0 -16
- package/dist/src/components/surfaces/Card/Card.theme.js +0 -100
- package/dist/src/components/surfaces/Card/index.d.ts +0 -1
- package/dist/src/components/surfaces/Card/index.js +0 -2
- package/dist/src/style/additional-color-palette.d.ts +0 -1
- package/dist/src/style/additional-color-palette.js +0 -23
- package/dist/src/tokens/legacyColors/additionalColors/additionalColors.d.ts +0 -21
- package/dist/src/tokens/legacyColors/additionalColors/additionalColors.js +0 -2
- package/dist/src/tokens/legacyColors/additionalColors/index.d.ts +0 -2
- package/dist/src/tokens/legacyColors/additionalColors/index.js +0 -6
|
@@ -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.
|
|
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(
|
|
540
|
-
opacity12: 'rgba(
|
|
541
|
-
opacity16: 'rgba(
|
|
542
|
-
opacity64: 'rgba(
|
|
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(
|
|
546
|
-
opacity12: 'rgba(
|
|
547
|
-
opacity16: 'rgba(
|
|
548
|
-
opacity28: 'rgba(
|
|
549
|
-
opacity38: 'rgba(
|
|
550
|
-
opacity48: 'rgba(
|
|
551
|
-
opacity64: 'rgba(
|
|
552
|
-
opacity10: 'rgba(
|
|
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(
|
|
556
|
-
opacity12: 'rgba(
|
|
557
|
-
opacity16: 'rgba(
|
|
558
|
-
opacity28: 'rgba(
|
|
559
|
-
opacity48: 'rgba(
|
|
560
|
-
opacity64: 'rgba(
|
|
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.
|
|
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:
|
|
1178
|
-
'stateLayers.stateLayers.basePrimary.opacity12': { r:
|
|
1179
|
-
'stateLayers.stateLayers.basePrimary.opacity16': { r:
|
|
1180
|
-
'stateLayers.stateLayers.basePrimary.opacity64': { r:
|
|
1181
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity08': { r:
|
|
1182
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity12': { r:
|
|
1183
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity16': { r:
|
|
1184
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity28': { r:
|
|
1185
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity38': { r:
|
|
1186
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity48': { r:
|
|
1187
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity64': { r:
|
|
1188
|
-
'stateLayers.stateLayers.surfacesOnSurface.opacity10': { r:
|
|
1189
|
-
'stateLayers.stateLayers.surfacesOnSurfaceVariant.opacity08': {
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
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>}`;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export type { AdditionalColorKey } from './legacyColors/additionalColors';
|
|
2
|
-
export type { AdditionalColorTone } from './legacyColors/Tone';
|
|
3
1
|
export type { TypescaleTypographyVariants } from './typography';
|
|
4
2
|
export { typographyVariants } from './typography';
|
|
5
3
|
export type { M3ShadowLayer, M3ShadowTokenName, M3ShadowTokens } from './shadows';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
-
import { additionalColors } from '../../tokens/legacyColors/additionalColors';
|
|
3
2
|
// reference
|
|
4
3
|
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=53699-35493&t=pvKyGGnGRUL3kYn8-1
|
|
5
4
|
export const LegacyDarkTokensDefault = {
|
|
@@ -76,13 +75,4 @@ export const LegacyDarkTokensDefault = {
|
|
|
76
75
|
undefinedContainer: '#3D464D',
|
|
77
76
|
onUndefinedContainer: '#E4EBF0',
|
|
78
77
|
supportive: '#8FAAB6',
|
|
79
|
-
// Custom accent colors matching with the theme.
|
|
80
|
-
// Should not be used in MUI components directly (i.e. for setting background/text somewhere) inside customization.
|
|
81
|
-
// Only for outer usage
|
|
82
|
-
// reference -
|
|
83
|
-
// Charts
|
|
84
|
-
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=7648-60043&t=DhlQVfQGF7gEbkuU-0
|
|
85
|
-
// Colors
|
|
86
|
-
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=7648-60043&t=DhlQVfQGF7gEbkuU-0
|
|
87
|
-
additionalColors,
|
|
88
78
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
-
import { additionalColors } from '../../tokens/legacyColors/additionalColors';
|
|
3
2
|
// reference
|
|
4
3
|
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=53699-35493&t=pvKyGGnGRUL3kYn8-1
|
|
5
4
|
export const LegacyLightTokensDefault = {
|
|
@@ -74,13 +73,4 @@ export const LegacyLightTokensDefault = {
|
|
|
74
73
|
undefinedContainer: '#DFE2E4',
|
|
75
74
|
onUndefinedContainer: '#263238',
|
|
76
75
|
supportive: '#546E7A',
|
|
77
|
-
// Custom accent colors matching with the theme.
|
|
78
|
-
// Should not be used in MUI components directly (i.e. for setting background/text somewhere) inside customization.
|
|
79
|
-
// Only for outer usage
|
|
80
|
-
// reference -
|
|
81
|
-
// Charts
|
|
82
|
-
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=7648-60043&t=DhlQVfQGF7gEbkuU-0
|
|
83
|
-
// Colors
|
|
84
|
-
// https://www.figma.com/design/RPLeGa2LdhKElQQ0xIXtSh/WebPros-dashboard?node-id=7648-60043&t=DhlQVfQGF7gEbkuU-0
|
|
85
|
-
additionalColors,
|
|
86
76
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AdditionalColors } from '../../tokens/legacyColors/additionalColors/additionalColors';
|
|
2
1
|
export type ThemeColorTokensLegacy = {
|
|
3
2
|
primary: string;
|
|
4
3
|
onPrimary: string;
|
|
@@ -70,5 +69,4 @@ export type ThemeColorTokensLegacy = {
|
|
|
70
69
|
undefinedContainer: string;
|
|
71
70
|
onUndefinedContainer: string;
|
|
72
71
|
supportive: string;
|
|
73
|
-
additionalColors: AdditionalColors;
|
|
74
72
|
};
|
|
@@ -156,19 +156,3 @@ export declare const ErrorDefault: {
|
|
|
156
156
|
'99': string;
|
|
157
157
|
'100': string;
|
|
158
158
|
};
|
|
159
|
-
export type AdditionalColorTone = {
|
|
160
|
-
50: string;
|
|
161
|
-
100: string;
|
|
162
|
-
200: string;
|
|
163
|
-
300: string;
|
|
164
|
-
400: string;
|
|
165
|
-
500: string;
|
|
166
|
-
600: string;
|
|
167
|
-
700: string;
|
|
168
|
-
800: string;
|
|
169
|
-
900: string;
|
|
170
|
-
A100: string;
|
|
171
|
-
A200: string;
|
|
172
|
-
A400: string;
|
|
173
|
-
A700: string;
|
|
174
|
-
};
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import { getAccordion, getAccordionSummary, getAccordionDetails, getAlert, getAppBar, getBackdrop, getBadge, getBreadcrumbs, getButton,
|
|
1
|
+
import { getAccordion, getAccordionSummary, getAccordionDetails, getAlert, getAppBar, getBackdrop, getBadge, getBreadcrumbs, getButton, getCheckbox, getChip, getCssBaseline, getDivider, getDrawer, getFab, getIconButton, getLink, getList, getListItem, getListItemButton, getListItemIcon, getListItemAvatar, getListSubheader, getMenu, getMenuItem, getPaginationItem, getPaper, getPopover, getSwitch, getTab, getTabs, getTextField, getToggleButton, getToggleButtonGroup, getTooltip, getTypography, getAvatar, getSelect, getInputLabel, getTimePicker, getSnackbar, getCircularProgress, getLinearProgress, getDialog, getTable, getAutocomplete, getInputBase, getSkeleton, getFormLabel, getOutlinedInput, getFormHelperText, getRadio, } from '../components';
|
|
2
2
|
export const getMUIComponents = (theme, _mode) => ({
|
|
3
|
-
components: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
3
|
+
components: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, getCssBaseline(theme)), getBackdrop(theme)), getAccordion(theme)), getAccordionSummary(theme)), getAccordionDetails(theme)), getAlert(theme)), getAppBar(theme)), getAvatar(theme)), getBadge(theme)), getBreadcrumbs(theme)), getSelect()), getTimePicker(theme)), getInputLabel()), getButton(theme)), getCheckbox(theme)), getChip(theme)), getDivider(theme)), getDrawer(theme)), getFab(theme)), getIconButton(theme)), getLink(theme)), getList(theme)), getListItem(theme)), getListItemButton(theme)), getListItemIcon(theme)), getListItemAvatar(theme)), getListSubheader(theme)), getMenu(theme)), getMenuItem(theme)), getPaginationItem(theme)), getPaper(theme)), getPopover(theme)), getSwitch(theme)), getTab(theme)), getTabs(theme)), getTextField(theme)), getToggleButton(theme)), getToggleButtonGroup(theme)), getTooltip(theme)), getTypography(theme)), getSnackbar(theme)), getCircularProgress(theme)), getLinearProgress(theme)), getDialog(theme)), getTable(theme)), getAutocomplete()), getInputBase()), getSkeleton(theme)), getFormLabel()), getOutlinedInput()), getFormHelperText()), getRadio(theme)),
|
|
4
4
|
});
|
|
@@ -1,94 +1,25 @@
|
|
|
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
|
-
|
|
6
|
-
declare module '@mui/material/styles/createPalette' {
|
|
5
|
+
declare module '@mui/material/styles' {
|
|
7
6
|
interface M3Palette {
|
|
8
7
|
onPrimary: PaletteColor;
|
|
9
|
-
primaryContainer: PaletteColor;
|
|
10
8
|
onPrimaryContainer: PaletteColor;
|
|
11
9
|
secondary: PaletteColor;
|
|
12
|
-
onSecondary: PaletteColor;
|
|
13
|
-
secondaryContainer: PaletteColor;
|
|
14
|
-
onSecondaryContainer: PaletteColor;
|
|
15
|
-
tertiary: PaletteColor;
|
|
16
|
-
onTertiary: PaletteColor;
|
|
17
|
-
tertiaryContainer: PaletteColor;
|
|
18
|
-
onTertiaryContainer: PaletteColor;
|
|
19
10
|
onError: PaletteColor;
|
|
20
|
-
errorContainer: PaletteColor;
|
|
21
|
-
onErrorContainer: PaletteColor;
|
|
22
|
-
primaryFixed: PaletteColor;
|
|
23
|
-
primaryFixedDim: PaletteColor;
|
|
24
|
-
onPrimaryFixed: PaletteColor;
|
|
25
|
-
onPrimaryFixedVariant: PaletteColor;
|
|
26
|
-
secondaryFixed: PaletteColor;
|
|
27
|
-
secondaryFixedDim: PaletteColor;
|
|
28
|
-
onSecondaryFixed: PaletteColor;
|
|
29
|
-
onSecondaryFixedVariant: PaletteColor;
|
|
30
|
-
tertiaryFixed: PaletteColor;
|
|
31
|
-
tertiaryFixedDim: PaletteColor;
|
|
32
|
-
onTertiaryFixed: PaletteColor;
|
|
33
|
-
onTertiaryFixedVariant: PaletteColor;
|
|
34
11
|
surface: PaletteColor;
|
|
35
12
|
onSurface: PaletteColor;
|
|
36
13
|
surfaceDim: PaletteColor;
|
|
37
|
-
surfaceBright: PaletteColor;
|
|
38
14
|
surfaceContainerLowest: PaletteColor;
|
|
39
|
-
surfaceContainerLow: PaletteColor;
|
|
40
15
|
surfaceContainer: PaletteColor;
|
|
41
|
-
surfaceContainerHigh: PaletteColor;
|
|
42
|
-
surfaceContainerHighest: PaletteColor;
|
|
43
16
|
onSurfaceVariant: PaletteColor;
|
|
44
|
-
outline: PaletteColor;
|
|
45
|
-
outlineVariant: PaletteColor;
|
|
46
|
-
inversePrimary: PaletteColor;
|
|
47
|
-
inverseSurface: PaletteColor;
|
|
48
|
-
inverseOnSurface: PaletteColor;
|
|
49
|
-
shadow: PaletteColor;
|
|
50
|
-
scrim: PaletteColor;
|
|
51
|
-
onBackground: PaletteColor;
|
|
52
|
-
onInfo: PaletteColor;
|
|
53
|
-
infoContainer: PaletteColor;
|
|
54
|
-
onInfoContainer: PaletteColor;
|
|
55
|
-
onSuccess: PaletteColor;
|
|
56
|
-
successContainer: PaletteColor;
|
|
57
|
-
onSuccessContainer: PaletteColor;
|
|
58
|
-
onWarning: PaletteColor;
|
|
59
|
-
warningContainer: PaletteColor;
|
|
60
|
-
onWarningContainer: PaletteColor;
|
|
61
|
-
undefined: PaletteColor;
|
|
62
|
-
onUndefined: PaletteColor;
|
|
63
|
-
undefinedContainer: PaletteColor;
|
|
64
|
-
onUndefinedContainer: PaletteColor;
|
|
65
17
|
supportive: PaletteColor;
|
|
66
18
|
}
|
|
67
|
-
interface
|
|
68
|
-
red: AdditionalColorTone;
|
|
69
|
-
pink: AdditionalColorTone;
|
|
70
|
-
purple: AdditionalColorTone;
|
|
71
|
-
deepPurple: AdditionalColorTone;
|
|
72
|
-
indigo: AdditionalColorTone;
|
|
73
|
-
blue: AdditionalColorTone;
|
|
74
|
-
lightBlue: AdditionalColorTone;
|
|
75
|
-
cyan: AdditionalColorTone;
|
|
76
|
-
teal: AdditionalColorTone;
|
|
77
|
-
green: AdditionalColorTone;
|
|
78
|
-
lightGreen: AdditionalColorTone;
|
|
79
|
-
lime: AdditionalColorTone;
|
|
80
|
-
yellow: AdditionalColorTone;
|
|
81
|
-
amber: AdditionalColorTone;
|
|
82
|
-
orange: AdditionalColorTone;
|
|
83
|
-
deepOrange: AdditionalColorTone;
|
|
84
|
-
brown: AdditionalColorTone;
|
|
19
|
+
interface Palette extends M3Palette {
|
|
85
20
|
}
|
|
86
21
|
interface M3PaletteOptions extends Record<keyof M3Palette, PaletteColorOptions | StateLayers | Schemes> {
|
|
87
22
|
themeMode: string;
|
|
88
|
-
additional: M3AdditionalColors;
|
|
89
|
-
}
|
|
90
|
-
interface Palette extends M3Palette {
|
|
91
|
-
additional: M3AdditionalColors;
|
|
92
23
|
}
|
|
93
24
|
interface PaletteOptions extends M3PaletteOptions {
|
|
94
25
|
}
|