@xyo-network/react-webapp 4.1.9 → 4.1.10

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,16 +1,6 @@
1
- import type { WebAppNavigationType } from '@xylabs/react-app-settings';
2
- import type { FlexBoxProps } from '@xylabs/react-flexbox';
3
- import type { ReactNode } from 'react';
1
+ import { type WebAppChromeProps } from '@xylabs/react-webapp';
4
2
  import React from 'react';
5
- export interface WebAppChromeProps extends FlexBoxProps {
6
- appName: string;
7
- appbar?: ReactNode;
8
- errorBoundary?: boolean;
9
- errorPage?: ReactNode;
10
- footer?: ReactNode;
11
- footerElevation?: number;
12
- menuItems?: ReactNode;
13
- navigationType?: WebAppNavigationType;
3
+ export interface XyoWebAppChromeProps extends WebAppChromeProps {
14
4
  }
15
- export declare const WebAppChrome: React.ForwardRefExoticComponent<WebAppChromeProps & React.RefAttributes<HTMLDivElement>>;
5
+ export declare const XyoWebAppChrome: React.ForwardRefExoticComponent<XyoWebAppChromeProps & React.RefAttributes<HTMLDivElement>>;
16
6
  //# sourceMappingURL=Chrome.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chrome.d.ts","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAMzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,cAAc,CAAC,EAAE,oBAAoB,CAAA;CACtC;AAED,eAAO,MAAM,YAAY,0FAyCxB,CAAA"}
1
+ {"version":3,"file":"Chrome.d.ts","sourceRoot":"","sources":["../../../src/components/Chrome.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAG3E,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;CAAG;AAElE,eAAO,MAAM,eAAe,6FAe3B,CAAA"}
@@ -97,24 +97,34 @@ var WebAppBody = /* @__PURE__ */ __name(({ children, breadcrumbs, disableBreadcr
97
97
  }, "WebAppBody");
98
98
 
99
99
  // src/components/Chrome.tsx
100
- import { Divider, Paper } from "@mui/material";
101
- import { ErrorBoundary } from "@xylabs/react-error";
102
- import { FlexCol, FlexGrowCol as FlexGrowCol3, FlexGrowRow } from "@xylabs/react-flexbox";
103
- import { ApplicationAppBar, SystemToolbar } from "@xyo-network/react-appbar";
100
+ import { WebAppChrome } from "@xylabs/react-webapp";
101
+ import { XyoApplicationAppBar } from "@xyo-network/react-appbar";
104
102
  import { Footer } from "@xyo-network/react-footer";
105
- import React4, { forwardRef } from "react";
106
- import { Helmet as Helmet2 } from "react-helmet";
103
+ import React2, { forwardRef } from "react";
104
+ var XyoWebAppChrome = /* @__PURE__ */ forwardRef(({ appbar, footer, footerElevation = 4, navigationType = "menu", ...props }, ref) => {
105
+ return /* @__PURE__ */ React2.createElement(WebAppChrome, {
106
+ ref,
107
+ appbar: appbar ?? /* @__PURE__ */ React2.createElement(XyoApplicationAppBar, null),
108
+ footerElevation,
109
+ navigationType,
110
+ footer: footer ?? /* @__PURE__ */ React2.createElement(Footer, {
111
+ dynamicHeight: true
112
+ }),
113
+ ...props
114
+ });
115
+ });
116
+ XyoWebAppChrome.displayName = "XyoWebAppChrome";
107
117
 
108
118
  // src/components/ErrorPage.tsx
109
119
  import { ButtonEx } from "@xylabs/react-button";
110
- import React3 from "react";
120
+ import React4 from "react";
111
121
 
112
122
  // src/components/Page.tsx
113
123
  import { Container, styled as styled2 } from "@mui/material";
114
124
  import { useAsyncEffect } from "@xylabs/react-async-effect";
115
125
  import { FlexGrowCol as FlexGrowCol2 } from "@xylabs/react-flexbox";
116
126
  import { useUserEvents } from "@xylabs/react-pixel";
117
- import React2 from "react";
127
+ import React3 from "react";
118
128
  import { Helmet } from "react-helmet";
119
129
  import { useLocation } from "react-router-dom";
120
130
  var WebAppPageRoot = styled2(FlexGrowCol2, {
@@ -147,13 +157,13 @@ var WebAppPage = /* @__PURE__ */ __name(({ disableGutters, disableBreadcrumbGutt
147
157
  title,
148
158
  userEvents
149
159
  ]);
150
- return /* @__PURE__ */ React2.createElement(WebAppPageRoot, {
160
+ return /* @__PURE__ */ React3.createElement(WebAppPageRoot, {
151
161
  mobileScrollingBreakpoint,
152
162
  variant,
153
163
  ...props
154
- }, /* @__PURE__ */ React2.createElement(Helmet, {
164
+ }, /* @__PURE__ */ React3.createElement(Helmet, {
155
165
  title
156
- }), container && container !== "none" ? /* @__PURE__ */ React2.createElement(Container, {
166
+ }), container && container !== "none" ? /* @__PURE__ */ React3.createElement(Container, {
157
167
  disableGutters,
158
168
  style: {
159
169
  alignItems: "stretch",
@@ -163,13 +173,13 @@ var WebAppPage = /* @__PURE__ */ __name(({ disableGutters, disableBreadcrumbGutt
163
173
  justifyContent: "flex-start"
164
174
  },
165
175
  maxWidth: container
166
- }, /* @__PURE__ */ React2.createElement(WebAppBody, {
176
+ }, /* @__PURE__ */ React3.createElement(WebAppBody, {
167
177
  disableBreadcrumbGutter,
168
178
  breadcrumbs,
169
179
  mobileScrollingBreakpoint,
170
180
  variant,
171
181
  ...props
172
- }, children)) : /* @__PURE__ */ React2.createElement(WebAppBody, {
182
+ }, children)) : /* @__PURE__ */ React3.createElement(WebAppBody, {
173
183
  disableBreadcrumbGutter,
174
184
  breadcrumbs,
175
185
  mobileScrollingBreakpoint,
@@ -181,62 +191,15 @@ var WebAppPage = /* @__PURE__ */ __name(({ disableGutters, disableBreadcrumbGutt
181
191
  var FlexPage = WebAppPage;
182
192
 
183
193
  // src/components/ErrorPage.tsx
184
- var WebAppErrorPage = /* @__PURE__ */ __name(({ error, ...props }) => /* @__PURE__ */ React3.createElement(WebAppPage, {
194
+ var WebAppErrorPage = /* @__PURE__ */ __name(({ error, ...props }) => /* @__PURE__ */ React4.createElement(WebAppPage, {
185
195
  title: "Oops! Something went wrong",
186
196
  ...props
187
- }, /* @__PURE__ */ React3.createElement("h1", null, "Oops! Something went wrong!"), /* @__PURE__ */ React3.createElement("p", null, `${error}`), /* @__PURE__ */ React3.createElement(ButtonEx, {
197
+ }, /* @__PURE__ */ React4.createElement("h1", null, "Oops! Something went wrong!"), /* @__PURE__ */ React4.createElement("p", null, `${error}`), /* @__PURE__ */ React4.createElement(ButtonEx, {
188
198
  href: "/",
189
199
  variant: "contained"
190
200
  }, "Homepage")), "WebAppErrorPage");
191
201
  var ErrorPage = WebAppErrorPage;
192
202
 
193
- // src/components/Chrome.tsx
194
- var WebAppChrome = /* @__PURE__ */ forwardRef(({ appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = "menu", ...props }, ref) => {
195
- return /* @__PURE__ */ React4.createElement(FlexCol, {
196
- id: "web-chrome-flex",
197
- alignItems: "stretch",
198
- overflow: "hidden",
199
- height: "100vh",
200
- ref,
201
- ...props
202
- }, /* @__PURE__ */ React4.createElement(Helmet2, {
203
- defaultTitle: appName,
204
- titleTemplate: `%s | ${appName}`
205
- }, /* @__PURE__ */ React4.createElement("meta", {
206
- content: "website",
207
- property: "og:type"
208
- })), appbar ?? /* @__PURE__ */ React4.createElement(ApplicationAppBar, {
209
- systemToolbar: /* @__PURE__ */ React4.createElement(SystemToolbar, {
210
- menuItems: navigationType === "menu" ? menuItems : void 0
211
- })
212
- }), /* @__PURE__ */ React4.createElement(FlexGrowRow, {
213
- id: "sidebar-nav-flex",
214
- overflow: "hidden",
215
- alignItems: "stretch"
216
- }, navigationType === "menu" ? null : /* @__PURE__ */ React4.createElement(React4.Fragment, null, menuItems, /* @__PURE__ */ React4.createElement(Divider, {
217
- orientation: "vertical"
218
- })), /* @__PURE__ */ React4.createElement(FlexGrowCol3, {
219
- id: "main-flex",
220
- justifyContent: "flex-start",
221
- alignItems: "stretch"
222
- }, errorBoundary ? /* @__PURE__ */ React4.createElement(ErrorBoundary, {
223
- fallbackWithError: /* @__PURE__ */ __name((error) => {
224
- return errorPage ?? /* @__PURE__ */ React4.createElement(WebAppErrorPage, {
225
- error
226
- });
227
- }, "fallbackWithError")
228
- }, children) : children)), /* @__PURE__ */ React4.createElement(FlexCol, {
229
- id: "footer-flex",
230
- alignItems: "stretch"
231
- }, /* @__PURE__ */ React4.createElement(Paper, {
232
- elevation: footerElevation,
233
- square: true
234
- }, footer ?? /* @__PURE__ */ React4.createElement(Footer, {
235
- dynamicHeight: true
236
- }))));
237
- });
238
- WebAppChrome.displayName = "WebAppChrome";
239
-
240
203
  // src/components/NotFoundPage/Page.tsx
241
204
  import { NotFound } from "@xyo-network/react-shared";
242
205
  import React5 from "react";
@@ -250,9 +213,9 @@ export {
250
213
  FlexPage,
251
214
  NotFoundPage,
252
215
  WebAppBody,
253
- WebAppChrome,
254
216
  WebAppErrorPage,
255
217
  WebAppNotFoundPage,
256
- WebAppPage
218
+ WebAppPage,
219
+ XyoWebAppChrome
257
220
  };
258
221
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Body.tsx","../../src/components/lib/cssValues.ts","../../src/components/Chrome.tsx","../../src/components/ErrorPage.tsx","../../src/components/Page.tsx","../../src/components/NotFoundPage/Page.tsx"],"sourcesContent":["import type { Breakpoint } from '@mui/material'\nimport { styled } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport { fixedContent, scrollableContent } from './lib/index.ts'\n\nconst WebAppBodyName = 'WebAppBody'\nconst propsNotForwarded = new Set(['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'])\nconst defaultStyledOptions = { shouldForwardProp: (prop: string) => !propsNotForwarded.has(prop) }\n\nconst WebAppBodyRoot = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Root',\n})<WebAppBodyProps>(({\n spacing, theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\n const scrollable = variant === 'scrollable'\n return theme.unstable_sx({\n alignItems: 'stretch',\n gap: 1,\n justifyContent: 'flex-start',\n overflowX: 'visible',\n overflowY: scrollable ? 'scroll' : 'hidden',\n paddingY: spacing,\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: { overflowY: 'scroll' },\n })\n})\n\nconst WebAppBodyBreadcrumb = styled(FlexRow, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Breadcrumb',\n})<WebAppBodyProps>(({\n theme, disableBreadcrumbGutter, spacing,\n}) =>\n theme.unstable_sx({\n justifyContent: 'start',\n marginX: disableBreadcrumbGutter ? 0 : spacing,\n }))\n\nconst WebAppBodyScrollableWrapper = styled(FlexGrowCol, {\n name: WebAppBodyName,\n slot: 'ScrollableWrapper',\n})<WebAppBodyProps>(() => ({ alignItems: 'stretch' }))\n\nconst WebAppBodyScrollable = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Scrollable',\n})<WebAppBodyProps>(({\n theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\n const props = variant === 'scrollable' ? scrollableContent : fixedContent\n return {\n ...props,\n alignItems: 'stretch',\n justifyContent: 'start',\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n inset: 'unset',\n position: 'relative',\n },\n }\n})\n\nexport interface WebAppBodyProps extends FlexBoxProps {\n breadcrumbs?: ReactNode\n disableBreadcrumbGutter?: boolean\n mobileScrollingBreakpoint?: Breakpoint\n spacing?: string | number\n variant?: 'scrollable' | 'fixed'\n}\n\nexport const WebAppBody: React.FC<WebAppBodyProps> = ({\n children,\n breadcrumbs,\n disableBreadcrumbGutter,\n mobileScrollingBreakpoint,\n spacing = 1,\n variant,\n ...props\n}) => {\n return (\n <WebAppBodyRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} spacing={spacing} variant={variant} {...props}>\n {breadcrumbs\n ? (\n <WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>\n {breadcrumbs}\n </WebAppBodyBreadcrumb>\n )\n : null}\n <WebAppBodyScrollableWrapper>\n <WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>\n {children}\n </WebAppBodyScrollable>\n </WebAppBodyScrollableWrapper>\n </WebAppBodyRoot>\n )\n}\n","import type { CSSProperties } from 'react'\n\nexport const scrollableWrap: CSSProperties = {\n inset: 0,\n position: 'absolute',\n} as const\n\nexport const fixedWrap: CSSProperties = {\n inset: 'unset',\n position: 'relative',\n} as const\n\n// Making a scrollable vs fixed wrapper and content is an inversion of the wrap and content styles\nexport const scrollableContent: CSSProperties = { ...fixedWrap } as const\n\nexport const fixedContent: CSSProperties = { ...scrollableWrap } as const\n","import { Divider, Paper } from '@mui/material'\nimport type { WebAppNavigationType } from '@xylabs/react-app-settings'\nimport { ErrorBoundary } from '@xylabs/react-error'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport {\n FlexCol, FlexGrowCol, FlexGrowRow,\n} from '@xylabs/react-flexbox'\nimport { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar'\nimport { Footer } from '@xyo-network/react-footer'\nimport type { ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\nimport { Helmet } from 'react-helmet'\n\nimport { WebAppErrorPage } from './ErrorPage.tsx'\n\nexport interface WebAppChromeProps extends FlexBoxProps {\n appName: string\n appbar?: ReactNode\n errorBoundary?: boolean\n errorPage?: ReactNode\n footer?: ReactNode\n footerElevation?: number\n menuItems?: ReactNode\n navigationType?: WebAppNavigationType\n}\n\nexport const WebAppChrome = forwardRef<HTMLDivElement, WebAppChromeProps>(\n ({\n appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props\n }, ref) => {\n return (\n <FlexCol id=\"web-chrome-flex\" alignItems=\"stretch\" overflow=\"hidden\" height=\"100vh\" ref={ref} {...props}>\n <Helmet defaultTitle={appName} titleTemplate={`%s | ${appName}`}>\n <meta content=\"website\" property=\"og:type\" />\n </Helmet>\n {appbar ?? <ApplicationAppBar systemToolbar={<SystemToolbar menuItems={navigationType === 'menu' ? menuItems : undefined} />} />}\n <FlexGrowRow id=\"sidebar-nav-flex\" overflow=\"hidden\" alignItems=\"stretch\">\n {navigationType === 'menu'\n ? null\n : (\n <>\n {menuItems}\n <Divider orientation=\"vertical\" />\n </>\n )}\n <FlexGrowCol id=\"main-flex\" justifyContent=\"flex-start\" alignItems=\"stretch\">\n {errorBoundary\n ? (\n <ErrorBoundary\n fallbackWithError={(error) => {\n return errorPage ?? <WebAppErrorPage error={error} />\n }}\n >\n {children}\n </ErrorBoundary>\n )\n : children}\n </FlexGrowCol>\n </FlexGrowRow>\n <FlexCol id=\"footer-flex\" alignItems=\"stretch\">\n <Paper elevation={footerElevation} square>\n {footer ?? <Footer dynamicHeight />}\n </Paper>\n </FlexCol>\n </FlexCol>\n )\n },\n)\n\nWebAppChrome.displayName = 'WebAppChrome'\n","import { ButtonEx } from '@xylabs/react-button'\nimport React from 'react'\n\nimport type { WebAppPageProps } from './Page.tsx'\nimport { WebAppPage } from './Page.tsx'\n\nexport interface WebAppErrorPageProps extends WebAppPageProps {\n error?: Error\n}\n\nexport const WebAppErrorPage: React.FC<WebAppErrorPageProps> = ({ error, ...props }) => (\n <WebAppPage title=\"Oops! Something went wrong\" {...props}>\n <h1>Oops! Something went wrong!</h1>\n <p>{`${error}`}</p>\n <ButtonEx href=\"/\" variant=\"contained\">\n Homepage\n </ButtonEx>\n </WebAppPage>\n)\n\n/** @deprecated use WebAppErrorPage instead */\nexport const ErrorPage = WebAppErrorPage\n","import type { ContainerProps } from '@mui/material'\nimport { Container, styled } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useLocation } from 'react-router-dom'\n\nimport type { WebAppBodyProps } from './Body.tsx'\nimport { WebAppBody } from './Body.tsx'\nimport { fixedWrap, scrollableWrap } from './lib/index.ts'\n\nconst WebAppPageRoot = styled(FlexGrowCol, {\n name: 'WebAppPage',\n shouldForwardProp: propName => propName !== 'mobileScrollingBreakpoint' && propName !== 'variant',\n slot: 'Root',\n})<WebAppPageProps>(({\n theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\n const props = variant === 'scrollable' ? scrollableWrap : fixedWrap\n return {\n ...props,\n alignItems: 'stretch',\n justifyContent: 'start',\n maxWidth: '100vw',\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n inset: 0,\n position: 'absolute',\n },\n }\n})\n\nexport interface WebAppPageProps extends WebAppBodyProps, FlexBoxProps {\n container?: ContainerProps['maxWidth'] | 'none'\n disableGutters?: boolean\n}\n\nexport const WebAppPage: React.FC<PropsWithChildren<WebAppPageProps>> = ({\n disableGutters,\n disableBreadcrumbGutter,\n title,\n container,\n children,\n breadcrumbs,\n mobileScrollingBreakpoint,\n variant = 'scrollable',\n ...props\n}) => {\n const userEvents = useUserEvents()\n const { pathname } = useLocation()\n\n useAsyncEffect(\n async () => {\n await userEvents?.viewContent({ name: title ?? 'NodeBasePage', path: location.pathname })\n },\n [pathname, title, userEvents],\n )\n\n return (\n <WebAppPageRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant} {...props}>\n <Helmet title={title} />\n {container && container !== 'none'\n ? (\n <Container\n disableGutters={disableGutters}\n style={{\n alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start',\n }}\n maxWidth={container}\n >\n <WebAppBody\n disableBreadcrumbGutter={disableBreadcrumbGutter}\n breadcrumbs={breadcrumbs}\n mobileScrollingBreakpoint={mobileScrollingBreakpoint}\n variant={variant}\n {...props}\n >\n {children}\n </WebAppBody>\n </Container>\n )\n : (\n <WebAppBody\n disableBreadcrumbGutter={disableBreadcrumbGutter}\n breadcrumbs={breadcrumbs}\n mobileScrollingBreakpoint={mobileScrollingBreakpoint}\n paddingX={disableGutters ? 0 : 1}\n variant={variant}\n {...props}\n >\n {children}\n </WebAppBody>\n )}\n </WebAppPageRoot>\n )\n}\n\n/** @deprecated use WebAppPagePage instead */\nexport const FlexPage = WebAppPage\n","import { NotFound } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport type { WebAppPageProps } from '../Page.tsx'\nimport { WebAppPage } from '../Page.tsx'\n\nexport const WebAppNotFoundPage: React.FC<WebAppPageProps> = ({ title, ...props }) => (\n <WebAppPage title={title ?? 'Sorry! Page Not Found'} {...props}>\n <NotFound />\n </WebAppPage>\n)\n\n/** @deprecated use WebAppNotFoundPage instead */\nexport const NotFoundPage = WebAppNotFoundPage\n"],"mappings":";;;;AACA,SAASA,cAAc;AAEvB,SAASC,aAAaC,eAAe;AAErC,OAAOC,WAAW;;;ACHX,IAAMC,iBAAgC;EAC3CC,OAAO;EACPC,UAAU;AACZ;AAEO,IAAMC,YAA2B;EACtCF,OAAO;EACPC,UAAU;AACZ;AAGO,IAAME,oBAAmC;EAAE,GAAGD;AAAU;AAExD,IAAME,eAA8B;EAAE,GAAGL;AAAe;;;ADN/D,IAAMM,iBAAiB;AACvB,IAAMC,oBAAoB,oBAAIC,IAAI;EAAC;EAA6B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,GAAGC;GACvD,gBAAAC,OAAA,cAACE,UAAAA,IAAAA,CAAAA,GAFwD;AAOtD,IAAMC,eAAeN;","names":["styled","FlexGrowCol","FlexRow","React","scrollableWrap","inset","position","fixedWrap","scrollableContent","fixedContent","WebAppBodyName","propsNotForwarded","Set","defaultStyledOptions","shouldForwardProp","prop","has","WebAppBodyRoot","styled","FlexGrowCol","name","slot","spacing","theme","mobileScrollingBreakpoint","variant","scrollable","unstable_sx","alignItems","gap","justifyContent","overflowX","overflowY","paddingY","breakpoints","down","WebAppBodyBreadcrumb","FlexRow","disableBreadcrumbGutter","marginX","WebAppBodyScrollableWrapper","WebAppBodyScrollable","props","scrollableContent","fixedContent","inset","position","WebAppBody","children","breadcrumbs","Divider","Paper","ErrorBoundary","FlexCol","FlexGrowCol","FlexGrowRow","ApplicationAppBar","SystemToolbar","Footer","React","forwardRef","Helmet","ButtonEx","React","Container","styled","useAsyncEffect","FlexGrowCol","useUserEvents","React","Helmet","useLocation","WebAppPageRoot","styled","FlexGrowCol","name","shouldForwardProp","propName","slot","theme","mobileScrollingBreakpoint","variant","props","scrollableWrap","fixedWrap","alignItems","justifyContent","maxWidth","breakpoints","down","inset","position","WebAppPage","disableGutters","disableBreadcrumbGutter","title","container","children","breadcrumbs","userEvents","useUserEvents","pathname","useLocation","useAsyncEffect","viewContent","path","location","React","Helmet","Container","style","display","flexDirection","flexGrow","WebAppBody","paddingX","FlexPage","WebAppErrorPage","error","props","React","WebAppPage","title","h1","p","ButtonEx","href","variant","ErrorPage","WebAppChrome","forwardRef","appName","appbar","children","errorBoundary","errorPage","footer","footerElevation","menuItems","navigationType","props","ref","React","FlexCol","id","alignItems","overflow","height","Helmet","defaultTitle","titleTemplate","meta","content","property","ApplicationAppBar","systemToolbar","SystemToolbar","undefined","FlexGrowRow","Divider","orientation","FlexGrowCol","justifyContent","ErrorBoundary","fallbackWithError","error","WebAppErrorPage","Paper","elevation","square","Footer","dynamicHeight","displayName","NotFound","React","WebAppNotFoundPage","title","props","React","WebAppPage","NotFound","NotFoundPage"]}
1
+ {"version":3,"sources":["../../src/components/Body.tsx","../../src/components/lib/cssValues.ts","../../src/components/Chrome.tsx","../../src/components/ErrorPage.tsx","../../src/components/Page.tsx","../../src/components/NotFoundPage/Page.tsx"],"sourcesContent":["import type { Breakpoint } from '@mui/material'\nimport { styled } from '@mui/material'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nimport { fixedContent, scrollableContent } from './lib/index.ts'\n\nconst WebAppBodyName = 'WebAppBody'\nconst propsNotForwarded = new Set(['mobileScrollingBreakpoint', 'variant', 'spacing', 'disableBreadcrumbGutter'])\nconst defaultStyledOptions = { shouldForwardProp: (prop: string) => !propsNotForwarded.has(prop) }\n\nconst WebAppBodyRoot = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Root',\n})<WebAppBodyProps>(({\n spacing, theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\n const scrollable = variant === 'scrollable'\n return theme.unstable_sx({\n alignItems: 'stretch',\n gap: 1,\n justifyContent: 'flex-start',\n overflowX: 'visible',\n overflowY: scrollable ? 'scroll' : 'hidden',\n paddingY: spacing,\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: { overflowY: 'scroll' },\n })\n})\n\nconst WebAppBodyBreadcrumb = styled(FlexRow, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Breadcrumb',\n})<WebAppBodyProps>(({\n theme, disableBreadcrumbGutter, spacing,\n}) =>\n theme.unstable_sx({\n justifyContent: 'start',\n marginX: disableBreadcrumbGutter ? 0 : spacing,\n }))\n\nconst WebAppBodyScrollableWrapper = styled(FlexGrowCol, {\n name: WebAppBodyName,\n slot: 'ScrollableWrapper',\n})<WebAppBodyProps>(() => ({ alignItems: 'stretch' }))\n\nconst WebAppBodyScrollable = styled(FlexGrowCol, {\n ...defaultStyledOptions,\n name: WebAppBodyName,\n slot: 'Scrollable',\n})<WebAppBodyProps>(({\n theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\n const props = variant === 'scrollable' ? scrollableContent : fixedContent\n return {\n ...props,\n alignItems: 'stretch',\n justifyContent: 'start',\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n inset: 'unset',\n position: 'relative',\n },\n }\n})\n\nexport interface WebAppBodyProps extends FlexBoxProps {\n breadcrumbs?: ReactNode\n disableBreadcrumbGutter?: boolean\n mobileScrollingBreakpoint?: Breakpoint\n spacing?: string | number\n variant?: 'scrollable' | 'fixed'\n}\n\nexport const WebAppBody: React.FC<WebAppBodyProps> = ({\n children,\n breadcrumbs,\n disableBreadcrumbGutter,\n mobileScrollingBreakpoint,\n spacing = 1,\n variant,\n ...props\n}) => {\n return (\n <WebAppBodyRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} spacing={spacing} variant={variant} {...props}>\n {breadcrumbs\n ? (\n <WebAppBodyBreadcrumb disableBreadcrumbGutter={disableBreadcrumbGutter} spacing={spacing}>\n {breadcrumbs}\n </WebAppBodyBreadcrumb>\n )\n : null}\n <WebAppBodyScrollableWrapper>\n <WebAppBodyScrollable mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant}>\n {children}\n </WebAppBodyScrollable>\n </WebAppBodyScrollableWrapper>\n </WebAppBodyRoot>\n )\n}\n","import type { CSSProperties } from 'react'\n\nexport const scrollableWrap: CSSProperties = {\n inset: 0,\n position: 'absolute',\n} as const\n\nexport const fixedWrap: CSSProperties = {\n inset: 'unset',\n position: 'relative',\n} as const\n\n// Making a scrollable vs fixed wrapper and content is an inversion of the wrap and content styles\nexport const scrollableContent: CSSProperties = { ...fixedWrap } as const\n\nexport const fixedContent: CSSProperties = { ...scrollableWrap } as const\n","import { WebAppChrome, type WebAppChromeProps } from '@xylabs/react-webapp'\nimport { XyoApplicationAppBar } from '@xyo-network/react-appbar'\nimport { Footer } from '@xyo-network/react-footer'\nimport React, { forwardRef } from 'react'\n\nexport interface XyoWebAppChromeProps extends WebAppChromeProps {}\n\nexport const XyoWebAppChrome = forwardRef<HTMLDivElement, XyoWebAppChromeProps>(\n ({\n appbar, footer, footerElevation = 4, navigationType = 'menu', ...props\n }, ref) => {\n return (\n <WebAppChrome\n ref={ref}\n appbar={appbar ?? <XyoApplicationAppBar />}\n footerElevation={footerElevation}\n navigationType={navigationType}\n footer={footer ?? <Footer dynamicHeight />}\n {...props}\n />\n )\n },\n)\n\nXyoWebAppChrome.displayName = 'XyoWebAppChrome'\n","import { ButtonEx } from '@xylabs/react-button'\nimport React from 'react'\n\nimport type { WebAppPageProps } from './Page.tsx'\nimport { WebAppPage } from './Page.tsx'\n\nexport interface WebAppErrorPageProps extends WebAppPageProps {\n error?: Error\n}\n\nexport const WebAppErrorPage: React.FC<WebAppErrorPageProps> = ({ error, ...props }) => (\n <WebAppPage title=\"Oops! Something went wrong\" {...props}>\n <h1>Oops! Something went wrong!</h1>\n <p>{`${error}`}</p>\n <ButtonEx href=\"/\" variant=\"contained\">\n Homepage\n </ButtonEx>\n </WebAppPage>\n)\n\n/** @deprecated use WebAppErrorPage instead */\nexport const ErrorPage = WebAppErrorPage\n","import type { ContainerProps } from '@mui/material'\nimport { Container, styled } from '@mui/material'\nimport { useAsyncEffect } from '@xylabs/react-async-effect'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexGrowCol } from '@xylabs/react-flexbox'\nimport { useUserEvents } from '@xylabs/react-pixel'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useLocation } from 'react-router-dom'\n\nimport type { WebAppBodyProps } from './Body.tsx'\nimport { WebAppBody } from './Body.tsx'\nimport { fixedWrap, scrollableWrap } from './lib/index.ts'\n\nconst WebAppPageRoot = styled(FlexGrowCol, {\n name: 'WebAppPage',\n shouldForwardProp: propName => propName !== 'mobileScrollingBreakpoint' && propName !== 'variant',\n slot: 'Root',\n})<WebAppPageProps>(({\n theme, mobileScrollingBreakpoint = 'sm', variant,\n}) => {\n const props = variant === 'scrollable' ? scrollableWrap : fixedWrap\n return {\n ...props,\n alignItems: 'stretch',\n justifyContent: 'start',\n maxWidth: '100vw',\n [theme.breakpoints.down(mobileScrollingBreakpoint)]: {\n inset: 0,\n position: 'absolute',\n },\n }\n})\n\nexport interface WebAppPageProps extends WebAppBodyProps, FlexBoxProps {\n container?: ContainerProps['maxWidth'] | 'none'\n disableGutters?: boolean\n}\n\nexport const WebAppPage: React.FC<PropsWithChildren<WebAppPageProps>> = ({\n disableGutters,\n disableBreadcrumbGutter,\n title,\n container,\n children,\n breadcrumbs,\n mobileScrollingBreakpoint,\n variant = 'scrollable',\n ...props\n}) => {\n const userEvents = useUserEvents()\n const { pathname } = useLocation()\n\n useAsyncEffect(\n async () => {\n await userEvents?.viewContent({ name: title ?? 'NodeBasePage', path: location.pathname })\n },\n [pathname, title, userEvents],\n )\n\n return (\n <WebAppPageRoot mobileScrollingBreakpoint={mobileScrollingBreakpoint} variant={variant} {...props}>\n <Helmet title={title} />\n {container && container !== 'none'\n ? (\n <Container\n disableGutters={disableGutters}\n style={{\n alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1, justifyContent: 'flex-start',\n }}\n maxWidth={container}\n >\n <WebAppBody\n disableBreadcrumbGutter={disableBreadcrumbGutter}\n breadcrumbs={breadcrumbs}\n mobileScrollingBreakpoint={mobileScrollingBreakpoint}\n variant={variant}\n {...props}\n >\n {children}\n </WebAppBody>\n </Container>\n )\n : (\n <WebAppBody\n disableBreadcrumbGutter={disableBreadcrumbGutter}\n breadcrumbs={breadcrumbs}\n mobileScrollingBreakpoint={mobileScrollingBreakpoint}\n paddingX={disableGutters ? 0 : 1}\n variant={variant}\n {...props}\n >\n {children}\n </WebAppBody>\n )}\n </WebAppPageRoot>\n )\n}\n\n/** @deprecated use WebAppPagePage instead */\nexport const FlexPage = WebAppPage\n","import { NotFound } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport type { WebAppPageProps } from '../Page.tsx'\nimport { WebAppPage } from '../Page.tsx'\n\nexport const WebAppNotFoundPage: React.FC<WebAppPageProps> = ({ title, ...props }) => (\n <WebAppPage title={title ?? 'Sorry! Page Not Found'} {...props}>\n <NotFound />\n </WebAppPage>\n)\n\n/** @deprecated use WebAppNotFoundPage instead */\nexport const NotFoundPage = WebAppNotFoundPage\n"],"mappings":";;;;AACA,SAASA,cAAc;AAEvB,SAASC,aAAaC,eAAe;AAErC,OAAOC,WAAW;;;ACHX,IAAMC,iBAAgC;EAC3CC,OAAO;EACPC,UAAU;AACZ;AAEO,IAAMC,YAA2B;EACtCF,OAAO;EACPC,UAAU;AACZ;AAGO,IAAME,oBAAmC;EAAE,GAAGD;AAAU;AAExD,IAAME,eAA8B;EAAE,GAAGL;AAAe;;;ADN/D,IAAMM,iBAAiB;AACvB,IAAMC,oBAAoB,oBAAIC,IAAI;EAAC;EAA6B;EAAW;EAAW;CAA0B;AAChH,IAAMC,uBAAuB;EAAEC,mBAAmB,wBAACC,SAAiB,CAACJ,kBAAkBK,IAAID,IAAAA,GAAzC;AAA+C;AAEjG,IAAME,iBAAiBC,OAAOC,aAAa;EACzC,GAAGN;EACHO,MAAMV;EACNW,MAAM;AACR,CAAA,EAAoB,CAAC,EACnBC,SAASC,OAAOC,4BAA4B,MAAMC,QAAO,MAC1D;AACC,QAAMC,aAAaD,YAAY;AAC/B,SAAOF,MAAMI,YAAY;IACvBC,YAAY;IACZC,KAAK;IACLC,gBAAgB;IAChBC,WAAW;IACXC,WAAWN,aAAa,WAAW;IACnCO,UAAUX;IACV,CAACC,MAAMW,YAAYC,KAAKX,yBAAAA,CAAAA,GAA6B;MAAEQ,WAAW;IAAS;EAC7E,CAAA;AACF,CAAA;AAEA,IAAMI,uBAAuBlB,OAAOmB,SAAS;EAC3C,GAAGxB;EACHO,MAAMV;EACNW,MAAM;AACR,CAAA,EAAoB,CAAC,EACnBE,OAAOe,yBAAy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B;IACAiB,OAAO;MACLzB,YAAY;MAAW0B,SAAS;MAAQC,eAAe;MAAUC,UAAU;MAAG3B,gBAAgB;IAChG;IACAC,UAAUS;KAEV,gBAAAW,OAAA,cAACO,YAAAA;IACCpB;IACAI;IACAlB;IACAC;IACC,GAAGC;KAEHe,QAAAA,CAAAA,IAKL,gBAAAU,OAAA,cAACO,YAAAA;IACCpB;IACAI;IACAlB;IACAmC,UAAUtB,iBAAiB,IAAI;IAC/BZ;IACC,GAAGC;KAEHe,QAAAA,CAAAA;AAKf,GA1DwE;AA6DjE,IAAMmB,WAAWxB;;;AD3FjB,IAAMyB,kBAAkD,wBAAC,EAAEC,OAAO,GAAGC,MAAAA,MAC1E,gBAAAC,OAAA,cAACC,YAAAA;EAAWC,OAAM;EAA8B,GAAGH;GACjD,gBAAAC,OAAA,cAACG,MAAAA,MAAG,6BAAA,GACJ,gBAAAH,OAAA,cAACI,KAAAA,MAAG,GAAGN,KAAAA,EAAO,GACd,gBAAAE,OAAA,cAACK,UAAAA;EAASC,MAAK;EAAIC,SAAQ;GAAY,UAAA,CAAA,GAJoB;AAWxD,IAAMC,YAAYX;;;AErBzB,SAASY,gBAAgB;AACzB,OAAOC,YAAW;AAKX,IAAMC,qBAAgD,wBAAC,EAAEC,OAAO,GAAGC,MAAAA,MACxE,gBAAAC,OAAA,cAACC,YAAAA;EAAWH,OAAOA,SAAS;EAA0B,GAAGC;GACvD,gBAAAC,OAAA,cAACE,UAAAA,IAAAA,CAAAA,GAFwD;AAOtD,IAAMC,eAAeN;","names":["styled","FlexGrowCol","FlexRow","React","scrollableWrap","inset","position","fixedWrap","scrollableContent","fixedContent","WebAppBodyName","propsNotForwarded","Set","defaultStyledOptions","shouldForwardProp","prop","has","WebAppBodyRoot","styled","FlexGrowCol","name","slot","spacing","theme","mobileScrollingBreakpoint","variant","scrollable","unstable_sx","alignItems","gap","justifyContent","overflowX","overflowY","paddingY","breakpoints","down","WebAppBodyBreadcrumb","FlexRow","disableBreadcrumbGutter","marginX","WebAppBodyScrollableWrapper","WebAppBodyScrollable","props","scrollableContent","fixedContent","inset","position","WebAppBody","children","breadcrumbs","WebAppChrome","XyoApplicationAppBar","Footer","React","forwardRef","XyoWebAppChrome","appbar","footer","footerElevation","navigationType","props","ref","dynamicHeight","displayName","ButtonEx","React","Container","styled","useAsyncEffect","FlexGrowCol","useUserEvents","React","Helmet","useLocation","WebAppPageRoot","styled","FlexGrowCol","name","shouldForwardProp","propName","slot","theme","mobileScrollingBreakpoint","variant","props","scrollableWrap","fixedWrap","alignItems","justifyContent","maxWidth","breakpoints","down","inset","position","WebAppPage","disableGutters","disableBreadcrumbGutter","title","container","children","breadcrumbs","userEvents","useUserEvents","pathname","useLocation","useAsyncEffect","viewContent","path","location","React","Helmet","Container","style","display","flexDirection","flexGrow","WebAppBody","paddingX","FlexPage","WebAppErrorPage","error","props","React","WebAppPage","title","h1","p","ButtonEx","href","variant","ErrorPage","NotFound","React","WebAppNotFoundPage","title","props","React","WebAppPage","NotFound","NotFoundPage"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-webapp",
3
- "version": "4.1.9",
3
+ "version": "4.1.10",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -46,15 +46,14 @@
46
46
  "@mui/icons-material": "^6.1.5",
47
47
  "@mui/material": "^6.1.5",
48
48
  "@mui/styles": "^6.1.5",
49
- "@xylabs/react-app-settings": "^5.2.7",
50
- "@xylabs/react-async-effect": "^5.2.7",
51
- "@xylabs/react-button": "^5.2.7",
52
- "@xylabs/react-error": "^5.2.7",
53
- "@xylabs/react-flexbox": "^5.2.7",
54
- "@xylabs/react-pixel": "^5.2.7",
55
- "@xyo-network/react-appbar": "^4.1.9",
56
- "@xyo-network/react-footer": "^4.1.9",
57
- "@xyo-network/react-shared": "^4.1.9",
49
+ "@xylabs/react-async-effect": "^5.2.9",
50
+ "@xylabs/react-button": "^5.2.9",
51
+ "@xylabs/react-flexbox": "^5.2.9",
52
+ "@xylabs/react-pixel": "^5.2.9",
53
+ "@xylabs/react-webapp": "^5.2.9",
54
+ "@xyo-network/react-appbar": "^4.1.10",
55
+ "@xyo-network/react-footer": "^4.1.10",
56
+ "@xyo-network/react-shared": "^4.1.10",
58
57
  "react": "^18.3.1",
59
58
  "react-dom": "^18.3.1",
60
59
  "react-helmet": "^6.1.0",
@@ -63,10 +62,10 @@
63
62
  "devDependencies": {
64
63
  "@storybook/react": "^8.3.6",
65
64
  "@types/react-helmet": "^6.1.11",
66
- "@xylabs/react-button": "^5.2.7",
67
- "@xylabs/react-flexbox": "^5.2.7",
68
- "@xylabs/react-link": "^5.2.7",
69
- "@xylabs/react-pixel": "^5.2.7",
65
+ "@xylabs/react-button": "^5.2.9",
66
+ "@xylabs/react-flexbox": "^5.2.9",
67
+ "@xylabs/react-link": "^5.2.9",
68
+ "@xylabs/react-pixel": "^5.2.9",
70
69
  "@xylabs/ts-scripts-yarn3": "^4.2.3",
71
70
  "@xylabs/tsconfig-react": "^4.2.3",
72
71
  "storybook": "^8.3.6",
@@ -1,21 +1,22 @@
1
1
  import { Breadcrumbs, List } from '@mui/material'
2
2
  import type { Meta, StoryFn } from '@storybook/react'
3
+ import { MenuListItemContainer } from '@xylabs/react-appbar'
3
4
  import { FlexRow } from '@xylabs/react-flexbox'
4
5
  import { LinkEx } from '@xylabs/react-link'
5
- import { MenuListItemContainer } from '@xyo-network/react-appbar'
6
+ import { Footer } from '@xyo-network/react-footer'
6
7
  import React from 'react'
7
8
  import { BrowserRouter } from 'react-router-dom'
8
9
 
9
- import { WebAppChrome } from './Chrome.tsx'
10
+ import { XyoWebAppChrome } from './Chrome.tsx'
10
11
  import type { WebAppPageProps } from './Page.tsx'
11
12
  import { WebAppPage } from './Page.tsx'
12
13
 
13
14
  const StorybookEntry = {
14
15
  argTypes: {},
15
- component: WebAppChrome,
16
+ component: XyoWebAppChrome,
16
17
  parameters: { docs: { page: null } },
17
- title: 'webapp/WebAppChrome',
18
- } as Meta<typeof WebAppChrome>
18
+ title: 'webapp/XyoWebAppChrome',
19
+ } as Meta<typeof XyoWebAppChrome>
19
20
 
20
21
  const rowArray = [32, 64, 128, 256, 512, 1024]
21
22
 
@@ -38,10 +39,10 @@ const Children: React.FC<WebAppPageProps> = props => (
38
39
  </WebAppPage>
39
40
  )
40
41
 
41
- const Template: StoryFn<typeof WebAppChrome> = (args) => {
42
+ const Template: StoryFn<typeof XyoWebAppChrome> = (args) => {
42
43
  return (
43
44
  <BrowserRouter>
44
- <WebAppChrome
45
+ <XyoWebAppChrome
45
46
  menuItems={(
46
47
  <List>
47
48
  <MenuListItemContainer primary="Hello" />
@@ -50,7 +51,7 @@ const Template: StoryFn<typeof WebAppChrome> = (args) => {
50
51
  height="calc(100vh - 2rem)"
51
52
  {...args}
52
53
  >
53
- </WebAppChrome>
54
+ </XyoWebAppChrome>
54
55
  </BrowserRouter>
55
56
  )
56
57
  }
@@ -1,70 +1,25 @@
1
- import { Divider, Paper } from '@mui/material'
2
- import type { WebAppNavigationType } from '@xylabs/react-app-settings'
3
- import { ErrorBoundary } from '@xylabs/react-error'
4
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
5
- import {
6
- FlexCol, FlexGrowCol, FlexGrowRow,
7
- } from '@xylabs/react-flexbox'
8
- import { ApplicationAppBar, SystemToolbar } from '@xyo-network/react-appbar'
1
+ import { WebAppChrome, type WebAppChromeProps } from '@xylabs/react-webapp'
2
+ import { XyoApplicationAppBar } from '@xyo-network/react-appbar'
9
3
  import { Footer } from '@xyo-network/react-footer'
10
- import type { ReactNode } from 'react'
11
4
  import React, { forwardRef } from 'react'
12
- import { Helmet } from 'react-helmet'
13
5
 
14
- import { WebAppErrorPage } from './ErrorPage.tsx'
6
+ export interface XyoWebAppChromeProps extends WebAppChromeProps {}
15
7
 
16
- export interface WebAppChromeProps extends FlexBoxProps {
17
- appName: string
18
- appbar?: ReactNode
19
- errorBoundary?: boolean
20
- errorPage?: ReactNode
21
- footer?: ReactNode
22
- footerElevation?: number
23
- menuItems?: ReactNode
24
- navigationType?: WebAppNavigationType
25
- }
26
-
27
- export const WebAppChrome = forwardRef<HTMLDivElement, WebAppChromeProps>(
8
+ export const XyoWebAppChrome = forwardRef<HTMLDivElement, XyoWebAppChromeProps>(
28
9
  ({
29
- appName, appbar, children, errorBoundary, errorPage, footer, footerElevation = 4, menuItems, navigationType = 'menu', ...props
10
+ appbar, footer, footerElevation = 4, navigationType = 'menu', ...props
30
11
  }, ref) => {
31
12
  return (
32
- <FlexCol id="web-chrome-flex" alignItems="stretch" overflow="hidden" height="100vh" ref={ref} {...props}>
33
- <Helmet defaultTitle={appName} titleTemplate={`%s | ${appName}`}>
34
- <meta content="website" property="og:type" />
35
- </Helmet>
36
- {appbar ?? <ApplicationAppBar systemToolbar={<SystemToolbar menuItems={navigationType === 'menu' ? menuItems : undefined} />} />}
37
- <FlexGrowRow id="sidebar-nav-flex" overflow="hidden" alignItems="stretch">
38
- {navigationType === 'menu'
39
- ? null
40
- : (
41
- <>
42
- {menuItems}
43
- <Divider orientation="vertical" />
44
- </>
45
- )}
46
- <FlexGrowCol id="main-flex" justifyContent="flex-start" alignItems="stretch">
47
- {errorBoundary
48
- ? (
49
- <ErrorBoundary
50
- fallbackWithError={(error) => {
51
- return errorPage ?? <WebAppErrorPage error={error} />
52
- }}
53
- >
54
- {children}
55
- </ErrorBoundary>
56
- )
57
- : children}
58
- </FlexGrowCol>
59
- </FlexGrowRow>
60
- <FlexCol id="footer-flex" alignItems="stretch">
61
- <Paper elevation={footerElevation} square>
62
- {footer ?? <Footer dynamicHeight />}
63
- </Paper>
64
- </FlexCol>
65
- </FlexCol>
13
+ <WebAppChrome
14
+ ref={ref}
15
+ appbar={appbar ?? <XyoApplicationAppBar />}
16
+ footerElevation={footerElevation}
17
+ navigationType={navigationType}
18
+ footer={footer ?? <Footer dynamicHeight />}
19
+ {...props}
20
+ />
66
21
  )
67
22
  },
68
23
  )
69
24
 
70
- WebAppChrome.displayName = 'WebAppChrome'
25
+ XyoWebAppChrome.displayName = 'XyoWebAppChrome'