@matrix-widget-toolkit/mui 1.0.2 → 1.0.4

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 ({
@@ -372,8 +378,9 @@ var baseTheme = {
372
378
  root: function (_a) {
373
379
  var theme = _a.theme;
374
380
  return ({
375
- backgroundColor: theme.palette.mode === 'dark' ? '#000' : 'rgba(46,48,51,.38)',
376
- opacity: 0.8,
381
+ backgroundColor: theme.palette.mode === 'dark'
382
+ ? 'rgba(0,0,0,.8)'
383
+ : 'rgba(46,48,51,.304)',
377
384
  });
378
385
  },
379
386
  invisible: {
@@ -689,13 +696,13 @@ function ElementMuiThemeProvider(_a) {
689
696
  var theme = react.useThemeSelection().theme;
690
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];
691
698
  react$2.useEffect(function () {
692
- 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]); };
693
700
  i18n__default.default.on('languageChanged', callback);
694
701
  return function () { return i18n__default.default.off('languageChanged', callback); };
695
702
  }, []);
696
703
  var muiTheme = react$2.useMemo(function () {
697
704
  var themeOptions = chooseTheme(theme);
698
- 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;
699
706
  return material.createTheme(utils.deepmerge(baseTheme, themeOptions), localeOptions);
700
707
  }, [locale$1, theme]);
701
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 ({
@@ -360,8 +366,9 @@ var baseTheme = {
360
366
  root: function (_a) {
361
367
  var theme = _a.theme;
362
368
  return ({
363
- backgroundColor: theme.palette.mode === 'dark' ? '#000' : 'rgba(46,48,51,.38)',
364
- opacity: 0.8,
369
+ backgroundColor: theme.palette.mode === 'dark'
370
+ ? 'rgba(0,0,0,.8)'
371
+ : 'rgba(46,48,51,.304)',
365
372
  });
366
373
  },
367
374
  invisible: {
@@ -677,13 +684,13 @@ function ElementMuiThemeProvider(_a) {
677
684
  var theme = useThemeSelection().theme;
678
685
  var _c = useState((_b = i18n.languages) === null || _b === void 0 ? void 0 : _b[0]), locale = _c[0], setLocale = _c[1];
679
686
  useEffect(function () {
680
- 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]); };
681
688
  i18n.on('languageChanged', callback);
682
689
  return function () { return i18n.off('languageChanged', callback); };
683
690
  }, []);
684
691
  var muiTheme = useMemo(function () {
685
692
  var themeOptions = chooseTheme(theme);
686
- var localeOptions = locale === 'de' ? deDE : enUS;
693
+ var localeOptions = locale && new Intl.Locale(locale).language === 'de' ? deDE : enUS;
687
694
  return createTheme(deepmerge(baseTheme, themeOptions), localeOptions);
688
695
  }, [locale, theme]);
689
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.2",
3
+ "version": "1.0.4",
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",