@zac-apps/commons 1.0.5-beta.5 → 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 -44
  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,15 +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
- return createCache({
196
- key: "css",
197
- prepend: true
198
- });
199
- }
200
-
201
189
  function AppMenu(_ref) {
202
190
  var title = _ref.title,
203
191
  children = _ref.children;
@@ -296,7 +284,8 @@ function NextListMenu(_ref) {
296
284
  });
297
285
  }
298
286
 
299
- function Footer() {
287
+ function Footer(_ref) {
288
+ var footerContent = _ref.footerContent;
300
289
  return /*#__PURE__*/jsxRuntime.jsx(React.Fragment, {
301
290
  children: /*#__PURE__*/jsxRuntime.jsx(Grid, {
302
291
  sx: {
@@ -311,46 +300,50 @@ function Footer() {
311
300
  children: /*#__PURE__*/jsxRuntime.jsx(Grid, {
312
301
  children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
313
302
  variant: "body2",
314
- children: footer_content_js.footerContent
303
+ children: footerContent
315
304
  })
316
305
  })
317
306
  })
318
307
  });
319
308
  }
320
309
 
321
- var clientSideEmotionCache = createEmotionCache();
322
310
  function AppWrapper(_ref) {
323
311
  var title = _ref.title,
324
312
  availApps = _ref.availApps,
325
- children = _ref.children;
326
- var basePath = process.env.basePath;
327
- return /*#__PURE__*/jsxRuntime.jsx(react.CacheProvider, {
328
- value: clientSideEmotionCache,
329
- children: /*#__PURE__*/jsxRuntime.jsxs(styles.ThemeProvider, {
330
- theme: AppTheme,
331
- children: [/*#__PURE__*/jsxRuntime.jsx(CssBaseline, {}), /*#__PURE__*/jsxRuntime.jsx(AppMenu, {
332
- title: /*#__PURE__*/jsxRuntime.jsx(Link$1, {
333
- sx: {
334
- color: AppTheme.palette.primary.contrastText
335
- },
336
- href: basePath,
337
- component: Link.Link,
338
- children: title
339
- }),
340
- children: /*#__PURE__*/jsxRuntime.jsx(NextListMenu, {
341
- availApps: availApps,
342
- start: true
343
- })
344
- }), /*#__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, {
345
325
  sx: {
346
- p: 3,
347
- minHeight: "calc(100% - 128px)",
348
- display: "flex",
349
- justifyContent: "center"
326
+ color: AppTheme.palette.primary.contrastText
350
327
  },
351
- children: children
352
- }), /*#__PURE__*/jsxRuntime.jsx(Footer, {})]
353
- })
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
+ })]
354
347
  });
355
348
  }
356
349
 
@@ -649,5 +642,4 @@ exports.RespGrid = RespGrid;
649
642
  exports.SpecSwitch = SpecSwitch;
650
643
  exports.Start = Start;
651
644
  exports.TableHeadCell = TableHeadCell;
652
- exports.createEmotionCache = createEmotionCache;
653
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.5",
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",