@matrix-widget-toolkit/mui 1.0.3 → 1.0.5

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.
@@ -347,6 +347,12 @@ var baseTheme = {
347
347
  // Dialogs have a different padding and font style
348
348
  MuiDialog: {
349
349
  styleOverrides: {
350
+ root: {
351
+ // Make margin smaller for scroll=body
352
+ '&& .MuiDialog-paperScrollBody': {
353
+ maxWidth: 600,
354
+ },
355
+ },
350
356
  paper: function (_a) {
351
357
  var theme = _a.theme;
352
358
  return ({
@@ -690,13 +696,13 @@ function ElementMuiThemeProvider(_a) {
690
696
  var theme = react.useThemeSelection().theme;
691
697
  var _c = react$2.useState((_b = i18n__default.default.languages) === null || _b === void 0 ? void 0 : _b[0]), locale$1 = _c[0], setLocale = _c[1];
692
698
  react$2.useEffect(function () {
693
- var callback = function () { return setLocale(i18n__default.default.languages[0]); };
699
+ var callback = function () { var _a; return setLocale((_a = i18n__default.default.languages) === null || _a === void 0 ? void 0 : _a[0]); };
694
700
  i18n__default.default.on('languageChanged', callback);
695
701
  return function () { return i18n__default.default.off('languageChanged', callback); };
696
702
  }, []);
697
703
  var muiTheme = react$2.useMemo(function () {
698
704
  var themeOptions = chooseTheme(theme);
699
- var localeOptions = locale$1 === 'de' ? locale.deDE : locale.enUS;
705
+ var localeOptions = locale$1 && new Intl.Locale(locale$1).language === 'de' ? locale.deDE : locale.enUS;
700
706
  return material.createTheme(utils.deepmerge(baseTheme, themeOptions), localeOptions);
701
707
  }, [locale$1, theme]);
702
708
  return (jsxRuntime.jsxs(material.ThemeProvider, __assign$6({ theme: muiTheme }, { children: [jsxRuntime.jsx(material.CssBaseline, {}), children] })));
@@ -335,6 +335,12 @@ var baseTheme = {
335
335
  // Dialogs have a different padding and font style
336
336
  MuiDialog: {
337
337
  styleOverrides: {
338
+ root: {
339
+ // Make margin smaller for scroll=body
340
+ '&& .MuiDialog-paperScrollBody': {
341
+ maxWidth: 600,
342
+ },
343
+ },
338
344
  paper: function (_a) {
339
345
  var theme = _a.theme;
340
346
  return ({
@@ -678,13 +684,13 @@ function ElementMuiThemeProvider(_a) {
678
684
  var theme = useThemeSelection().theme;
679
685
  var _c = useState((_b = i18n.languages) === null || _b === void 0 ? void 0 : _b[0]), locale = _c[0], setLocale = _c[1];
680
686
  useEffect(function () {
681
- var callback = function () { return setLocale(i18n.languages[0]); };
687
+ var callback = function () { var _a; return setLocale((_a = i18n.languages) === null || _a === void 0 ? void 0 : _a[0]); };
682
688
  i18n.on('languageChanged', callback);
683
689
  return function () { return i18n.off('languageChanged', callback); };
684
690
  }, []);
685
691
  var muiTheme = useMemo(function () {
686
692
  var themeOptions = chooseTheme(theme);
687
- var localeOptions = locale === 'de' ? deDE : enUS;
693
+ var localeOptions = locale && new Intl.Locale(locale).language === 'de' ? deDE : enUS;
688
694
  return createTheme(deepmerge(baseTheme, themeOptions), localeOptions);
689
695
  }, [locale, theme]);
690
696
  return (jsxs(ThemeProvider, __assign$6({ theme: muiTheme }, { children: [jsx(CssBaseline, {}), children] })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matrix-widget-toolkit/mui",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A customized material-ui theme that matches the style of the Element Matrix client",
5
5
  "author": "Nordeck IT + Consulting GmbH",
6
6
  "license": "Apache-2.0",
@@ -14,10 +14,10 @@
14
14
  "@testing-library/user-event": "^14.4.3",
15
15
  "@types/jest": "^27.5.2",
16
16
  "@types/jest-axe": "^3.5.5",
17
- "@types/node": "^16.18.3",
17
+ "@types/node": "^16.18.11",
18
18
  "@types/react": "^17.0.45",
19
19
  "copyfiles": "^2.4.1",
20
- "i18next-parser": "^6.6.0",
20
+ "i18next-parser": "^7.2.0",
21
21
  "jest-axe": "^7.0.0",
22
22
  "react": "^17.0.2",
23
23
  "react-scripts": "5.0.1",
@@ -41,9 +41,9 @@
41
41
  "@emotion/react": "^11.10.5",
42
42
  "@emotion/styled": "^11.10.5",
43
43
  "@fontsource/inter": "^4.5.14",
44
- "@mui/icons-material": "^5.10.9",
45
- "@mui/material": "^5.10.12",
46
- "@mui/utils": "^5.10.9",
44
+ "@mui/icons-material": "^5.11.0",
45
+ "@mui/material": "^5.11.3",
46
+ "@mui/utils": "^5.11.2",
47
47
  "@matrix-widget-toolkit/api": "^1.0.1",
48
48
  "@matrix-widget-toolkit/react": "^1.0.2",
49
49
  "i18next": "^22.0.4",