@webpros/mui-theme 0.1.6 → 0.2.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 +6 -4
- package/dist/src/components/data-display/Avatar/Avatar.theme.js +11 -8
- package/dist/src/components/data-display/Badge/Badge.theme.d.ts +4 -1
- package/dist/src/components/data-display/Badge/Badge.theme.js +216 -55
- package/dist/src/components/data-display/Chip/Chip.theme.d.ts +17 -3
- package/dist/src/components/data-display/Chip/Chip.theme.js +133 -477
- package/dist/src/components/data-display/Chip/get-chip-colors-map.d.ts +42 -0
- package/dist/src/components/data-display/Chip/get-chip-colors-map.js +253 -0
- package/dist/src/components/data-display/Divider/Divider.theme.d.ts +6 -1
- package/dist/src/components/data-display/Divider/Divider.theme.js +60 -3
- package/dist/src/components/data-display/List/List.theme.d.ts +1 -1
- package/dist/src/components/data-display/List/List.theme.js +1 -1
- package/dist/src/components/data-display/ListItem/ListItem.theme.d.ts +1 -1
- package/dist/src/components/data-display/ListItem/ListItem.theme.js +16 -8
- package/dist/src/components/data-display/ListItemAvatar/ListItemAvatar.theme.js +1 -2
- package/dist/src/components/data-display/ListItemButton/ListItemButton.theme.d.ts +0 -5
- package/dist/src/components/data-display/ListItemButton/ListItemButton.theme.js +14 -48
- package/dist/src/components/data-display/ListItemIcon/ListItemIcon.theme.js +4 -4
- package/dist/src/components/data-display/ListSubheader/ListSubheader.theme.d.ts +1 -1
- package/dist/src/components/data-display/ListSubheader/ListSubheader.theme.js +2 -5
- package/dist/src/components/data-display/Skeleton/Skeleton.d.ts +3 -0
- package/dist/src/components/data-display/Skeleton/Skeleton.js +4 -0
- package/dist/src/components/data-display/Skeleton/Skeleton.theme.d.ts +15 -0
- package/dist/src/components/data-display/Skeleton/Skeleton.theme.js +31 -0
- package/dist/src/components/data-display/Skeleton/index.d.ts +1 -0
- package/dist/src/components/data-display/Skeleton/index.js +2 -0
- package/dist/src/components/data-display/Tooltip/Tooltip.theme.js +7 -9
- package/dist/src/components/data-display/Typography/Typography.theme.d.ts +19 -26
- package/dist/src/components/data-display/Typography/Typography.theme.js +7 -163
- package/dist/src/components/feedback/Alert/Alert.theme.d.ts +12 -0
- package/dist/src/components/feedback/Alert/Alert.theme.js +60 -45
- package/dist/src/components/feedback/CircularProgress/CircularProgress.theme.d.ts +6 -1
- package/dist/src/components/feedback/CircularProgress/CircularProgress.theme.js +49 -8
- package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.d.ts +6 -1
- package/dist/src/components/feedback/LinearProgress/LinearProgress.theme.js +83 -9
- package/dist/src/components/feedback/Snackbar/Snackbar.theme.d.ts +4 -4
- package/dist/src/components/feedback/Snackbar/Snackbar.theme.js +7 -3
- package/dist/src/components/index.d.ts +10 -1
- package/dist/src/components/index.js +10 -1
- package/dist/src/components/inputs/Autocomplete/Autocomplete.theme.d.ts +1 -1
- package/dist/src/components/inputs/Autocomplete/Autocomplete.theme.js +23 -51
- package/dist/src/components/inputs/Autocomplete/components/AutocompleteCaretDownIcon.d.ts +1 -0
- package/dist/src/components/inputs/Autocomplete/components/{AutocompletePopupIcon.js → AutocompleteCaretDownIcon.js} +1 -1
- package/dist/src/components/inputs/Autocomplete/components/AutocompleteXIcon.d.ts +1 -0
- package/dist/src/components/inputs/Autocomplete/components/AutocompleteXIcon.js +4 -0
- package/dist/src/components/inputs/Button/Button.theme.d.ts +4 -0
- package/dist/src/components/inputs/Button/Button.theme.js +93 -226
- package/dist/src/components/inputs/Button/get-button-colors-map.d.ts +24 -0
- package/dist/src/components/inputs/Button/get-button-colors-map.js +211 -0
- package/dist/src/components/inputs/Checkbox/Checkbox.theme.d.ts +7 -2
- package/dist/src/components/inputs/Checkbox/Checkbox.theme.js +57 -7
- package/dist/src/components/inputs/Fab/Fab.theme.d.ts +5 -9
- package/dist/src/components/inputs/Fab/Fab.theme.js +27 -98
- package/dist/src/components/inputs/FormHelperText/FormHelperText.d.ts +2 -0
- package/dist/src/components/inputs/FormHelperText/FormHelperText.js +3 -0
- package/dist/src/components/inputs/FormHelperText/FormHelperText.theme.d.ts +7 -0
- package/dist/src/components/inputs/FormHelperText/FormHelperText.theme.js +8 -0
- package/dist/src/components/inputs/FormHelperText/index.d.ts +1 -0
- package/dist/src/components/inputs/FormHelperText/index.js +2 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.d.ts +2 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.js +3 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.theme.d.ts +7 -0
- package/dist/src/components/inputs/FormLabel/FormLabel.theme.js +8 -0
- package/dist/src/components/inputs/FormLabel/index.d.ts +1 -0
- package/dist/src/components/inputs/FormLabel/index.js +2 -0
- package/dist/src/components/inputs/IconButton/IconButton.theme.d.ts +3 -2
- package/dist/src/components/inputs/IconButton/IconButton.theme.js +90 -95
- package/dist/src/components/inputs/InputBase/InputBase.theme.d.ts +9 -26
- package/dist/src/components/inputs/InputBase/InputBase.theme.js +2 -64
- package/dist/src/components/inputs/InputLabel/InputLabel.theme.d.ts +7 -4
- package/dist/src/components/inputs/InputLabel/InputLabel.theme.js +26 -12
- package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.d.ts +8 -0
- package/dist/src/components/inputs/OutlinedInput/OutlinedInput.theme.js +67 -0
- package/dist/src/components/inputs/OutlinedInput/index.d.ts +1 -0
- package/dist/src/components/inputs/OutlinedInput/index.js +2 -0
- package/dist/src/components/inputs/Radio/Radio.d.ts +4 -0
- package/dist/src/components/inputs/Radio/Radio.js +4 -0
- package/dist/src/components/inputs/Radio/Radio.theme.d.ts +11 -0
- package/dist/src/components/inputs/Radio/Radio.theme.js +35 -0
- package/dist/src/components/inputs/Radio/index.d.ts +1 -0
- package/dist/src/components/{navigation/TabList → inputs/Radio}/index.js +1 -1
- package/dist/src/components/inputs/Select/Select.theme.d.ts +2 -3
- package/dist/src/components/inputs/Select/Select.theme.js +6 -33
- package/dist/src/components/inputs/Switch/Switch.theme.js +125 -49
- package/dist/src/components/inputs/TextField/TextField.theme.d.ts +2 -3
- package/dist/src/components/inputs/TextField/TextField.theme.js +2 -26
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.js +5 -0
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.theme.d.ts +11 -0
- package/dist/src/components/navigation/Breadcrumbs/Breadcrumbs.theme.js +23 -0
- package/dist/src/components/navigation/Breadcrumbs/Crumb.d.ts +10 -0
- package/dist/src/components/navigation/Breadcrumbs/Crumb.js +10 -0
- package/dist/src/components/navigation/Breadcrumbs/index.d.ts +1 -0
- package/dist/src/components/navigation/Breadcrumbs/index.js +2 -0
- package/dist/src/components/navigation/Drawer/Drawer.theme.d.ts +1 -1
- package/dist/src/components/navigation/Drawer/Drawer.theme.js +50 -6
- package/dist/src/components/navigation/Link/Link.theme.d.ts +11 -2
- package/dist/src/components/navigation/Link/Link.theme.js +66 -9
- package/dist/src/components/navigation/Menu/Menu.theme.d.ts +2 -3
- package/dist/src/components/navigation/Menu/Menu.theme.js +6 -11
- package/dist/src/components/navigation/MenuItem/MenuItem.theme.d.ts +2 -4
- package/dist/src/components/navigation/MenuItem/MenuItem.theme.js +8 -8
- package/dist/src/components/navigation/Pagination/Pagination.theme.d.ts +1 -1
- package/dist/src/components/navigation/Pagination/Pagination.theme.js +11 -3
- package/dist/src/components/navigation/PaginationItem/PaginationItem.theme.js +65 -10
- package/dist/src/components/navigation/PaginationItem/components/PaginationIcons.d.ts +4 -0
- package/dist/src/components/navigation/PaginationItem/components/PaginationIcons.js +8 -0
- package/dist/src/components/navigation/PaginationItem/components/index.d.ts +1 -0
- package/dist/src/components/navigation/PaginationItem/components/index.js +2 -0
- package/dist/src/components/navigation/Tab/Tab.theme.d.ts +7 -1
- package/dist/src/components/navigation/Tab/Tab.theme.js +52 -13
- package/dist/src/components/navigation/Tabs/Tabs.d.ts +3 -0
- package/dist/src/components/navigation/Tabs/Tabs.js +4 -0
- package/dist/src/components/navigation/Tabs/Tabs.theme.d.ts +16 -0
- package/dist/src/components/navigation/Tabs/Tabs.theme.js +55 -0
- package/dist/src/components/navigation/Tabs/index.d.ts +1 -0
- package/dist/src/components/navigation/Tabs/index.js +2 -0
- package/dist/src/components/surfaces/Accordion/Accordion.theme.js +54 -22
- package/dist/src/components/surfaces/Accordion/AccordionDetails.theme.d.ts +10 -0
- package/dist/src/components/surfaces/Accordion/AccordionDetails.theme.js +19 -0
- package/dist/src/components/surfaces/Accordion/AccordionSummary.theme.d.ts +10 -0
- package/dist/src/components/surfaces/Accordion/AccordionSummary.theme.js +37 -0
- package/dist/src/components/surfaces/Accordion/index.d.ts +2 -0
- package/dist/src/components/surfaces/Accordion/index.js +2 -0
- package/dist/src/components/surfaces/Card/Card.theme.js +1 -1
- package/dist/src/components/surfaces/Paper/Paper.theme.d.ts +16 -1
- package/dist/src/components/surfaces/Paper/Paper.theme.js +21 -7
- package/dist/src/components/surfaces/Paper/Paper.tokens.d.ts +8 -0
- package/dist/src/components/surfaces/Paper/Paper.tokens.js +50 -0
- package/dist/src/components/surfaces/Paper/Paper.variants.d.ts +4 -0
- package/dist/src/components/surfaces/Paper/Paper.variants.js +3 -0
- package/dist/src/components/surfaces/Popover/Popover.d.ts +4 -0
- package/dist/src/components/surfaces/Popover/Popover.js +4 -0
- package/dist/src/components/surfaces/Popover/Popover.theme.d.ts +9 -0
- package/dist/src/components/surfaces/Popover/Popover.theme.js +14 -0
- package/dist/src/components/surfaces/Popover/index.d.ts +1 -0
- package/dist/src/components/surfaces/Popover/index.js +2 -0
- package/dist/src/components/utils/Backdrop/Backdrop.d.ts +3 -0
- package/dist/src/components/utils/Backdrop/Backdrop.js +4 -0
- package/dist/src/components/utils/Backdrop/Backdrop.theme.d.ts +11 -0
- package/dist/src/components/utils/Backdrop/Backdrop.theme.js +17 -0
- package/dist/src/components/utils/Backdrop/index.d.ts +1 -0
- package/dist/src/components/utils/Backdrop/index.js +2 -0
- package/dist/src/providers/ThemeModeProvider.d.ts +1 -2
- package/dist/src/providers/ThemeModeProvider.js +2 -2
- package/dist/src/providers/WebProsMuiThemeProvider.js +1 -1
- package/dist/src/providers/WebProsTheme.d.ts +1 -0
- package/dist/src/providers/WebProsTheme.js +11 -5
- package/dist/src/shared/rippleEnterKeyframe.d.ts +6 -0
- package/dist/src/shared/rippleEnterKeyframe.js +12 -0
- package/dist/src/shared/viewContext/index.d.ts +1 -0
- package/dist/src/shared/viewContext/index.js +2 -0
- package/dist/src/shared/viewContext/viewContext.d.ts +4 -0
- package/dist/src/shared/viewContext/viewContext.js +2 -0
- package/dist/src/style/additional-color-palette.d.ts +1 -3
- package/dist/src/style/additional-color-palette.js +3 -6
- package/dist/src/style/custom-color-palette.js +50 -52
- package/dist/src/tokens/ThemeColorTokens.d.ts +11 -93
- package/dist/src/tokens/ThemeColorTokens.js +4 -168
- package/dist/src/tokens/ThemeScheme.d.ts +0 -3
- package/dist/src/tokens/ThemeScheme.js +0 -2
- package/dist/src/tokens/colors/Dark.d.ts +16 -0
- package/dist/src/tokens/colors/Dark.js +1398 -0
- package/dist/src/tokens/colors/Light.d.ts +16 -0
- package/dist/src/tokens/colors/Light.js +1398 -0
- package/dist/src/tokens/colors/index.d.ts +7 -0
- package/dist/src/tokens/colors/index.js +4 -0
- package/dist/src/tokens/colors/inverseSchemas.d.ts +40 -0
- package/dist/src/tokens/colors/inverseSchemas.js +3 -0
- package/dist/src/tokens/colors/inverseSchemes.d.ts +53 -0
- package/dist/src/tokens/colors/inverseSchemes.js +3 -0
- package/dist/src/tokens/colors/inverseStateLayers.d.ts +174 -0
- package/dist/src/tokens/colors/inverseStateLayers.js +3 -0
- package/dist/src/tokens/colors/schemas.d.ts +111 -0
- package/dist/src/tokens/colors/schemas.js +3 -0
- package/dist/src/tokens/colors/schemes.d.ts +111 -0
- package/dist/src/tokens/colors/schemes.js +3 -0
- package/dist/src/tokens/colors/stateLayers.d.ts +456 -0
- package/dist/src/tokens/colors/stateLayers.js +3 -0
- package/dist/src/tokens/colors/types.d.ts +9 -0
- package/dist/src/tokens/colors/types.js +2 -0
- package/dist/src/tokens/index.d.ts +6 -2
- package/dist/src/tokens/index.js +2 -1
- package/dist/src/tokens/legacyColors/LegacyDark.d.ts +2 -0
- package/dist/src/tokens/legacyColors/LegacyDark.js +88 -0
- package/dist/src/tokens/legacyColors/LegacyLight.d.ts +2 -0
- package/dist/src/tokens/legacyColors/LegacyLight.js +86 -0
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.d.ts +74 -0
- package/dist/src/tokens/legacyColors/ThemeColorTokensLegacy.js +2 -0
- package/dist/src/tokens/legacyColors/additionalColors/additionalColors.d.ts +21 -0
- package/dist/src/tokens/legacyColors/additionalColors/additionalColors.js +2 -0
- package/dist/src/tokens/{additionalColors → legacyColors/additionalColors}/index.d.ts +1 -0
- package/dist/src/tokens/{additionalColors → legacyColors/additionalColors}/index.js +1 -0
- package/dist/src/tokens/legacyColors/index.d.ts +2 -0
- package/dist/src/tokens/legacyColors/index.js +3 -0
- package/dist/src/tokens/shadows/index.d.ts +12 -0
- package/dist/src/tokens/shadows/index.js +112 -0
- package/dist/src/tokens/typography/index.d.ts +2 -0
- package/dist/src/tokens/typography/index.js +4 -0
- package/dist/src/tokens/typography/typescale.d.ts +28 -0
- package/dist/src/tokens/typography/typescale.js +26 -0
- package/dist/src/tokens/typography/typography.d.ts +2 -0
- package/dist/src/tokens/typography/typography.js +156 -0
- package/dist/src/utils/flatten.d.ts +1 -0
- package/dist/src/utils/flatten.js +12 -0
- package/dist/src/utils/getMUIComponents.js +2 -2
- package/dist/src/utils/getMUIPalette.d.ts +4 -9
- package/dist/src/utils/getMUIPalette.js +49 -25
- package/dist/src/utils/getMUIThemeCustoimzationType.d.ts +31 -0
- package/dist/src/utils/getMUIThemeCustoimzationType.js +2 -0
- package/dist/src/utils/getMUITypography.d.ts +2 -0
- package/dist/src/utils/getMUITypography.js +5 -0
- package/dist/src/utils/getStateLayerColor.d.ts +37 -0
- package/dist/src/utils/getStateLayerColor.js +43 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/patchMUIShadows.js +4 -3
- package/package.json +6 -4
- package/dist/src/components/inputs/Autocomplete/components/AutocompletePopupIcon.d.ts +0 -1
- package/dist/src/components/navigation/PaginationItem/PaginationItem.d.ts +0 -3
- package/dist/src/components/navigation/PaginationItem/PaginationItem.js +0 -4
- package/dist/src/components/navigation/TabList/TabList.d.ts +0 -3
- package/dist/src/components/navigation/TabList/TabList.js +0 -4
- package/dist/src/components/navigation/TabList/TabList.theme.d.ts +0 -10
- package/dist/src/components/navigation/TabList/TabList.theme.js +0 -17
- package/dist/src/components/navigation/TabList/index.d.ts +0 -1
- package/dist/src/hooks/useTonalPalette.d.ts +0 -3
- package/dist/src/hooks/useTonalPalette.js +0 -32
- package/dist/src/providers/ThemeSchemeProvider.d.ts +0 -12
- package/dist/src/providers/ThemeSchemeProvider.js +0 -29
- package/dist/src/tokens/TonalPalette.d.ts +0 -10
- package/dist/src/tokens/TonalPalette.js +0 -10
- package/dist/src/utils/generateTokens.d.ts +0 -4
- package/dist/src/utils/generateTokens.js +0 -107
- /package/dist/src/tokens/{Tone.d.ts → legacyColors/Tone.d.ts} +0 -0
- /package/dist/src/tokens/{Tone.js → legacyColors/Tone.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Theme, ComponentsProps } from '@mui/material';
|
|
2
|
+
interface M3Popover {
|
|
3
|
+
MuiPopover: {
|
|
4
|
+
defaultProps?: ComponentsProps['MuiPopover'];
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export declare const getPopover: (_theme: Theme) => M3Popover;
|
|
8
|
+
declare const _default: {};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
+
export const getPopover = (_theme) => {
|
|
3
|
+
return {
|
|
4
|
+
MuiPopover: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
PaperProps: {
|
|
7
|
+
elevation: 3,
|
|
8
|
+
variant: 'elevation',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Popover.theme';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Theme, ComponentsProps, ComponentsOverrides, ComponentsVariants } from '@mui/material';
|
|
2
|
+
interface M3Backdrop {
|
|
3
|
+
MuiBackdrop: {
|
|
4
|
+
defaultProps?: ComponentsProps['MuiBackdrop'];
|
|
5
|
+
styleOverrides?: ComponentsOverrides<Theme>['MuiBackdrop'];
|
|
6
|
+
variants?: ComponentsVariants['MuiBackdrop'];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const getBackdrop: (theme: Theme) => M3Backdrop;
|
|
10
|
+
declare const _default: {};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
+
export const getBackdrop = (theme) => {
|
|
3
|
+
const { colors } = theme;
|
|
4
|
+
return {
|
|
5
|
+
MuiBackdrop: {
|
|
6
|
+
styleOverrides: {
|
|
7
|
+
root: {
|
|
8
|
+
backgroundColor: colors.stateLayers.surfaces.scrim.opacity48,
|
|
9
|
+
'&.MuiBackdrop-invisible': {
|
|
10
|
+
backgroundColor: 'transparent',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Backdrop.theme';
|
|
@@ -6,9 +6,8 @@ export type ThemeModeContextType = {
|
|
|
6
6
|
};
|
|
7
7
|
export type ThemeModeProviderProps = {
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
-
mode?: ThemeMode;
|
|
10
9
|
};
|
|
11
10
|
export declare const ThemeModeContext: import("react").Context<ThemeModeContextType>;
|
|
12
|
-
declare const ThemeModeProvider: ({ children
|
|
11
|
+
declare const ThemeModeProvider: ({ children }: ThemeModeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export default ThemeModeProvider;
|
|
14
13
|
export declare const useThemeModeContext: () => ThemeModeContextType;
|
|
@@ -7,9 +7,9 @@ export const ThemeModeContext = createContext({
|
|
|
7
7
|
toggleTheme: () => { },
|
|
8
8
|
setThemeMode: () => { },
|
|
9
9
|
});
|
|
10
|
-
const ThemeModeProvider = ({ children
|
|
10
|
+
const ThemeModeProvider = ({ children }) => {
|
|
11
11
|
const [themeMode, toggleTheme, setThemeMode] = useThemeMode();
|
|
12
|
-
const value = useMemo(() => ({ themeMode
|
|
12
|
+
const value = useMemo(() => ({ themeMode, toggleTheme, setThemeMode }), [themeMode, toggleTheme, setThemeMode]);
|
|
13
13
|
return _jsx(ThemeModeContext.Provider, { value: value, children: children });
|
|
14
14
|
};
|
|
15
15
|
export default ThemeModeProvider;
|
|
@@ -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, {
|
|
4
|
+
const WebProsMuiThemeProvider = ({ children, localization, themeMode }) => (_jsx(ThemeModeProvider, { children: _jsx(WebProsTheme, { mode: themeMode, localization: localization, children: children }) }));
|
|
5
5
|
export default WebProsMuiThemeProvider;
|
|
@@ -4,22 +4,28 @@ import { useContext, useMemo } from 'react';
|
|
|
4
4
|
import { CssBaseline, createTheme, ThemeProvider } from '@mui/material';
|
|
5
5
|
import { deepmerge } from '@mui/utils';
|
|
6
6
|
import { ThemeModeContext } from '../providers/ThemeModeProvider';
|
|
7
|
-
import
|
|
7
|
+
import '../utils/getMUIThemeCustoimzationType';
|
|
8
8
|
import { getMUIPalette } from '../utils/getMUIPalette';
|
|
9
9
|
import { getMUIComponents } from '../utils/getMUIComponents';
|
|
10
10
|
import { enUS } from '@mui/material/locale';
|
|
11
11
|
import { patchMUIShadows } from '../utils/patchMUIShadows';
|
|
12
|
+
import { ThemeSchemeDefault } from '../tokens/ThemeScheme';
|
|
13
|
+
import { getMUITypography } from '../utils/getMUITypography';
|
|
12
14
|
export const WebProsTheme = ({ children, mode, localization = enUS }) => {
|
|
13
15
|
const themeModeContext = useContext(ThemeModeContext);
|
|
14
|
-
const { themeScheme } = useContext(ThemeSchemeContext);
|
|
15
16
|
const themeMode = mode !== null && mode !== void 0 ? mode : themeModeContext.themeMode;
|
|
17
|
+
const typography = getMUITypography();
|
|
16
18
|
const webprosTheme = useMemo(() => {
|
|
17
|
-
const muiPalette = getMUIPalette(themeMode,
|
|
18
|
-
let theme = createTheme(
|
|
19
|
+
const muiPalette = getMUIPalette(themeMode, ThemeSchemeDefault);
|
|
20
|
+
let theme = createTheme({
|
|
21
|
+
palette: muiPalette.palette,
|
|
22
|
+
colors: muiPalette.colors,
|
|
23
|
+
typography: Object.assign(Object.assign({}, getMUITypography()), { 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) }),
|
|
24
|
+
}, localization);
|
|
19
25
|
patchMUIShadows(theme);
|
|
20
26
|
theme = deepmerge(theme, getMUIComponents(theme, themeMode));
|
|
21
27
|
return theme;
|
|
22
|
-
}, [themeMode,
|
|
28
|
+
}, [themeMode, localization]);
|
|
23
29
|
return (_jsxs(ThemeProvider, { theme: webprosTheme, children: [_jsx(CssBaseline, { enableColorScheme: true }), children] }));
|
|
24
30
|
};
|
|
25
31
|
export default WebProsTheme;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2025 WebPros International GmbH. All rights reserved.
|
|
2
|
+
import { keyframes } from '@mui/material';
|
|
3
|
+
export const rippleEnterKeyframe = keyframes `
|
|
4
|
+
0% {
|
|
5
|
+
transform: scale(0);
|
|
6
|
+
opacity: 0.3;
|
|
7
|
+
}
|
|
8
|
+
100% {
|
|
9
|
+
transform: scale(1);
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './viewContext';
|
|
@@ -1,13 +1,10 @@
|
|
|
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 { useContext } from 'react';
|
|
4
3
|
import Grid from '@mui/material/Grid2/Grid2';
|
|
5
|
-
import { ThemeSchemeContext } from '../providers/ThemeSchemeProvider';
|
|
6
4
|
import { ColorItem } from '@storybook/addon-docs/blocks';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return (_jsx(Grid, { container: true, rowSpacing: 2, direction: 'column', children: Object.entries(theme.additionalColors).map(([key, val]) => (_jsxs(_Fragment, { children: [_jsx("h3", { id: key, children: key }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Primary", subtitle: "", colors: {
|
|
5
|
+
import { LegacyDarkTokensDefault } from '../tokens/legacyColors';
|
|
6
|
+
export const AdditionalColorPalette = () => {
|
|
7
|
+
return (_jsx(Grid, { container: true, rowSpacing: 2, direction: 'column', children: Object.entries(LegacyDarkTokensDefault.additionalColors).map(([key, val]) => (_jsxs(_Fragment, { children: [_jsx("h3", { id: key, children: key }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Primary", subtitle: "", colors: {
|
|
11
8
|
[`theme.custom.${key}[50]`]: val[50],
|
|
12
9
|
[`theme.custom.${key}[100]`]: val[100],
|
|
13
10
|
[`theme.custom.${key}[200]`]: val[200],
|
|
@@ -1,75 +1,73 @@
|
|
|
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 { useContext } from 'react';
|
|
4
3
|
import Grid from '@mui/material/Grid2/Grid2';
|
|
5
|
-
import { ThemeSchemeContext } from '../providers/ThemeSchemeProvider';
|
|
6
4
|
import { ColorItem } from '@storybook/addon-docs/blocks';
|
|
5
|
+
import { LegacyDarkTokensDefault, LegacyLightTokensDefault, } from '../tokens/legacyColors';
|
|
7
6
|
export const CustomColorPalette = ({ mode }) => {
|
|
8
|
-
const { themeScheme } = useContext(ThemeSchemeContext);
|
|
9
7
|
const modeTitle = mode === 'light' ? 'Light Theme' : 'Dark Theme';
|
|
10
|
-
const
|
|
8
|
+
const palette = mode === 'light' ? LegacyLightTokensDefault : LegacyDarkTokensDefault;
|
|
11
9
|
return (_jsxs(Grid, { container: true, rowSpacing: 2, direction: 'column', children: [_jsx("h3", { id: modeTitle, children: modeTitle }), _jsx("h3", { id: `${mode}-base-colors`, children: 'Base colors' }), _jsx("h3", { id: `${mode}-primary`, children: 'Primary' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Primary", subtitle: "", colors: {
|
|
12
|
-
'theme.primary':
|
|
13
|
-
'theme.onPrimary':
|
|
14
|
-
'theme.primaryContainer':
|
|
15
|
-
'theme.onPrimaryContainer':
|
|
10
|
+
'theme.primary': palette.primary,
|
|
11
|
+
'theme.onPrimary': palette.onPrimary,
|
|
12
|
+
'theme.primaryContainer': palette.primaryContainer,
|
|
13
|
+
'theme.onPrimaryContainer': palette.onPrimaryContainer,
|
|
16
14
|
} }) }), _jsx("h3", { id: `${mode}-secondary`, children: 'Secondary' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Secondary", subtitle: "", colors: {
|
|
17
|
-
'theme.secondary':
|
|
18
|
-
'theme.onSecondary':
|
|
19
|
-
'theme.secondaryContainer':
|
|
20
|
-
'theme.onSecondaryContainer':
|
|
15
|
+
'theme.secondary': palette.secondary,
|
|
16
|
+
'theme.onSecondary': palette.onSecondary,
|
|
17
|
+
'theme.secondaryContainer': palette.secondaryContainer,
|
|
18
|
+
'theme.onSecondaryContainer': palette.onSecondaryContainer,
|
|
21
19
|
} }) }), _jsx("h3", { id: `${mode}-tertiary`, children: 'Tertiary' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Tertiary", subtitle: "", colors: {
|
|
22
|
-
'theme.tertiary':
|
|
23
|
-
'theme.onTertiary':
|
|
24
|
-
'theme.tertiaryContainer':
|
|
25
|
-
'theme.onTertiaryContainer':
|
|
20
|
+
'theme.tertiary': palette.tertiary,
|
|
21
|
+
'theme.onTertiary': palette.onTertiary,
|
|
22
|
+
'theme.tertiaryContainer': palette.tertiaryContainer,
|
|
23
|
+
'theme.onTertiaryContainer': palette.onTertiaryContainer,
|
|
26
24
|
} }) }), _jsx("h3", { id: `${mode}-error`, children: 'Error' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Error", subtitle: "", colors: {
|
|
27
|
-
'theme.error':
|
|
28
|
-
'theme.onError':
|
|
29
|
-
'theme.errorContainer':
|
|
30
|
-
'theme.onErrorContainer':
|
|
25
|
+
'theme.error': palette.error,
|
|
26
|
+
'theme.onError': palette.onError,
|
|
27
|
+
'theme.errorContainer': palette.errorContainer,
|
|
28
|
+
'theme.onErrorContainer': palette.onErrorContainer,
|
|
31
29
|
} }) }), _jsx("h3", { id: `${mode}-surface`, children: 'Surface' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Surface", subtitle: "", colors: {
|
|
32
|
-
'theme.surfaceDim':
|
|
33
|
-
'theme.surface':
|
|
34
|
-
'theme.surfaceBright':
|
|
30
|
+
'theme.surfaceDim': palette.surfaceDim,
|
|
31
|
+
'theme.surface': palette.surface,
|
|
32
|
+
'theme.surfaceBright': palette.surfaceBright,
|
|
35
33
|
} }) }), _jsx("h3", { id: `${mode}-surface-container`, children: 'Surface container' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Surface container", subtitle: "", colors: {
|
|
36
|
-
'theme.surfaceContainerLowest ':
|
|
37
|
-
'theme.surfaceContainerLow':
|
|
38
|
-
'theme.surfaceContainer':
|
|
39
|
-
'theme.surfaceContainerHigh':
|
|
40
|
-
'theme.surfaceContainerHighest':
|
|
34
|
+
'theme.surfaceContainerLowest ': palette.surfaceContainerLowest,
|
|
35
|
+
'theme.surfaceContainerLow': palette.surfaceContainerLow,
|
|
36
|
+
'theme.surfaceContainer': palette.surfaceContainer,
|
|
37
|
+
'theme.surfaceContainerHigh': palette.surfaceContainerHigh,
|
|
38
|
+
'theme.surfaceContainerHighest': palette.surfaceContainerHighest,
|
|
41
39
|
} }) }), _jsx("h3", { id: `${mode}-on-surface`, children: 'On surface' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "On surface", subtitle: "", colors: {
|
|
42
|
-
'theme.onSurface ':
|
|
43
|
-
'theme.onSurfaceVariant ':
|
|
44
|
-
'theme.outline ':
|
|
45
|
-
'theme.outlineVariant ':
|
|
40
|
+
'theme.onSurface ': palette.onSurface,
|
|
41
|
+
'theme.onSurfaceVariant ': palette.onSurfaceVariant,
|
|
42
|
+
'theme.outline ': palette.outline,
|
|
43
|
+
'theme.outlineVariant ': palette.outlineVariant,
|
|
46
44
|
} }) }), _jsx("h3", { id: `${mode}-inverse`, children: 'Inverse' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Inverse", subtitle: "", colors: {
|
|
47
|
-
'theme.inverseSurface ':
|
|
48
|
-
'theme.inversePrimary ':
|
|
49
|
-
'theme.inverseOnSurface ':
|
|
45
|
+
'theme.inverseSurface ': palette.inverseSurface,
|
|
46
|
+
'theme.inversePrimary ': palette.inversePrimary,
|
|
47
|
+
'theme.inverseOnSurface ': palette.inverseOnSurface,
|
|
50
48
|
} }) }), _jsx("h3", { id: `${mode}-shadow-and-scrim`, children: 'Shadow and Scrim' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Shadow and Scrim", subtitle: "", colors: {
|
|
51
|
-
'theme.shadow ':
|
|
52
|
-
'theme.scrim ':
|
|
49
|
+
'theme.shadow ': palette.shadow,
|
|
50
|
+
'theme.scrim ': palette.scrim,
|
|
53
51
|
} }) }), _jsx("h3", { id: `${mode}-custom-colors`, children: 'Custom state colors' }), _jsx("h3", { id: `${mode}-info`, children: 'Info' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Info", subtitle: "", colors: {
|
|
54
|
-
'theme.info':
|
|
55
|
-
'theme.onInfo':
|
|
56
|
-
'theme.infoContainer':
|
|
57
|
-
'theme.onInfoContainer':
|
|
52
|
+
'theme.info': palette.info,
|
|
53
|
+
'theme.onInfo': palette.onInfo,
|
|
54
|
+
'theme.infoContainer': palette.infoContainer,
|
|
55
|
+
'theme.onInfoContainer': palette.onInfoContainer,
|
|
58
56
|
} }) }), _jsx("h3", { id: `${mode}-warning`, children: 'Warning' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Warning", subtitle: "", colors: {
|
|
59
|
-
'theme.warning':
|
|
60
|
-
'theme.onWarning':
|
|
61
|
-
'theme.warningContainer':
|
|
62
|
-
'theme.onWarningContainer':
|
|
57
|
+
'theme.warning': palette.warning,
|
|
58
|
+
'theme.onWarning': palette.onWarning,
|
|
59
|
+
'theme.warningContainer': palette.warningContainer,
|
|
60
|
+
'theme.onWarningContainer': palette.onWarningContainer,
|
|
63
61
|
} }) }), _jsx("h3", { id: `${mode}-success`, children: 'Success' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Success", subtitle: "", colors: {
|
|
64
|
-
'theme.success':
|
|
65
|
-
'theme.onSuccess':
|
|
66
|
-
'theme.successContainer':
|
|
67
|
-
'theme.onSuccessContainer':
|
|
62
|
+
'theme.success': palette.success,
|
|
63
|
+
'theme.onSuccess': palette.onSuccess,
|
|
64
|
+
'theme.successContainer': palette.successContainer,
|
|
65
|
+
'theme.onSuccessContainer': palette.onSuccessContainer,
|
|
68
66
|
} }) }), _jsx("h3", { id: `${mode}-utility-colors`, children: 'Utility colors' }), _jsx("h3", { id: `${mode}-undefined`, children: 'Undefined' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Undefined", subtitle: "", colors: {
|
|
69
|
-
'theme.undefined':
|
|
67
|
+
'theme.undefined': palette.undefined,
|
|
70
68
|
} }) }), _jsx("h3", { id: `${mode}-supportive`, children: 'Supportive' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Supportive", subtitle: "", colors: {
|
|
71
|
-
'theme.supportive':
|
|
69
|
+
'theme.supportive': palette.supportive,
|
|
72
70
|
} }) }), _jsx("h3", { id: `${mode}-divider`, children: 'Outline' }), _jsx("div", { className: "color-item", children: _jsx(ColorItem, { title: "Outline", subtitle: "", colors: {
|
|
73
|
-
'theme.outline':
|
|
71
|
+
'theme.outline': palette.outline,
|
|
74
72
|
} }) })] }));
|
|
75
73
|
};
|
|
@@ -1,96 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
green: AdditionalColorTone;
|
|
13
|
-
lightGreen: AdditionalColorTone;
|
|
14
|
-
lime: AdditionalColorTone;
|
|
15
|
-
yellow: AdditionalColorTone;
|
|
16
|
-
amber: AdditionalColorTone;
|
|
17
|
-
orange: AdditionalColorTone;
|
|
18
|
-
deepOrange: AdditionalColorTone;
|
|
19
|
-
brown: AdditionalColorTone;
|
|
20
|
-
};
|
|
21
|
-
export type AdditionalColorKey = keyof AdditionalColors;
|
|
22
|
-
export type ThemeColorTokens = {
|
|
23
|
-
primary: string;
|
|
24
|
-
onPrimary: string;
|
|
25
|
-
primaryContainer: string;
|
|
26
|
-
onPrimaryContainer: string;
|
|
27
|
-
secondary: string;
|
|
28
|
-
onSecondary: string;
|
|
29
|
-
secondaryContainer: string;
|
|
30
|
-
onSecondaryContainer: string;
|
|
31
|
-
tertiary: string;
|
|
32
|
-
onTertiary: string;
|
|
33
|
-
tertiaryContainer: string;
|
|
34
|
-
onTertiaryContainer: string;
|
|
35
|
-
error: string;
|
|
36
|
-
onError: string;
|
|
37
|
-
errorContainer: string;
|
|
38
|
-
onErrorContainer: string;
|
|
39
|
-
errorFixedDim: string;
|
|
40
|
-
primaryFixed: string;
|
|
41
|
-
primaryFixedDim: string;
|
|
42
|
-
onPrimaryFixed: string;
|
|
43
|
-
onPrimaryFixedVariant: string;
|
|
44
|
-
secondaryFixed: string;
|
|
45
|
-
secondaryFixedDim: string;
|
|
46
|
-
onSecondaryFixed: string;
|
|
47
|
-
onSecondaryFixedVariant: string;
|
|
48
|
-
tertiaryFixed: string;
|
|
49
|
-
tertiaryFixedDim: string;
|
|
50
|
-
onTertiaryFixed: string;
|
|
51
|
-
onTertiaryFixedVariant: string;
|
|
52
|
-
surface: string;
|
|
53
|
-
onSurface: string;
|
|
54
|
-
surfaceDim: string;
|
|
55
|
-
surfaceBright: string;
|
|
56
|
-
surfaceContainerLowest: string;
|
|
57
|
-
surfaceContainerLow: string;
|
|
58
|
-
surfaceContainer: string;
|
|
59
|
-
surfaceContainerHigh: string;
|
|
60
|
-
surfaceContainerHighest: string;
|
|
61
|
-
surfaceVariant: string;
|
|
62
|
-
onSurfaceVariant: string;
|
|
63
|
-
outline: string;
|
|
64
|
-
outlineVariant: string;
|
|
65
|
-
inverseSurface: string;
|
|
66
|
-
inverseOnSurface: string;
|
|
67
|
-
inversePrimary: string;
|
|
68
|
-
shadow: string;
|
|
69
|
-
scrim: string;
|
|
70
|
-
surfaceTint: string;
|
|
71
|
-
background: string;
|
|
72
|
-
onBackground: string;
|
|
73
|
-
info: string;
|
|
74
|
-
onInfo: string;
|
|
75
|
-
infoContainer: string;
|
|
76
|
-
onInfoContainer: string;
|
|
77
|
-
infoFixedDim: string;
|
|
78
|
-
success: string;
|
|
79
|
-
onSuccess: string;
|
|
80
|
-
successContainer: string;
|
|
81
|
-
onSuccessContainer: string;
|
|
82
|
-
successFixedDim: string;
|
|
83
|
-
warning: string;
|
|
84
|
-
onWarning: string;
|
|
85
|
-
warningContainer: string;
|
|
86
|
-
onWarningContainer: string;
|
|
87
|
-
warningFixedDim: string;
|
|
88
|
-
undefined: string;
|
|
89
|
-
onUndefined: string;
|
|
90
|
-
undefinedContainer: string;
|
|
91
|
-
onUndefinedContainer: string;
|
|
92
|
-
supportive: string;
|
|
93
|
-
additionalColors: AdditionalColors;
|
|
1
|
+
import { ThemeColorTokensLegacy } from '../tokens/legacyColors/ThemeColorTokensLegacy';
|
|
2
|
+
import { Schemes, SchemesGenerated, StateLayers, StateLayersGenerated, InverseSchemes, InverseSchemesGenerated, InverseStateLayers, InverseStateLayersGenerated } from '../tokens/colors';
|
|
3
|
+
export type ThemeColorTokens = ThemeColorTokensLegacy & {
|
|
4
|
+
schemes: Schemes;
|
|
5
|
+
stateLayers: StateLayers;
|
|
6
|
+
inverseSchemes: InverseSchemes;
|
|
7
|
+
inverseStateLayers: InverseStateLayers;
|
|
8
|
+
generatedSchemes: SchemesGenerated;
|
|
9
|
+
generatedStateLayers: StateLayersGenerated;
|
|
10
|
+
generatedInverseSchemes: InverseSchemesGenerated;
|
|
11
|
+
generatedInverseStateLayers: InverseStateLayersGenerated;
|
|
94
12
|
};
|
|
95
13
|
export declare const LightTokensDefault: ThemeColorTokens;
|
|
96
14
|
export declare const DarkTokensDefault: ThemeColorTokens;
|