@webpros/mui-theme 0.1.5 → 0.1.6

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
3
  "description": "MUI v6 theme for WebPros products",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -6,8 +6,9 @@ export type ThemeModeContextType = {
6
6
  };
7
7
  export type ThemeModeProviderProps = {
8
8
  children?: React.ReactNode;
9
+ mode?: ThemeMode;
9
10
  };
10
11
  export declare const ThemeModeContext: import("react").Context<ThemeModeContextType>;
11
- declare const ThemeModeProvider: ({ children }: ThemeModeProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const ThemeModeProvider: ({ children, mode }: ThemeModeProviderProps) => import("react/jsx-runtime").JSX.Element;
12
13
  export default ThemeModeProvider;
13
14
  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, mode }) => {
11
11
  const [themeMode, toggleTheme, setThemeMode] = useThemeMode();
12
- const value = useMemo(() => ({ themeMode, toggleTheme, setThemeMode }), [themeMode, toggleTheme, setThemeMode]);
12
+ const value = useMemo(() => ({ themeMode: mode || themeMode, toggleTheme, setThemeMode }), [mode, 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, { children: _jsx(WebProsTheme, { mode: themeMode, localization: localization, children: children }) }));
4
+ const WebProsMuiThemeProvider = ({ children, localization, themeMode }) => (_jsx(ThemeModeProvider, { mode: themeMode, children: _jsx(WebProsTheme, { mode: themeMode, localization: localization, children: children }) }));
5
5
  export default WebProsMuiThemeProvider;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webpros/mui-theme",
3
3
  "description": "MUI v6 theme for WebPros products",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",