@xyo-network/react-webapp 2.25.28 → 2.25.31

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.
@@ -1,9 +1,10 @@
1
1
  import { FlexBoxProps } from '@xylabs/sdk-react';
2
2
  import { ReactNode } from 'react';
3
3
  export interface WebAppChromeProps extends FlexBoxProps {
4
- appName?: string;
4
+ appName: string;
5
5
  footer?: ReactNode;
6
6
  appbar?: ReactNode;
7
7
  errorPage?: ReactNode;
8
+ footerElevation?: number;
8
9
  }
9
10
  export declare const WebAppChrome: React.FC<WebAppChromeProps>;
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { CssBaseline } from '@mui/material';
2
+ import { CssBaseline, Paper } from '@mui/material';
3
3
  import { FlexCol, FlexGrowCol, InvertableThemeProvider } from '@xylabs/sdk-react';
4
4
  import { ApplicationAppBar } from '@xyo-network/react-appbar';
5
5
  import { ErrorBoundary, ErrorPage, Footer, useAppSettings } from '@xyo-network/react-shared';
6
6
  import { appThemeOptions, partialDarkThemeOptions } from '@xyo-network/react-theme';
7
7
  import { Helmet } from 'react-helmet';
8
- export const WebAppChrome = ({ errorPage, appbar, footer, children, appName, ...props }) => {
8
+ export const WebAppChrome = ({ footerElevation = 4, errorPage, appbar, footer, children, appName, ...props }) => {
9
9
  const { darkMode } = useAppSettings();
10
- return (_jsxs(InvertableThemeProvider, { dark: darkMode, options: appThemeOptions, darkOptions: partialDarkThemeOptions, children: [_jsx(CssBaseline, {}), _jsx(Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: _jsx("meta", { content: "website", property: "og:type" }) }), _jsxs(FlexCol, { alignItems: "stretch", height: "100vh", ...props, children: [appbar ?? _jsx(ApplicationAppBar, {}), _jsx(FlexGrowCol, { overflow: "hidden", justifyContent: "flex-start", alignItems: "stretch", children: _jsx(ErrorBoundary, { fallback: errorPage ?? _jsx(ErrorPage, {}), children: children }) }), footer ?? _jsx(Footer, { dynamicHeight: true })] })] }));
10
+ return (_jsxs(InvertableThemeProvider, { dark: darkMode, options: appThemeOptions, darkOptions: partialDarkThemeOptions, children: [_jsx(CssBaseline, {}), _jsx(Helmet, { defaultTitle: appName, titleTemplate: `%s | ${appName}`, children: _jsx("meta", { content: "website", property: "og:type" }) }), _jsxs(FlexCol, { alignItems: "stretch", height: "100vh", ...props, children: [appbar ?? _jsx(ApplicationAppBar, {}), _jsx(FlexGrowCol, { overflow: "hidden", justifyContent: "flex-start", alignItems: "stretch", children: _jsx(ErrorBoundary, { fallback: errorPage ?? _jsx(ErrorPage, {}), children: children }) }), _jsx(Paper, { elevation: footerElevation, square: true, children: footer ?? _jsx(Footer, { dynamicHeight: true }) })] })] }));
11
11
  };
12
12
  //# sourceMappingURL=WebAppChrome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WebAppChrome.js","sourceRoot":"","sources":["../../../src/components/WebAppChrome.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAgB,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC5F,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAEnF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AASrC,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACtH,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAA;IAErC,OAAO,CACL,MAAC,uBAAuB,IAAC,IA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E,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC3I,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,EAAE,CAAA;IAErC,OAAO,CACL,MAAC,uBAAuB,IAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,uBAAuB,aACrG,KAAC,WAAW,KAAG,EACf,KAAC,MAAM,IAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,OAAO,EAAE,YAC7D,eAAM,OAAO,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,GAAG,GACtC,EACT,MAAC,OAAO,IAAC,UAAU,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,KAAK,KAAK,aACnD,MAAM,IAAI,KAAC,iBAAiB,KAAG,EAChC,KAAC,WAAW,IAAC,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,YAAY,EAAC,UAAU,EAAC,SAAS,YAC7E,KAAC,aAAa,IAAC,QAAQ,EAAE,SAAS,IAAI,KAAC,SAAS,KAAG,YAAG,QAAQ,GAAiB,GACnE,EACd,KAAC,KAAK,IAAC,SAAS,EAAE,eAAe,EAAE,MAAM,kBACtC,MAAM,IAAI,KAAC,MAAM,IAAC,aAAa,SAAG,GAC7B,IACA,IACc,CAC3B,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -12,9 +12,9 @@
12
12
  "dependencies": {
13
13
  "@emotion/react": "^11.9.0",
14
14
  "@emotion/styled": "^11.8.1",
15
- "@mui/icons-material": "^5.8.0",
16
- "@mui/lab": "^5.0.0-alpha.83",
17
- "@mui/material": "^5.8.1",
15
+ "@mui/icons-material": "^5.8.2",
16
+ "@mui/lab": "^5.0.0-alpha.84",
17
+ "@mui/material": "^5.8.2",
18
18
  "@mui/styles": "^5.8.0",
19
19
  "@xylabs/pixel": "^1.3.7",
20
20
  "@xylabs/sdk-js": "^2.5.5",
@@ -22,19 +22,19 @@
22
22
  "@xyo-network/api": "^2.20.38",
23
23
  "@xyo-network/core": "^2.20.38",
24
24
  "@xyo-network/network": "^2.20.38",
25
- "@xyo-network/react-appbar": "^2.25.28",
26
- "@xyo-network/react-shared": "^2.25.28",
27
- "@xyo-network/react-theme": "^2.25.28",
25
+ "@xyo-network/react-appbar": "^2.25.31",
26
+ "@xyo-network/react-shared": "^2.25.31",
27
+ "@xyo-network/react-theme": "^2.25.31",
28
28
  "lodash": "^4.17.21",
29
29
  "luxon": "^2.4.0",
30
30
  "react": "^18.1.0",
31
31
  "react-dom": "^18.1.0",
32
32
  "react-helmet": "^6.1.0",
33
- "react-icons": "^4.3.1",
33
+ "react-icons": "^4.4.0",
34
34
  "react-json-view": "^1.21.3",
35
35
  "react-router-dom": "^6.3.0",
36
36
  "tslib": "^2.4.0",
37
- "typedoc": "^0.22.15"
37
+ "typedoc": "^0.22.16"
38
38
  },
39
39
  "description": "Common React library for all XYO projects that use React",
40
40
  "devDependencies": {
@@ -115,6 +115,6 @@
115
115
  },
116
116
  "sideEffects": false,
117
117
  "types": "dist/esm/index.d.ts",
118
- "version": "2.25.28",
118
+ "version": "2.25.31",
119
119
  "packageManager": "yarn@3.1.1"
120
120
  }
@@ -0,0 +1,38 @@
1
+ /* eslint-disable import/no-internal-modules */
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react'
3
+ import { FlexCol } from '@xylabs/sdk-react'
4
+ import { BrowserRouter } from 'react-router-dom'
5
+
6
+ import { FlexPage } from '../../../shared/src'
7
+ import { WebAppChrome } from './WebAppChrome'
8
+
9
+ const StorybookEntry = {
10
+ argTypes: {},
11
+ component: WebAppChrome,
12
+ parameters: {
13
+ docs: {
14
+ page: null,
15
+ },
16
+ },
17
+ title: 'webapp/WebAppChrome',
18
+ } as ComponentMeta<typeof WebAppChrome>
19
+
20
+ const Template: ComponentStory<typeof WebAppChrome> = (args) => {
21
+ return (
22
+ <FlexCol height="80vh" alignItems="stretch" overflow="hidden">
23
+ <BrowserRouter>
24
+ <WebAppChrome {...args}>
25
+ <FlexPage />
26
+ </WebAppChrome>
27
+ </BrowserRouter>
28
+ </FlexCol>
29
+ )
30
+ }
31
+
32
+ const Default = Template.bind({})
33
+ Default.args = {}
34
+
35
+ export { Default }
36
+
37
+ // eslint-disable-next-line import/no-default-export
38
+ export default StorybookEntry
@@ -1,4 +1,4 @@
1
- import { CssBaseline } from '@mui/material'
1
+ import { CssBaseline, Paper } from '@mui/material'
2
2
  import { FlexBoxProps, FlexCol, FlexGrowCol, InvertableThemeProvider } from '@xylabs/sdk-react'
3
3
  import { ApplicationAppBar } from '@xyo-network/react-appbar'
4
4
  import { ErrorBoundary, ErrorPage, Footer, useAppSettings } from '@xyo-network/react-shared'
@@ -7,13 +7,14 @@ import { ReactNode } from 'react'
7
7
  import { Helmet } from 'react-helmet'
8
8
 
9
9
  export interface WebAppChromeProps extends FlexBoxProps {
10
- appName?: string
10
+ appName: string
11
11
  footer?: ReactNode
12
12
  appbar?: ReactNode
13
13
  errorPage?: ReactNode
14
+ footerElevation?: number
14
15
  }
15
16
 
16
- export const WebAppChrome: React.FC<WebAppChromeProps> = ({ errorPage, appbar, footer, children, appName, ...props }) => {
17
+ export const WebAppChrome: React.FC<WebAppChromeProps> = ({ footerElevation = 4, errorPage, appbar, footer, children, appName, ...props }) => {
17
18
  const { darkMode } = useAppSettings()
18
19
 
19
20
  return (
@@ -27,7 +28,9 @@ export const WebAppChrome: React.FC<WebAppChromeProps> = ({ errorPage, appbar, f
27
28
  <FlexGrowCol overflow="hidden" justifyContent="flex-start" alignItems="stretch">
28
29
  <ErrorBoundary fallback={errorPage ?? <ErrorPage />}>{children}</ErrorBoundary>
29
30
  </FlexGrowCol>
30
- {footer ?? <Footer dynamicHeight />}
31
+ <Paper elevation={footerElevation} square>
32
+ {footer ?? <Footer dynamicHeight />}
33
+ </Paper>
31
34
  </FlexCol>
32
35
  </InvertableThemeProvider>
33
36
  )