@zac-apps/commons 1.0.5-beta.6 → 1.0.5-beta.7

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.
Files changed (2) hide show
  1. package/dist/index.js +36 -45
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -23,20 +23,17 @@ var Paper = require('@mui/material/Paper');
23
23
  var Link = require('next/link');
24
24
  var Link$1 = require('@mui/material/Link');
25
25
  var CssBaseline = require('@mui/material/CssBaseline');
26
- var react = require('@emotion/react');
27
26
  var Box = require('@mui/material/Box');
28
- var navigation = require('next/navigation');
29
- var createCache = require('@emotion/cache');
30
27
  var AppBar = require('@mui/material/AppBar');
31
28
  var Toolbar = require('@mui/material/Toolbar');
32
29
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
30
+ var navigation = require('next/navigation');
33
31
  var IconButton = require('@mui/material/IconButton');
34
32
  var MenuItem = require('@mui/material/MenuItem');
35
33
  var Menu = require('@mui/material/Menu');
36
34
  var Divider = require('@mui/material/Divider');
37
35
  var MenuIcon = require('@mui/icons-material/Menu');
38
36
  var MenuOpenIcon = require('@mui/icons-material/MenuOpen');
39
- var footer_content_js = require('../../../../conf/footer_content.js');
40
37
  var CircularProgress = require('@mui/material/CircularProgress');
41
38
  var ToggleButtonGroup = require('@mui/material/ToggleButtonGroup');
42
39
  var ToggleButton = require('@mui/material/ToggleButton');
@@ -189,16 +186,6 @@ function AppTable(_ref) {
189
186
  });
190
187
  }
191
188
 
192
- // prepend: true moves MUI styles to the top of the <head> so they're loaded first.
193
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
194
- function createEmotionCache() {
195
- var result = createCache({
196
- key: "css",
197
- prepend: true
198
- }) || null;
199
- return result;
200
- }
201
-
202
189
  function AppMenu(_ref) {
203
190
  var title = _ref.title,
204
191
  children = _ref.children;
@@ -297,7 +284,8 @@ function NextListMenu(_ref) {
297
284
  });
298
285
  }
299
286
 
300
- function Footer() {
287
+ function Footer(_ref) {
288
+ var footerContent = _ref.footerContent;
301
289
  return /*#__PURE__*/jsxRuntime.jsx(React.Fragment, {
302
290
  children: /*#__PURE__*/jsxRuntime.jsx(Grid, {
303
291
  sx: {
@@ -312,46 +300,50 @@ function Footer() {
312
300
  children: /*#__PURE__*/jsxRuntime.jsx(Grid, {
313
301
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
314
302
  variant: "body2",
315
- children: footer_content_js.footerContent
303
+ children: footerContent
316
304
  })
317
305
  })
318
306
  })
319
307
  });
320
308
  }
321
309
 
322
- var clientSideEmotionCache = createEmotionCache();
323
310
  function AppWrapper(_ref) {
324
311
  var title = _ref.title,
325
312
  availApps = _ref.availApps,
326
- children = _ref.children;
327
- var basePath = process.env.basePath;
328
- return /*#__PURE__*/jsxRuntime.jsx(react.CacheProvider, {
329
- value: clientSideEmotionCache,
330
- children: /*#__PURE__*/jsxRuntime.jsxs(styles.ThemeProvider, {
331
- theme: AppTheme,
332
- children: [/*#__PURE__*/jsxRuntime.jsx(CssBaseline, {}), /*#__PURE__*/jsxRuntime.jsx(AppMenu, {
333
- title: /*#__PURE__*/jsxRuntime.jsx(Link$1, {
334
- sx: {
335
- color: AppTheme.palette.primary.contrastText
336
- },
337
- href: basePath,
338
- component: Link.Link,
339
- children: title
340
- }),
341
- children: /*#__PURE__*/jsxRuntime.jsx(NextListMenu, {
342
- availApps: availApps,
343
- start: true
344
- })
345
- }), /*#__PURE__*/jsxRuntime.jsx(Box, {
313
+ footerContent = _ref.footerContent,
314
+ children = _ref.children,
315
+ basePath = _ref.basePath;
316
+ if (!basePath || basePath === null) {
317
+ basePath = "/";
318
+ }
319
+ if (!footerContent || footerContent === null) {
320
+ footerContent = "";
321
+ }
322
+ return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
323
+ children: [/*#__PURE__*/jsxRuntime.jsx(CssBaseline, {}), /*#__PURE__*/jsxRuntime.jsx(AppMenu, {
324
+ title: /*#__PURE__*/jsxRuntime.jsx(Link$1, {
346
325
  sx: {
347
- p: 3,
348
- minHeight: "calc(100% - 128px)",
349
- display: "flex",
350
- justifyContent: "center"
326
+ color: AppTheme.palette.primary.contrastText
351
327
  },
352
- children: children
353
- }), /*#__PURE__*/jsxRuntime.jsx(Footer, {})]
354
- })
328
+ href: basePath,
329
+ component: Link.Link,
330
+ children: title
331
+ }),
332
+ children: /*#__PURE__*/jsxRuntime.jsx(NextListMenu, {
333
+ availApps: availApps,
334
+ start: true
335
+ })
336
+ }), /*#__PURE__*/jsxRuntime.jsx(Box, {
337
+ sx: {
338
+ p: 3,
339
+ minHeight: "calc(100% - 128px)",
340
+ display: "flex",
341
+ justifyContent: "center"
342
+ },
343
+ children: children
344
+ }), /*#__PURE__*/jsxRuntime.jsx(Footer, {
345
+ footerContent: footerContent
346
+ })]
355
347
  });
356
348
  }
357
349
 
@@ -650,5 +642,4 @@ exports.RespGrid = RespGrid;
650
642
  exports.SpecSwitch = SpecSwitch;
651
643
  exports.Start = Start;
652
644
  exports.TableHeadCell = TableHeadCell;
653
- exports.createEmotionCache = createEmotionCache;
654
645
  exports.useFetch = useFetch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zac-apps/commons",
3
- "version": "1.0.5-beta.6",
3
+ "version": "1.0.5-beta.7",
4
4
  "scripts": {
5
5
  "rollup": "node_modules/rollup/dist/rollup.js",
6
6
  "dev": "next dev",
@@ -28,7 +28,7 @@
28
28
  "author": "ZAC",
29
29
  "license": "CC-BY-SA-4.0",
30
30
  "dependencies": {
31
- "@emotion/styled": "^11.11.0",
31
+ "@emotion/cache": "^11.11.0",
32
32
  "@fontsource/roboto": "^5.0.8",
33
33
  "@mui/icons-material": "^5.15.0",
34
34
  "@mui/material": "^5.15.0",